0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-13 05:50:44 -05:00
launcher/project/SPT.Launcher/Views/SettingsView.axaml

112 lines
5.7 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:helpers="using:SPT.Launcher.Helpers"
xmlns:cc="using:SPT.Launcher.CustomControls"
xmlns:model="using:SPT.Launcher.Models.Launcher"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPT.Launcher.Views.SettingsView">
<Grid RowDefinitions="10,AUTO,AUTO,*, AUTO, AUTO, AUTO,10" ColumnDefinitions="10,2*,2*,AUTO,10">
<!-- Backdrop -->
<Rectangle Fill="{DynamicResource BackgroundBrush}"
Grid.RowSpan="8" Grid.ColumnSpan="5"
Opacity=".7"
/>
<WrapPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal">
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=remove_registry_keys}"
Command="{Binding RemoveRegistryKeysCommand}"
Classes="outlined" Margin="0 0 10 5"
/>
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=load_live_settings}"
Command="{Binding ResetGameSettingsCommand}"
Classes="outlined" Margin="0 0 10 5"
/>
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=clear_game_settings}"
Command="{Binding ClearGameSettingsCommand}"
Classes="outlined" Margin="0 0 10 5"
/>
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=clean_temp_files}"
Command="{Binding CleanTempFilesCommand}"
Classes="outlined" Margin="0 0 10 5"
/>
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=copy_logs_to_clipboard}"
Command="{Binding CopyLogsToClipboard}"
Classes="outlined" Margin="0 0 10 5"
/>
</WrapPanel>
<!-- Go Back -->
<Button Content="&#x279C;" FontSize="25"
Grid.Row="1" Grid.Column="3"
Command="{Binding GoBackCommand}"
Classes="link"
/>
<!-- Default locale -->
<StackPanel Grid.Row="2" Grid.Column="1">
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=default_language}"
/>
<!-- LocaleCollection reloads the locale from file when the selected loacle changes -->
<ComboBox ItemsSource="{Binding Locales.AvailableLocales}" MinWidth="200"
SelectedItem="{Binding Locales.SelectedLocale, Mode=TwoWay}"
/>
</StackPanel>
<!-- Game Start Action -->
<StackPanel Grid.Row="2" Grid.Column="2">
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=on_game_start}"
/>
<cc:LocalizedLauncherActionSelector />
</StackPanel>
<!-- ROW 3 (extended space) -->
<CheckBox Grid.Row="4" Grid.Column="1" Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=dev_mode}" IsChecked="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=IsDevMode}"/>
<!-- Game Path -->
<StackPanel Grid.Row="5" Grid.Column="1" Margin="0 10 10 10" IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=IsDevMode}">
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=game_path}"
/>
<TextBox Watermark="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=game_path}"
Text="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=GamePath}"
VerticalContentAlignment="Center"
/>
</StackPanel>
<WrapPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" Margin="0 30 0 0" IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=IsDevMode}">
<!-- Select Folder -->
<Button x:Name="sfb" Command="{Binding SelectGameFolderCommand}" Margin="0 0 10 5">
<StackPanel Orientation="Horizontal" Spacing="5">
<Path Data="{StaticResource FolderWithPlus}" Fill="{Binding ElementName=sfb, Path=Foreground}"
/>
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=select_folder}"/>
</StackPanel>
</Button>
<!-- Open Folder -->
<Button x:Name="ofb" Command="{Binding OpenGameFolderCommand}" Margin="0 0 10 5">
<StackPanel Orientation="Horizontal" Spacing="5">
<!-- This geometry data isn't centered and I'm far too lazy to fix it, so I'm just adding a margin (waffle.lazy) -->
<Path Data="{StaticResource OpenFolder}" Fill="{Binding ElementName=ofb, Path=Foreground}"
Margin="0 4 0 0"
/>
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=open_folder}"/>
</StackPanel>
</Button>
</WrapPanel>
<!-- Server URL -->
<StackPanel Grid.Row="6" Grid.Column="1" IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=IsDevMode}">
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=url}"/>
<TextBox Watermark="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=url}"
Text="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=Server.Url}"
VerticalContentAlignment="Center"
/>
</StackPanel>
</Grid>
</UserControl>