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

112 lines
5.7 KiB
Plaintext
Raw Normal View History

2023-03-03 19:25:33 +00:00
<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"
2024-05-21 20:15:19 +01:00
xmlns:helpers="using:SPT.Launcher.Helpers"
xmlns:cc="using:SPT.Launcher.CustomControls"
xmlns:model="using:SPT.Launcher.Models.Launcher"
2023-03-03 19:25:33 +00:00
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
2024-05-21 20:15:19 +01:00
x:Class="SPT.Launcher.Views.SettingsView">
2023-03-03 19:25:33 +00:00
2024-06-02 14:46:53 -04:00
<Grid RowDefinitions="10,AUTO,AUTO,*, AUTO, AUTO, AUTO,10" ColumnDefinitions="10,2*,2*,AUTO,10">
2023-03-03 19:25:33 +00:00
<!-- Backdrop -->
<Rectangle Fill="{DynamicResource BackgroundBrush}"
2024-07-12 17:29:43 -04:00
Grid.RowSpan="8" Grid.ColumnSpan="5"
2023-03-03 19:25:33 +00:00
Opacity=".7"
/>
2023-08-22 19:42:14 -04:00
<WrapPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal">
2023-03-03 19:25:33 +00:00
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=remove_registry_keys}"
Command="{Binding RemoveRegistryKeysCommand}"
2024-07-12 17:29:43 -04:00
Classes="outlined" Margin="0 0 10 5"
2023-03-03 19:25:33 +00:00
/>
2023-10-05 13:46:41 -04:00
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=load_live_settings}"
Command="{Binding ResetGameSettingsCommand}"
2024-07-12 17:29:43 -04:00
Classes="outlined" Margin="0 0 10 5"
2023-10-05 13:46:41 -04:00
/>
2023-03-03 19:25:33 +00:00
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=clear_game_settings}"
Command="{Binding ClearGameSettingsCommand}"
2024-07-12 17:29:43 -04:00
Classes="outlined" Margin="0 0 10 5"
2023-03-03 19:25:33 +00:00
/>
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=clean_temp_files}"
Command="{Binding CleanTempFilesCommand}"
2024-07-12 17:29:43 -04:00
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"
2023-03-03 19:25:33 +00:00
/>
2023-08-22 19:42:14 -04:00
</WrapPanel>
2023-03-03 19:25:33 +00:00
<!-- Go Back -->
<Button Content="&#x279C;" FontSize="25"
2023-08-22 19:42:14 -04:00
Grid.Row="1" Grid.Column="3"
2023-03-03 19:25:33 +00:00
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 -->
2024-07-06 11:48:16 -04:00
<ComboBox ItemsSource="{Binding Locales.AvailableLocales}" MinWidth="200"
2023-10-11 09:45:58 -04:00
SelectedItem="{Binding Locales.SelectedLocale, Mode=TwoWay}"
2024-07-06 11:48:16 -04:00
/>
2023-03-03 19:25:33 +00:00
</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>
2024-06-02 14:46:53 -04:00
<!-- 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}"/>
2023-03-03 19:25:33 +00:00
<!-- Game Path -->
2024-06-02 14:46:53 -04:00
<StackPanel Grid.Row="5" Grid.Column="1" Margin="0 10 10 10" IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=IsDevMode}">
2024-07-12 17:29:43 -04:00
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=game_path}"
/>
2023-03-03 19:25:33 +00:00
<TextBox Watermark="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=game_path}"
Text="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=GamePath}"
2024-07-12 17:29:43 -04:00
VerticalContentAlignment="Center"
2023-03-03 19:25:33 +00:00
/>
</StackPanel>
2024-06-02 14:46:53 -04:00
<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}">
2023-03-03 19:25:33 +00:00
<!-- Select Folder -->
2023-08-22 19:42:14 -04:00
<Button x:Name="sfb" Command="{Binding SelectGameFolderCommand}" Margin="0 0 10 5">
2023-03-03 19:25:33 +00:00
<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 -->
2023-08-22 19:42:14 -04:00
<Button x:Name="ofb" Command="{Binding OpenGameFolderCommand}" Margin="0 0 10 5">
2023-03-03 19:25:33 +00:00
<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>
2023-08-22 19:42:14 -04:00
</WrapPanel>
2023-03-03 19:25:33 +00:00
<!-- Server URL -->
2024-06-02 14:46:53 -04:00
<StackPanel Grid.Row="6" Grid.Column="1" IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=IsDevMode}">
2023-03-03 19:25:33 +00:00
<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}"
2024-07-12 17:29:43 -04:00
VerticalContentAlignment="Center"
2023-03-03 19:25:33 +00:00
/>
</StackPanel>
</Grid>
</UserControl>