Files
quiver-launcher/MainWindow.axaml
T
2026-02-05 10:27:02 +01:00

1315 lines
47 KiB
XML

<Window x:Class="N64RecompLauncher.MainWindow"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:anim="https://github.com/whistyun/AnimatedImage.Avalonia"
xmlns:local="clr-namespace:N64RecompLauncher"
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
Title="N64Recomp Launcher"
Width="1280" Height="720"
Background="{DynamicResource ThemeDarker}"
WindowState="Normal"
WindowStartupLocation="CenterScreen">
<Window.Resources>
<local:BooleanToStretchConverter x:Key="BooleanToStretchConverter"/>
<local:ThicknessConverter x:Key="ThicknessConverter"/>
<!-- Theme Color Resources -->
<SolidColorBrush x:Key="ThemeBase" Color="#18181b"/>
<SolidColorBrush x:Key="ThemeLighter" Color="#252527"/>
<SolidColorBrush x:Key="ThemeDarker" Color="#0e0e10"/>
<SolidColorBrush x:Key="ThemeBorder" Color="#2d2d30"/>
<SolidColorBrush x:Key="ThemeText" Color="White"/>
<SolidColorBrush x:Key="ThemeTextSecondary" Color="#B8B8B8"/>
<!-- list view -->
<DataTemplate x:Key="ListViewTemplate">
<Border Classes="gamecard" Height="{Binding ElementName=SlotSizeSlider, Path=Value}" Margin="0,0,0,12">
<Grid ClipToBounds="True">
<Panel ClipToBounds="True">
<Border CornerRadius="12" ClipToBounds="True">
<asyncImageLoader:AdvancedImage Source="{Binding IconUrl}"
ClipToBounds="True"
Height="{Binding ElementName=IconSizeSlider, Path=Value}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Opacity="{Binding ElementName=IconOpacitySlider, Path=Value}"
Margin="{Binding ElementName=IconMarginSlider, Path=Value, Converter={StaticResource ThicknessConverter}}"
Stretch="{Binding Path=IsChecked, ElementName=IconFillCheckBox, Converter={StaticResource BooleanToStretchConverter}}" />
</Border>
</Panel>
<Grid Margin="24">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="{Binding ElementName=TextMarginSlider, Path=Value, Converter={StaticResource ThicknessConverter}}" VerticalAlignment="Center">
<TextBlock Text="{Binding Name}"
FontSize="22"
FontWeight="Bold"
Foreground="{DynamicResource ThemeText}"/>
<TextBlock Text="{Binding StatusText}"
FontSize="13"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,6,0,0"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Latest: "
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"/>
<TextBlock Text="{Binding LatestVersion}"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"/>
</StackPanel>
</StackPanel>
<!-- Gamecard: Options -->
<StackPanel Grid.Column="1"
Orientation="Horizontal"
VerticalAlignment="Center"
Spacing="12">
<Button Classes="modern"
Content="{Binding ButtonText}"
FontSize="15"
MinWidth="160"
Height="48"
IsEnabled="{Binding IsLoading, Converter={x:Static local:BoolInverterConverter.Instance}}"
Click="GameButton_Click"
Tag="{Binding}"/>
<Button Classes="options options-listview"
Content="⋯"
FontSize="20"
Height="48"
Width="48"
IsEnabled="{Binding IsLoading, Converter={x:Static local:BoolInverterConverter.Instance}}"
Click="OptionsButton_Click"
Tag="{Binding}">
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="Open GitHub Page"
Click="OpenGitHubPage_Click"
CommandParameter="{Binding}"/>
<MenuItem Header="Add Custom Image"
Click="SetCustomIcon_Click"
CommandParameter="{Binding}"/>
<MenuItem Header="Remove Custom Image"
Click="RemoveCustomIcon_Click"
CommandParameter="{Binding}"
IsVisible="{Binding HasCustomIcon}"/>
<MenuItem Header="Hide Game"
Click="HideGame_Click"
CommandParameter="{Binding}"/>
<MenuItem Header="Open Folder"
Click="OpenFolder_Click"
IsVisible="{Binding IsInstalled}"
CommandParameter="{Binding}"/>
<MenuItem Header="Select Different Executable"
CommandParameter="{Binding}"
Click="SelectDifferentExecutable_Click"
IsVisible="{Binding HasStoredExecutable}"/>
<MenuItem Header="Create Desktop Shortcut"
Click="CreateShortcut_Click"
IsVisible="{Binding IsInstalled}"
CommandParameter="{Binding}"/>
<MenuItem Header="Delete"
Click="DeleteGame_Click"
IsVisible="{Binding IsInstalled}"
CommandParameter="{Binding}"/>
</ContextMenu>
</Button.ContextMenu>
</Button>
</StackPanel>
<!-- Progress Bar -->
<Border Grid.ColumnSpan="2"
VerticalAlignment="Bottom"
Height="4"
CornerRadius="0,0,12,12"
ClipToBounds="True"
IsVisible="{Binding IsDownloading}">
<ProgressBar Value="{Binding DownloadProgress}"
Minimum="0"
Maximum="100"
Height="4"
Background="Transparent"
Foreground="{Binding ProgressBarColor}"
BorderThickness="0"/>
</Border>
</Grid>
</Grid>
</Border>
</DataTemplate>
<!-- grid view -->
<DataTemplate x:Key="GridViewTemplate">
<StackPanel>
<Border Classes="gamecardgrid">
<Border.Width>
<Binding ElementName="SlotSizeSlider" Path="Value"/>
</Border.Width>
<Grid ClipToBounds="True">
<!-- Background Image -->
<Panel ClipToBounds="True"
Margin="{Binding ElementName=IconMarginSlider, Path=Value}"
VerticalAlignment="Top"
HorizontalAlignment="Center">
<Border CornerRadius="12" ClipToBounds="True">
<asyncImageLoader:AdvancedImage Source="{Binding IconUrl}"
ClipToBounds="True"
VerticalAlignment="Center"
Opacity="{Binding ElementName=IconOpacitySlider, Path=Value}"
Height="{Binding ElementName=IconSizeSlider, Path=Value}"
Stretch="{Binding Path=IsChecked, ElementName=IconFillCheckBox, Converter={StaticResource BooleanToStretchConverter}}" />
</Border>
</Panel>
<!-- Options Button - Top Right -->
<Button Classes="options-grid"
Width="40"
Height="40"
FontSize="18"
VerticalAlignment="Top"
HorizontalAlignment="Right"
Margin="12"
IsEnabled="{Binding IsLoading, Converter={x:Static local:BoolInverterConverter.Instance}}"
Click="OptionsButton_Click"
Tag="{Binding}">
<TextBlock Text="⋯" Foreground="{DynamicResource ThemeText}" TextAlignment="Center" VerticalAlignment="Center"/>
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="Open GitHub Page"
Click="OpenGitHubPage_Click"
CommandParameter="{Binding}"/>
<MenuItem Header="Add Custom Image"
Click="SetCustomIcon_Click"
CommandParameter="{Binding}"/>
<MenuItem Header="Remove Custom Image"
Click="RemoveCustomIcon_Click"
CommandParameter="{Binding}"
IsVisible="{Binding HasCustomIcon}"/>
<MenuItem Header="Hide Game"
Click="HideGame_Click"
CommandParameter="{Binding}"/>
<MenuItem Header="Open Folder"
Click="OpenFolder_Click"
IsVisible="{Binding IsInstalled}"
CommandParameter="{Binding}"/>
<MenuItem Header="Select Different Executable"
CommandParameter="{Binding}"
Click="SelectDifferentExecutable_Click"
IsVisible="{Binding HasStoredExecutable}"/>
<MenuItem Header="Create Desktop Shortcut"
Click="CreateShortcut_Click"
IsVisible="{Binding IsInstalled}"
CommandParameter="{Binding}"/>
<MenuItem Header="Delete"
Click="DeleteGame_Click"
IsVisible="{Binding IsInstalled}"
CommandParameter="{Binding}"/>
</ContextMenu>
</Button.ContextMenu>
</Button>
<!-- Progress Bar -->
<Border VerticalAlignment="Bottom"
Height="4"
CornerRadius="0,0,12,12"
ClipToBounds="True"
IsVisible="{Binding IsDownloading}">
<ProgressBar Value="{Binding DownloadProgress}"
Minimum="0"
Maximum="100"
Height="4"
Background="Transparent"
Foreground="{Binding ProgressBarColor}"
BorderThickness="0"/>
</Border>
</Grid>
</Border>
<!-- Info Bar Below Card -->
<Grid>
<Grid.Width>
<Binding ElementName="SlotSizeSlider" Path="Value"/>
</Grid.Width>
<Grid Margin="10,0,10,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Download/Launch Button -->
<Button Grid.Column="0"
Classes="modern-icon"
VerticalAlignment="Top"
Width="48"
Height="48"
Margin="0,0,12,0"
IsEnabled="{Binding IsLoading, Converter={x:Static local:BoolInverterConverter.Instance}}"
Click="GameButton_Click"
Tag="{Binding}">
<Image Width="48" Source="{Binding ButtonImage}"/>
</Button>
<!-- Game Info -->
<StackPanel Grid.Column="1" VerticalAlignment="Center">
<TextBlock Text="{Binding Name}"
FontSize="14"
FontWeight="Bold"
Foreground="{DynamicResource ThemeText}"
TextAlignment="Left"
TextWrapping="Wrap"
Margin="0,0,0,4"/>
<TextBlock Text="{Binding StatusText}"
FontSize="11"
Foreground="{DynamicResource ThemeTextSecondary}"
TextAlignment="Left"
TextWrapping="Wrap"
Margin="0,0,0,2"/>
<TextBlock FontSize="10" Foreground="{DynamicResource ThemeTextSecondary}" TextWrapping="Wrap" TextAlignment="Left">
<Run Text="Latest: "/>
<Run Text="{Binding LatestVersion}" Foreground="{DynamicResource ThemeTextSecondary}"/>
</TextBlock>
</StackPanel>
</Grid>
</Grid>
</StackPanel>
</DataTemplate>
</Window.Resources>
<Window.Styles>
<Style Selector="Button.modern">
<Setter Property="Background" Value="{Binding ButtonColor}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="20,10"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="6"
Padding="{TemplateBinding Padding}">
<ContentPresenter
Name="PART_ContentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{TemplateBinding Foreground}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"/>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Button.modern:pointerover">
<Setter Property="Opacity" Value="0.85"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<Style Selector="Button.modern:pressed">
<Setter Property="Opacity" Value="0.7"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<!-- Modern Icon Button Style for Grid View -->
<Style Selector="Button.modern-icon">
<Setter Property="Background" Value="{Binding ButtonColor}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="8"
Padding="{TemplateBinding Padding}">
<ContentPresenter
Name="PART_ContentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{TemplateBinding Foreground}"/>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Button.modern-icon:pointerover">
<Setter Property="Opacity" Value="0.85"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<Style Selector="Button.modern-icon:pressed">
<Setter Property="Opacity" Value="0.7"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<Style Selector="Button.options">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="Padding" Value="10"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="6"
Padding="{TemplateBinding Padding}">
<ContentPresenter
Name="PART_ContentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{TemplateBinding Foreground}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"/>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Button.options:pointerover">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<Style Selector="Button.options:pressed">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<!-- Grid Options Button Style -->
<Style Selector="Button.options-grid">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Opacity" Value="0"/>
<Setter Property="Template">
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="8"
Padding="{TemplateBinding Padding}">
<ContentPresenter
Name="PART_ContentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{TemplateBinding Foreground}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"/>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Border.gamecardgrid:pointerover Button.options-grid, Border.gamecardgrid:focus-within Button.options-grid">
<Setter Property="Opacity" Value="1"/>
</Style>
<Style Selector="Button.options-grid:pointerover">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<Style Selector="Button.options-grid:pressed">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<Style Selector="Button.settings">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeTextSecondary}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="12,10"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Cursor" Value="Hand"/>
</Style>
<Style Selector="Button.settings:pointerover">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<Style Selector="Button.settings:pressed">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<Style Selector="Button.iconbutton">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
</Style>
<Style Selector="Button.iconbutton:pointerover">
<Setter Property="Opacity" Value="0.7"/>
</Style>
<Style Selector="Button.iconbutton:pressed">
<Setter Property="Opacity" Value="0.5"/>
</Style>
<Style Selector="Border.gamecard">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="CornerRadius" Value="14"/>
<Setter Property="Margin" Value="0,0,0,12"/>
</Style>
<Style Selector="Border.gamecardgrid">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="CornerRadius" Value="14"/>
<Setter Property="Margin" Value="10"/>
</Style>
<Style Selector="ContextMenu">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="4"/>
<Setter Property="CornerRadius" Value="8"/>
</Style>
<Style Selector="MenuItem">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="Padding" Value="10,8"/>
<Setter Property="CornerRadius" Value="4"/>
</Style>
<Style Selector="MenuItem:selected">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
</Style>
<Style Selector="MenuItem:focus">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="MenuItem:focus-visible">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<!-- Focus Visual Styles -->
<Style Selector="Button:focus">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Button:focus /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Button.modern:focus /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="3"/>
<Setter Property="Margin" Value="-1"/>
</Style>
<Style Selector="Button.modern-icon:focus /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="3"/>
<Setter Property="Margin" Value="-1"/>
</Style>
<Style Selector="Button.options:focus /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Button.options-grid:focus /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="3"/>
<Setter Property="Opacity" Value="1"/>
</Style>
<Style Selector="Button.options-grid:focus">
<Setter Property="Opacity" Value="1"/>
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
</Style>
<Style Selector="Button.settings:focus">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<Style Selector="Button.iconbutton:focus">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="CheckBox:focus /template/ Border#NormalRectangle">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Slider:focus /template/ Thumb">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<Style Selector="TextBox:focus /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<!-- Theme-aware text styles -->
<Style Selector="TextBlock.theme-text">
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<Style Selector="TextBlock.theme-text-secondary">
<Setter Property="Foreground" Value="{DynamicResource ThemeTextSecondary}"/>
</Style>
<Style Selector="TextBlock.theme-text-muted">
<Setter Property="Foreground" Value="{DynamicResource ThemeTextSecondary}"/>
<Setter Property="Opacity" Value="0.7"/>
</Style>
</Window.Styles>
<Grid x:Name="MainGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="240"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Left Sidebar Navigation -->
<Border Grid.Column="0" Background="{DynamicResource ThemeDarker}" BorderBrush="{DynamicResource ThemeBorder}" BorderThickness="0,0,1,0">
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Logo/Header -->
<StackPanel Grid.Row="0" Margin="20,30,20,30">
<Image anim:ImageBehavior.AnimatedSource="avares://N64RecompLauncher/Assets/icon.gif"
Width="80"
Height="80"
HorizontalAlignment="Center"
Margin="0,0,0,15"/>
<TextBlock Text="N64RECOMP"
FontSize="18"
FontWeight="Bold"
Foreground="{DynamicResource ThemeText}"
HorizontalAlignment="Center"
LetterSpacing="2"/>
<TextBlock Text="LAUNCHER"
FontSize="11"
FontWeight="Medium"
Foreground="{DynamicResource ThemeTextSecondary}"
HorizontalAlignment="Center"
LetterSpacing="3"
Margin="0,2,0,0"/>
</StackPanel>
<!-- Navigation Buttons -->
<StackPanel Grid.Row="1" Margin="12,0" VerticalAlignment="Top">
<!-- Continue Button -->
<Button x:Name="ContinueButton"
Classes="settings"
Margin="0,0,0,4"
CornerRadius="8"
Width="216"
Height="64"
HorizontalAlignment="Left"
Click="ContinueButton_Click"
IsVisible="{Binding IsContinueVisible}">
<Grid>
<asyncImageLoader:AdvancedImage Source="{Binding ContinueGameInfo.DefaultIconUrl}"
HorizontalAlignment="Right"
Stretch="Uniform"
Width="216"
Height="64"/>
<StackPanel Orientation="Horizontal">
<Image Width="32" Height="32"
Source="avares://N64RecompLauncher/Assets/Continue.png"
Margin="0,0,12,0"/>
<TextBlock Text="Continue"
VerticalAlignment="Center"/>
</StackPanel>
</Grid>
</Button>
<!-- Settings Button -->
<Button x:Name="SettingsButton"
Classes="settings"
Margin="0,0,0,4"
CornerRadius="8"
Width="216"
HorizontalAlignment="Left"
Click="SettingsButton_Click">
<StackPanel Orientation="Horizontal">
<Image Width="32" Height="32"
Source="avares://N64RecompLauncher/Assets/Settings.png"
Margin="0,0,12,0"/>
<TextBlock Text="Settings" VerticalAlignment="Center"/>
</StackPanel>
</Button>
<!-- Check for Updates Button -->
<Button x:Name="CheckForUpdatesButton"
Classes="settings"
Margin="0,0,0,4"
CornerRadius="8"
Width="216"
HorizontalAlignment="Left"
Click="CheckforUpdates_Click">
<StackPanel Orientation="Horizontal">
<Image Width="32" Height="32"
Source="avares://N64RecompLauncher/Assets/CheckForUpdates.png"
Margin="0,0,12,0"/>
<TextBlock Text="Check for Updates" VerticalAlignment="Center"/>
</StackPanel>
</Button>
</StackPanel>
<!-- Display Filters -->
<StackPanel Grid.Row="2" Margin="12,0,12,0">
<Border Height="1" Background="{DynamicResource ThemeBorder}" Margin="-12,0,-12,15"/>
<TextBlock Text="DISPLAY FILTERS"
FontSize="10"
FontWeight="Bold"
Foreground="{DynamicResource ThemeText}"
LetterSpacing="1"
Margin="12,0,0,4"/>
<Button x:Name="UnhideAllGamesButton"
Classes="settings"
Width="216"
HorizontalAlignment="Left"
Margin="0,0,0,4"
Click="UnhideAllGamesButton_Click">
<TextBlock Text="All Games"/>
</Button>
<Button x:Name="HideNonInstalledButton"
Classes="settings"
Width="216"
HorizontalAlignment="Left"
Margin="0,0,0,4"
Click="HideNonInstalledButton_Click">
<TextBlock Text="Installed Only"/>
</Button>
<Button x:Name="HideNonStableButton"
Classes="settings"
Width="216"
HorizontalAlignment="Left"
Margin="0,0,0,4"
Click="HideNonStableButton_Click"
IsVisible="{Binding ShowExperimentalGames}">
<TextBlock Text="Stable Only"/>
</Button>
<Button x:Name="OnlyExperimentalGamesButton"
Classes="settings"
Width="216"
HorizontalAlignment="Left"
Margin="0,0,0,4"
Click="OnlyExperimentalGamesButton_Click"
IsVisible="{Binding ShowExperimentalGames}">
<TextBlock Text="Experimental Only"/>
</Button>
<Button x:Name="OnlyCustomGamesButton"
Classes="settings"
Width="216"
HorizontalAlignment="Left"
Margin="0,0,0,8"
Click="OnlyCustomGamesButton_Click"
IsVisible="{Binding ShowCustomGames}">
<TextBlock Text="Custom Games Only"/>
</Button>
</StackPanel>
<!-- Footer Links -->
<StackPanel Grid.Row="3" Margin="12,0,12,20">
<Border Height="1" Background="{DynamicResource ThemeBorder}" Margin="-12,0,-12,15"/>
<Button Classes="iconbutton"
Width="216"
Height="44"
HorizontalAlignment="Left"
Click="DiscordButton_Click">
<StackPanel Orientation="Horizontal" Margin="12,0">
<Image Width="32" Height="32"
Source="avares://N64RecompLauncher/Assets/Discord.png"
Margin="0,0,12,0"/>
<TextBlock Text="Discord"
Foreground="{DynamicResource ThemeTextSecondary}"
FontSize="14"
FontWeight="Medium"
VerticalAlignment="Center"/>
</StackPanel>
</Button>
<Button Classes="iconbutton"
Width="216"
Height="44"
HorizontalAlignment="Left"
Click="GithubButton_Click">
<StackPanel Orientation="Horizontal" Margin="12,0">
<Image Width="32" Height="32"
Source="avares://N64RecompLauncher/Assets/Github.png"
Margin="0,0,12,0"/>
<TextBlock Text="GitHub"
Foreground="{DynamicResource ThemeTextSecondary}"
FontSize="14"
FontWeight="Medium"
VerticalAlignment="Center"/>
</StackPanel>
</Button>
</StackPanel>
</Grid>
</Border>
<!-- Main Content Area -->
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Top Bar -->
<Border Grid.Row="0"
Background="{DynamicResource ThemeDarker}"
BorderBrush="{DynamicResource ThemeBorder}"
BorderThickness="0,0,0,1"
Padding="0,8,0,8"
ZIndex="1">
<Grid VerticalAlignment="Top">
<TextBlock Text="Library"
FontSize="24"
Margin="15,0,0,0"
FontWeight="Bold"
Foreground="{DynamicResource ThemeText}"
VerticalAlignment="Center"/>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right"
VerticalAlignment="Center">
<!-- Version Text -->
<TextBlock Grid.Row="0"
Text="{Binding currentVersionString}"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Foreground="{DynamicResource ThemeText}"
FontSize="14"/>
<!-- Fullscreen Button -->
<Button Classes="modern-icon"
Width="28"
Margin="10,0,0,0"
Click="ToggleFullscreen_Click">
<Image Width="28"
Height="28"
Source="avares://N64RecompLauncher/Assets/Icons/button_fullscreen.png"/>
</Button>
<!-- Close Button -->
<Button Classes="modern-icon"
Width="28"
Margin="10,0,10,0"
Click="CloseLauncher_Click">
<Image Width="28"
Height="28"
Source="avares://N64RecompLauncher/Assets/Icons/button_close.png"/>
</Button>
</StackPanel>
</Grid>
</Border>
<!-- Games Content with Settings Panel Overlay -->
<Grid Grid.Row="1">
<!-- Animated Background
<Image anim:ImageBehavior.AnimatedSource="avares://N64RecompLauncher/Assets/background.gif"
Stretch="Fill"
Opacity="0.15"/> -->
<!-- Main Game List -->
<ScrollViewer VerticalScrollBarVisibility="Auto" x:Name="GameScrollViewer" Margin="30,20,30,30">
<Grid>
<ItemsControl ItemsSource="{Binding Games}" x:Name="ListViewControl"
IsVisible="{Binding ElementName=UseGridViewCheckBox, Path=IsChecked, Converter={x:Static local:BoolInverterConverter.Instance}}">
<ItemsControl.ItemTemplate>
<StaticResource ResourceKey="ListViewTemplate"/>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ItemsControl ItemsSource="{Binding Games}" x:Name="GridViewControl"
IsVisible="{Binding ElementName=UseGridViewCheckBox, Path=IsChecked}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<StaticResource ResourceKey="GridViewTemplate"/>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</ScrollViewer>
<!-- Settings Panel Overlay -->
<Border x:Name="SettingsPanel"
HorizontalAlignment="Right"
VerticalAlignment="Stretch"
Width="400"
Background="{DynamicResource ThemeDarker}"
BorderBrush="{DynamicResource ThemeBorder}"
BorderThickness="1,0,0,0"
IsVisible="False"
Opacity="0.97"
ZIndex="10">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="30,30,30,30" x:Name="SettingsContent">
<TextBlock Text="Settings"
FontSize="32"
FontWeight="Bold"
Foreground="{DynamicResource ThemeTextSecondary}"
HorizontalAlignment="Center"/>
<!-- General Section -->
<TextBlock Text="GENERAL"
FontSize="11"
FontWeight="Bold"
Foreground="{DynamicResource ThemeTextSecondary}"
LetterSpacing="1"
HorizontalAlignment="Right"
Margin="0,0,0,15"/>
<CheckBox x:Name="PortableCheckBox"
Content="Portable Mode"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
Checked="PortableCheckBox_Checked"
Unchecked="PortableCheckBox_Unchecked" />
<TextBlock Text="Store data in the game directory"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<CheckBox x:Name="ShowExperimentalCheckBox"
Content="Show Experimental Games"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
Checked="ShowExperimentalCheckBox_Checked"
Unchecked="ShowExperimentalCheckBox_Unchecked" />
<TextBlock Text="Show Recomp Games that are still experimental"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<CheckBox x:Name="ShowCustomGamesCheckBox"
Content="Show Custom Games"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
Checked="ShowCustomGamesCheckBox_Checked"
Unchecked="ShowCustomGamesCheckBox_Unchecked" />
<TextBlock Text="Show Non-Recomp Games, compatible with this launcher."
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,25"/>
<TextBlock Text="Custom Games Path"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<TextBlock Text="Enter a custom Game Install Path. Leave Blank for Default."
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
TextWrapping="Wrap"/>
<Panel HorizontalAlignment="Stretch"
Margin="0,0,0,8">
<TextBox x:Name="GamePathTextBox"
Foreground="{DynamicResource ThemeTextSecondary}"
Background="{DynamicResource ThemeTextDarker}"
BorderBrush="{DynamicResource ThemeBorder}"
BorderThickness="1"
Padding="12,10"
CornerRadius="4"
Margin="0,0,48,8"
TextChanged="GamePathTextBox_TextChanged"
Text="{Binding Settings.GamePath, Mode=TwoWay}"/>
<Button Classes="options"
HorizontalAlignment="Right"
Margin="8,0,0,8"
Content="📁"
Click="BrowseGamePath_Click">
</Button>
</Panel>
<Button Classes="options"
Content="Clear Custom Game Path"
HorizontalAlignment="Stretch"
Margin="0,0,0,8"
Click="ClearGamePath_Click"/>
<Button Classes="options"
Content="Clear Icon Cache"
HorizontalAlignment="Stretch"
Margin="0,0,0,30"
Click="ClearIconCache_Click"/>
<TextBlock Text="Target Platform"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<TextBlock Text="{Binding PlatformString}"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<Button Classes="options"
Content="Change Platform"
HorizontalAlignment="Stretch"
Margin="0,0,0,30"
Click="OptionsButton_Click"
Tag="{Binding}">
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="Automatic" Click="PlatformAuto_Click"/>
<MenuItem Header="Windows" Click="PlatformWindows_Click"/>
<MenuItem Header="MacOS" Click="PlatformMacOS_Click"/>
<MenuItem Header="Linux X64" Click="PlatformLinuxX64_Click"/>
<MenuItem Header="Linux ARM64" Click="PlatformLinuxARM64_Click"/> </ContextMenu>
</Button.ContextMenu>
</Button>
<!-- UI Customization Section -->
<TextBlock Text="UI CUSTOMIZATION"
FontSize="11"
FontWeight="Bold"
Foreground="{DynamicResource ThemeTextSecondary}"
LetterSpacing="1"
HorizontalAlignment="Right"
Margin="0,0,0,15"/>
<!-- Theme Color Picker -->
<TextBlock Text="Theme Color"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,4,0,8"/>
<Button Classes="options"
Content="Choose Theme Color"
HorizontalAlignment="Stretch"
Margin="0,0,0,8"
Click="ThemeColorPicker_Click"/>
<!-- Layout Presets -->
<TextBlock Text="Game Card Layout"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,4,0,8"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="8,8">
<!-- Layout Preset: Landscape -->
<Button Classes="modern-icon"
Width="64"
Margin="10,0,0,0"
Click="LayoutPreset_Landscape_Click">
<Image Width="64"
Height="64"
Source="avares://N64RecompLauncher/Assets/Icons/preset_landscape.png"/>
</Button>
<!-- Layout Preset: Square -->
<Button Classes="modern-icon"
Width="64"
Margin="10,0,0,0"
Click="LayoutPreset_Square_Click">
<Image Width="64"
Height="64"
Source="avares://N64RecompLauncher/Assets/Icons/preset_square.png"/>
</Button>
<!-- Layout Preset: Portrait -->
<Button Classes="modern-icon"
Width="64"
Margin="10,0,0,0"
Click="LayoutPreset_Portrait_Click">
<Image Width="64"
Height="64"
Source="avares://N64RecompLauncher/Assets/Icons/preset_portrait.png"/>
</Button>
<!-- Layout Preset: List -->
<Button Classes="modern-icon"
Width="64"
Margin="10,0,64,0"
Click="LayoutPreset_List_Click">
<Image Width="64"
Height="64"
Source="avares://N64RecompLauncher/Assets/Icons/preset_list.png"/>
</Button>
</StackPanel>
<CheckBox x:Name="StartFullscreenCheckBox"
Content="Start in Fullscreen"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
Checked="StartFullscreenCheckBox_Checked"
Unchecked="StartFullscreenCheckBox_Unchecked" />
<TextBlock Text="Start the launcher in fullscreen mode"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,20"/>
<CheckBox x:Name="UseGridViewCheckBox"
Content="Grid View"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
Checked="UseGridViewCheckBox_Checked"
Unchecked="UseGridViewCheckBox_Unchecked" />
<TextBlock Text="Display games in grid layout instead of list"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,20"/>
<TextBlock Text="Slot Scale"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<TextBlock Text="{Binding ElementName=SlotSizeSlider, Path=Value}"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<TextBlock Text="Adjust the size of game cards"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"/>
<Slider x:Name="SlotSizeSlider"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,20"
Minimum="120"
Maximum="400"
Value="120"
TickFrequency="4"
IsSnapToTickEnabled="True"
ValueChanged="SlotSizeSlider_ValueChanged" />
<TextBlock Text="Image Size"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<TextBlock Text="{Binding ElementName=IconSizeSlider, Path=Value}"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<TextBlock Text="Adjust game image dimensions"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"/>
<Slider x:Name="IconSizeSlider"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,20"
Minimum="64"
Maximum="512"
Value="256"
TickFrequency="4"
IsSnapToTickEnabled="True"
ValueChanged="IconSizeSlider_ValueChanged" />
<CheckBox x:Name="IconFillCheckBox"
Content="Fill Images"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
Checked="IconFillCheckBox_Checked"
Unchecked="IconFillCheckBox_Unchecked" />
<TextBlock Text="Stretch images to fill entire card slots"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,20"/>
<TextBlock Text="Image Opacity"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<TextBlock Text="{Binding ElementName=IconOpacitySlider, Path=Value, StringFormat={}{0:F1}}"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<Slider x:Name="IconOpacitySlider"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
Minimum="0.0"
Maximum="1.0"
Value="0.2"
TickFrequency="0.1"
IsSnapToTickEnabled="True"
ValueChanged="IconOpacitySlider_ValueChanged" />
<TextBlock Text="Control transparency of game images"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,20"/>
<TextBlock Text="Image Margin"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<TextBlock Text="{Binding ElementName=IconMarginSlider, Path=Value}"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<Slider x:Name="IconMarginSlider"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
Minimum="0"
Maximum="512"
Value="0"
TickFrequency="8"
IsSnapToTickEnabled="True"
ValueChanged="IconMarginSlider_ValueChanged" />
<TextBlock Text="Set left padding for images"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,20"/>
<TextBlock Text="Text Margin"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<TextBlock Text="{Binding ElementName=TextMarginSlider, Path=Value}"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<Slider x:Name="TextMarginSlider"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
Minimum="0"
Maximum="256"
Value="0"
TickFrequency="8"
IsSnapToTickEnabled="True"
ValueChanged="TextMarginSlider_ValueChanged" />
<TextBlock Text="Adjust left spacing of text labels"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,30"/>
<!-- GitHub API Token Section -->
<TextBlock Text="GITHUB API"
FontSize="11"
FontWeight="Bold"
Foreground="{DynamicResource ThemeTextSecondary}"
LetterSpacing="1"
HorizontalAlignment="Right"
Margin="0,0,0,15"/>
<TextBlock Text="GitHub API Token"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"/>
<TextBox x:Name="GitHubTokenTextBox"
Foreground="{DynamicResource ThemeTextSecondary}"
Background="{DynamicResource ThemeTextDarker}"
BorderBrush="{DynamicResource ThemeBorder}"
BorderThickness="1"
Padding="12,10"
CornerRadius="4"
Margin="0,0,0,8"
TextChanged="GitHubTokenTextBox_TextChanged"
Text="{Binding Settings.GitHubApiToken, Mode=TwoWay}"/>
<TextBlock Text="Enter your personal access token from GitHub to increase API call limits"
FontSize="12"
Foreground="{DynamicResource ThemeTextSecondary}"
Margin="0,0,0,8"
TextWrapping="Wrap"/>
<Button Classes="options"
Content="Clear Token"
HorizontalAlignment="Stretch"
Margin="0,0,0,30"
Click="ClearGitHubToken_Click"/>
</StackPanel>
</ScrollViewer>
</Border>
</Grid>
</Grid>
</Grid>
</Window>