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:cvt="using:SPT.Launcher.Converters"
|
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.ProfileView">
|
2024-01-26 12:35:57 -05:00
|
|
|
|
|
|
|
<UserControl.Resources>
|
|
|
|
<cvt:ImageSourceConverter x:Key="imageSourceCvt" />
|
|
|
|
</UserControl.Resources>
|
|
|
|
|
|
|
|
<Grid RowDefinitions="10,AUTO,10,AUTO,10,*,10,AUTO,10" ColumnDefinitions="10,AUTO,10,*,10">
|
|
|
|
|
|
|
|
<!-- profile info -->
|
|
|
|
<Border Grid.Row="1" Grid.Column="1" CornerRadius="5"
|
2024-07-06 20:06:43 -04:00
|
|
|
BorderBrush="{DynamicResource BackgroundBrush}"
|
2024-01-26 12:35:57 -05:00
|
|
|
BorderThickness="5">
|
|
|
|
<Grid RowDefinitions="10,AUTO,AUTO,AUTO,AUTO,10" ColumnDefinitions="10,AUTO,*,10"
|
2024-07-06 20:06:43 -04:00
|
|
|
Background="{DynamicResource BackgroundBrush}">
|
2024-01-26 12:35:57 -05:00
|
|
|
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
|
|
|
|
<Label Content="{Binding CurrentUsername}" Margin="5 0" />
|
|
|
|
|
|
|
|
<!-- profile name and version -->
|
2024-05-21 20:15:19 +01:00
|
|
|
<Label x:Name="SPTVersion"
|
2024-01-26 12:35:57 -05:00
|
|
|
Background="Transparent"
|
|
|
|
ToolTip.Tip="{Binding ProfileInfo.MismatchMessage}"
|
|
|
|
Classes.versionMismatch="{Binding ProfileInfo.VersionMismatch}">
|
|
|
|
<StackPanel Orientation="Horizontal" Background="Transparent">
|
2024-05-21 20:15:19 +01:00
|
|
|
<TextBlock Text="{Binding ProfileInfo.SPT.version}" />
|
2024-01-26 21:47:04 -05:00
|
|
|
<Path Data="{StaticResource Info}"
|
2024-05-21 20:15:19 +01:00
|
|
|
Fill="{Binding ElementName=SPTVersion, Path=Foreground}"
|
2024-01-26 12:35:57 -05:00
|
|
|
Margin="10 0"
|
|
|
|
IsVisible="{Binding ProfileInfo.VersionMismatch}" />
|
|
|
|
</StackPanel>
|
|
|
|
</Label>
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
<!-- delete profile button -->
|
|
|
|
<Button HorizontalAlignment="Right" Grid.Row="1" Grid.Column="2"
|
|
|
|
Classes="icon"
|
|
|
|
Command="{Binding RemoveProfileCommand}"
|
|
|
|
IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=!GameRunning}">
|
|
|
|
<Path Data="{StaticResource Delete}" Fill="IndianRed" />
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<!-- profile id button -->
|
|
|
|
<Button Content="{Binding CurrentID}" Classes="link"
|
|
|
|
Grid.Row="2" Grid.Column="1"
|
|
|
|
Command="{Binding CopyCommand}"
|
|
|
|
CommandParameter="{Binding CurrentID}" />
|
|
|
|
|
|
|
|
<!-- profile edition button -->
|
|
|
|
<Button Content="{Binding CurrentEdition}" Classes="link"
|
|
|
|
Grid.Row="3" Grid.Column="1"
|
|
|
|
Command="{Binding ChangeEditionCommand}"
|
|
|
|
IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=!GameRunning}" />
|
|
|
|
|
|
|
|
<!-- wipe profile checkbox -->
|
|
|
|
<CheckBox
|
|
|
|
Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=wipe_on_start}"
|
|
|
|
Grid.Row="4" Grid.Column="1"
|
|
|
|
IsChecked="{Binding WipeProfileOnStart}"
|
|
|
|
IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=!GameRunning}"
|
|
|
|
IsVisible="{Binding !ProfileWipePending}" />
|
2023-03-03 19:25:33 +00:00
|
|
|
</Grid>
|
2024-01-26 12:35:57 -05:00
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- Total Mods Info -->
|
|
|
|
<Border Grid.Row="3" Grid.Column="1" CornerRadius="5"
|
2024-07-06 20:06:43 -04:00
|
|
|
BorderBrush="{DynamicResource BackgroundBrush}"
|
2024-01-26 12:35:57 -05:00
|
|
|
BorderThickness="5" IsVisible="{Binding ModInfoCollection.HasMods}">
|
2024-01-26 21:47:04 -05:00
|
|
|
<Grid RowDefinitions="10,AUTO,10" ColumnDefinitions="10,Auto,*,AUTO,10"
|
2024-07-06 20:06:43 -04:00
|
|
|
Background="{DynamicResource BackgroundBrush}">
|
2024-01-26 21:47:04 -05:00
|
|
|
|
|
|
|
<!-- server mods count text -->
|
|
|
|
<Label Grid.Row="1" Grid.Column="1">
|
|
|
|
<Label.Content>
|
2024-01-29 12:17:07 +03:00
|
|
|
<MultiBinding StringFormat="{}{0}: {1}">
|
2024-01-26 21:47:04 -05:00
|
|
|
<Binding Source="{x:Static helpers:LocalizationProvider.Instance}" Path="active_server_mods"/>
|
2024-01-29 12:17:07 +03:00
|
|
|
<Binding Path="ModInfoCollection.ActiveMods.Count"/>
|
2024-01-26 21:47:04 -05:00
|
|
|
</MultiBinding>
|
|
|
|
</Label.Content>
|
|
|
|
</Label>
|
|
|
|
|
|
|
|
<!-- Show mods info view button -->
|
|
|
|
<Button Grid.Row="0" Grid.RowSpan="3" Grid.Column="3" Grid.ColumnSpan="2"
|
2024-01-26 12:35:57 -05:00
|
|
|
VerticalAlignment="Stretch" FontSize="18" Margin="10 0 0 0"
|
|
|
|
Command="{Binding OpenModsInfoCommand}"
|
|
|
|
Classes="icon">
|
|
|
|
<Button.Content>
|
2024-07-06 20:06:43 -04:00
|
|
|
<Path Data="{StaticResource Open}" Fill="{DynamicResource ForegroundBrush}"
|
2024-01-26 21:47:04 -05:00
|
|
|
VerticalAlignment="Center"
|
|
|
|
/>
|
2024-01-26 12:35:57 -05:00
|
|
|
</Button.Content>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- Bottom bar -->
|
|
|
|
<Border Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="3" CornerRadius="5"
|
2024-07-06 20:06:43 -04:00
|
|
|
BorderBrush="{DynamicResource BackgroundBrush}"
|
2024-01-26 12:35:57 -05:00
|
|
|
BorderThickness="5">
|
2024-07-06 20:06:43 -04:00
|
|
|
<DockPanel Background="{DynamicResource BackgroundBrush}">
|
2024-01-26 12:35:57 -05:00
|
|
|
|
|
|
|
<StackPanel Orientation="Horizontal"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Spacing="10"
|
|
|
|
IsVisible="{Binding ProfileInfo.HasData}">
|
|
|
|
<Grid RowDefinitions="AUTO,AUTO" ColumnDefinitions="AUTO,AUTO">
|
|
|
|
<Image Source="{Binding SideImage.Path, Converter={StaticResource imageSourceCvt}}"
|
|
|
|
Grid.RowSpan="2" Height="40" Margin="10 0" />
|
|
|
|
<Label Content="{Binding ProfileInfo.Nickname}" Grid.Row="0" Grid.Column="2" />
|
|
|
|
<Label Content="{Binding ProfileInfo.Side}" Grid.Row="1" Grid.Column="2" />
|
|
|
|
</Grid>
|
|
|
|
<Label Content="{Binding ProfileInfo.Level}" VerticalAlignment="Center"
|
|
|
|
FontSize="22" />
|
|
|
|
<ProgressBar Value="{Binding ProfileInfo.XPLevelProgress}" />
|
|
|
|
<StackPanel>
|
|
|
|
<Label
|
|
|
|
Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=next_level_in}"
|
|
|
|
HorizontalAlignment="Center" />
|
|
|
|
<Label Content="{Binding ProfileInfo.RemainingExp, StringFormat={}{0} xp}"
|
|
|
|
HorizontalAlignment="Center" />
|
|
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
|
|
|
|
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=start_game}"
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
VerticalContentAlignment="Center"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
DockPanel.Dock="Right"
|
|
|
|
Command="{Binding StartGameCommand}"
|
|
|
|
IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=!GameRunning}"
|
2024-07-06 20:06:43 -04:00
|
|
|
Classes="alt" />
|
2024-01-26 12:35:57 -05:00
|
|
|
|
|
|
|
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=logout}"
|
|
|
|
Command="{Binding LogoutCommand}"
|
|
|
|
Margin="10 0"
|
|
|
|
Classes="link"
|
|
|
|
DockPanel.Dock="Right"
|
|
|
|
HorizontalAlignment="Right" />
|
|
|
|
|
|
|
|
</DockPanel>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
</UserControl>
|