<ui:UiPage x:Class="Bloxstrap.UI.Elements.Menu.Pages.ModsPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:models="clr-namespace:Bloxstrap.UI.ViewModels"
      xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
      mc:Ignorable="d"
      d:DesignHeight="800" d:DesignWidth="800"
      Title="ModsPage"
      Scrollable="True">
  <StackPanel Margin="0,0,14,14">
    <TextBlock Text="Manage and apply file mods to the Roblox game client." FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />

    <Grid Margin="0,16,0,0">
      <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="*" />
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="*" />
      </Grid.ColumnDefinitions>
      <ui:CardAction Grid.Row="0" Grid.Column="0" x:Name="OpenModFolderCardAction" Margin="0,0,4,0" Icon="Folder24" Command="{Binding OpenModsFolderCommand}" IsEnabled="{Binding Source={x:Static models:GlobalViewModel.IsNotFirstRun}, Mode=OneTime}">
        <StackPanel>
          <TextBlock FontSize="14" Text="Open Mods Folder">
            <!--this is so fucking stupid the disabled state of the cardaction doesnt change the header text colour-->
            <TextBlock.Style>
              <Style>
                <Style.Triggers>
                  <DataTrigger Binding="{Binding ElementName=OpenModFolderCardAction, Path=IsEnabled, Mode=OneTime}" Value="False">
                    <Setter Property="TextBlock.Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
                  </DataTrigger>
                </Style.Triggers>
              </Style>
            </TextBlock.Style>
          </TextBlock>
          
          <TextBlock Margin="0,2,0,0" FontSize="12" Foreground="{DynamicResource TextFillColorTertiaryBrush}">
            <TextBlock.Style>
              <Style>
                <Setter Property="TextBlock.Text" Value="Manage custom Roblox mods here."/>
                <Style.Triggers>
                  <DataTrigger Binding="{Binding ElementName=OpenModFolderCardAction, Path=IsEnabled, Mode=OneTime}" Value="False">
                    <Setter Property="TextBlock.Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
                    <Setter Property="TextBlock.Text" Value="Bloxstrap must first be installed." />
                  </DataTrigger>
                </Style.Triggers>
              </Style>
            </TextBlock.Style>
          </TextBlock>
        </StackPanel>
      </ui:CardAction>
      <ui:CardAction Grid.Row="0" Grid.Column="1" Margin="4,0,0,0" Icon="BookQuestionMark24" Command="models:GlobalViewModel.OpenWebpageCommand" CommandParameter="https://github.com/pizzaboxer/bloxstrap/wiki/Adding-custom-mods">
        <StackPanel>
          <TextBlock FontSize="14" Text="Help" />
          <TextBlock Margin="0,2,0,0" FontSize="12" Text="See info about managing and creating mods." Padding="0,0,16,0"  Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
        </StackPanel>
      </ui:CardAction>
    </Grid>

    <TextBlock Text="Presets" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />

    <ui:CardControl Margin="0,8,0,0">
      <ui:CardControl.Header>
        <StackPanel>
          <TextBlock FontSize="14" Text="Use old death sound" />
          <TextBlock Margin="0,2,0,0" FontSize="12" Text="Bring back the classic 'oof' death sound." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
        </StackPanel>
      </ui:CardControl.Header>
      <ui:ToggleSwitch IsChecked="{Binding OldDeathSoundEnabled, Mode=TwoWay}" />
    </ui:CardControl>

    <ui:CardControl Margin="0,8,0,0">
      <ui:CardControl.Header>
        <StackPanel>
          <TextBlock FontSize="14" Text="Mouse cursor" />
          <TextBlock Margin="0,2,0,0" FontSize="12" Text="Choose between using two classic Roblox cursor styles." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
        </StackPanel>
      </ui:CardControl.Header>
      <ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding CursorTypes.Keys, Mode=OneTime}" Text="{Binding SelectedCursorType, Mode=TwoWay}" />
    </ui:CardControl>

    <ui:CardControl Margin="0,8,0,0">
      <ui:CardControl.Header>
        <StackPanel>
          <TextBlock FontSize="14" Text="Use old avatar editor background" />
          <TextBlock Margin="0,2,0,0" FontSize="12" Text="Bring back the old avatar editor background used in the Roblox app prior to 2020." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
        </StackPanel>
      </ui:CardControl.Header>
      <ui:ToggleSwitch IsChecked="{Binding OldAvatarBackground, Mode=TwoWay}" />
    </ui:CardControl>

    <ui:CardControl Margin="0,8,0,0">
      <ui:CardControl.Header>
        <StackPanel>
          <TextBlock FontSize="14" Text="Emulate old character sounds" />
          <TextBlock Margin="0,2,0,0" FontSize="12" Text="An attempt to roughly bring back the character sounds used prior to 2014." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
        </StackPanel>
      </ui:CardControl.Header>
      <ui:ToggleSwitch IsChecked="{Binding OldCharacterSoundsEnabled, Mode=TwoWay}" />
    </ui:CardControl>

    <ui:CardControl Margin="0,8,0,0">
      <ui:CardControl.Header>
        <StackPanel>
          <TextBlock FontSize="14" Text="Disable desktop app" />
          <TextBlock Margin="0,2,0,0" FontSize="12" Text="Stops the desktop app from showing, especially when you leave a game." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
        </StackPanel>
      </ui:CardControl.Header>
      <ui:ToggleSwitch IsChecked="{Binding DisableAppPatchEnabled, Mode=TwoWay}" />
    </ui:CardControl>

    <ui:CardControl Margin="0,8,0,0">
      <ui:CardControl.Header>
        <StackPanel>
          <TextBlock FontSize="14" Text="Preferred emoji type" />
          <TextBlock Margin="0,2,0,0" FontSize="12" Text="Choose which type of emoji should Roblox use." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
        </StackPanel>
      </ui:CardControl.Header>
      <ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding EmojiTypes.Keys, Mode=OneTime}" Text="{Binding SelectedEmojiType, Mode=TwoWay}" />
    </ui:CardControl>

    <StackPanel x:Name="MiscellaneousOptions">
      <TextBlock Text="Miscellaneous" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
      <ui:CardControl Margin="0,8,0,0">
        <ui:CardControl.Header>
          <StackPanel>
            <TextBlock FontSize="14" Text="Apply custom font" />
            <TextBlock Margin="0,2,0,0" FontSize="12" Foreground="{DynamicResource TextFillColorTertiaryBrush}">
              Forces every in-game font to be a font that you choose.
            </TextBlock>
          </StackPanel>
        </ui:CardControl.Header>
        <StackPanel>
          <ui:Button Icon="DocumentAdd16" Content="Choose font..." Command="{Binding ManageCustomFontCommand}" Visibility="{Binding ChooseCustomFontVisibility, Mode=OneWay}" />
          <ui:Button Icon="Delete16" Content="Remove applied font" Appearance="Danger" Command="{Binding ManageCustomFontCommand}" Visibility="{Binding DeleteCustomFontVisibility, Mode=OneWay}" />
        </StackPanel>
      </ui:CardControl>
      <ui:CardControl Margin="0,8,0,0">
        <ui:CardControl.Header>
          <StackPanel>
            <TextBlock FontSize="14" Text="Disable fullscreen optimizations" />
            <TextBlock Margin="0,2,0,0" FontSize="12" Foreground="{DynamicResource TextFillColorTertiaryBrush}">
              A Windows feature that intends to improve fullscreen performance. <Hyperlink Foreground="{DynamicResource TextFillColorPrimaryBrush}" Command="models:GlobalViewModel.OpenWebpageCommand" CommandParameter="https://devblogs.microsoft.com/directx/demystifying-full-screen-optimizations/">See here for more information</Hyperlink>.
            </TextBlock>
          </StackPanel>
        </ui:CardControl.Header>
        <ui:ToggleSwitch IsChecked="{Binding DisableFullscreenOptimizations, Mode=TwoWay}" />
      </ui:CardControl>
    </StackPanel>
  </StackPanel>
</ui:UiPage>
