0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-12 17:10:44 -05:00

update remaining view and styles

This commit is contained in:
IsWaffle 2024-07-08 18:41:22 -04:00
parent a8f9e70a1c
commit 820e48b4b8
23 changed files with 505 additions and 327 deletions

View File

@ -16,25 +16,26 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<!-- let's be real... we are never going to use a light theme lol -waffle.lazy -->
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="AccentBrush">#54a4ff</SolidColorBrush>
<SolidColorBrush x:Key="AccentBrush2">#4383cc</SolidColorBrush>
<SolidColorBrush x:Key="AccentBrush3">#326299</SolidColorBrush>
<SolidColorBrush x:Key="AltAccentBrush">#b2a58d</SolidColorBrush>
<SolidColorBrush x:Key="AltAccentBrush2">#7f7564</SolidColorBrush>
<SolidColorBrush x:Key="AltAccentBrush3">#4c463b</SolidColorBrush>
<SolidColorBrush x:Key="BackgroundBrush">White</SolidColorBrush>
<SolidColorBrush x:Key="BackgroundBrush2">#cccccc</SolidColorBrush>
<SolidColorBrush x:Key="AltBackgroundBrush">#cca480</SolidColorBrush>
<SolidColorBrush x:Key="ForegroundBrush">Black</SolidColorBrush>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="AccentBrush">#436082</SolidColorBrush>
<SolidColorBrush x:Key="AccentBrush2">#567ca8</SolidColorBrush>
<SolidColorBrush x:Key="AccentBrush3">#6998ce</SolidColorBrush>
<SolidColorBrush x:Key="AltAccentBrush">#6a6357</SolidColorBrush>
<SolidColorBrush x:Key="AltAccentBrush2">#908676</SolidColorBrush>
<SolidColorBrush x:Key="AltAccentBrush3">#b6a995</SolidColorBrush>
<SolidColorBrush x:Key="BackgroundBrush">White</SolidColorBrush>
<SolidColorBrush x:Key="BackgroundBrush2">#cccccc</SolidColorBrush>
<SolidColorBrush x:Key="AltBackgroundBrush">#cca480</SolidColorBrush>
<SolidColorBrush x:Key="ForegroundBrush">Black</SolidColorBrush>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="AccentBrush">#54a4ff</SolidColorBrush>
<SolidColorBrush x:Key="AccentBrush2">#4383cc</SolidColorBrush>
<SolidColorBrush x:Key="AccentBrush3">#326299</SolidColorBrush>
<SolidColorBrush x:Key="AltAccentBrush">#b2a58d</SolidColorBrush>
<SolidColorBrush x:Key="AltAccentBrush2">#7f7564</SolidColorBrush>
<SolidColorBrush x:Key="AltAccentBrush3">#4c463b</SolidColorBrush>
<SolidColorBrush x:Key="BackgroundBrush">#181a1b</SolidColorBrush>
<SolidColorBrush x:Key="BackgroundBrush2">#393e41</SolidColorBrush>
<SolidColorBrush x:Key="AltBackgroundBrush">#37332d</SolidColorBrush>

View File

@ -3,13 +3,15 @@
xmlns:cc="using:SPT.Launcher.CustomControls"
>
<Design.PreviewWith>
<Grid Background="{DynamicResource BackgroundBrush}">
<Border Classes="card">
<StackPanel Spacing="5" Margin="50">
<Label Content="Some label here"/>
<Label Content="Some acc label here" Classes="acc"/>
<Label Content="Some alt label here" Classes="alt"/>
<Label Classes="versionMismatch" Content="invalid version tag" />
<Button Content="button" />
<Button Content="outlined button" Classes="outlined"></Button>
<Button Content="Icon button" Classes="icon"/>
<Button Content="acc button" Classes="acc"/>
<Button Content="alt button" Classes="alt"/>
<Button IsEnabled="False" Content="disabled button"/>
@ -28,16 +30,35 @@
<ProgressBar IsIndeterminate="True" />
<ProgressBar Classes="error" />
</StackPanel>
</Grid>
</Border>
</Design.PreviewWith>
<!-- Add Styles Here -->
<!-- Textblock Styles -->
<Style Selector="TextBlock.alt">
<Setter Property="Foreground" Value="{DynamicResource AltAccentBrush}"/>
</Style>
<!-- Border Styles -->
<Style Selector="Border.card">
<Setter Property="CornerRadius" Value="5"/>
<Setter Property="BoxShadow" Value="2 5 5 black"/>
<Setter Property="BorderBrush" Value="{DynamicResource AltBackgroundBrush}"/>
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="10"></Setter>
</Style>
<!-- BoxShadow="2 5 5 black"></Setter> CornerRadius="5" -->
<!-- BorderBrush="{DynamicResource AltBackgroundBrush}" -->
<!-- Background="{DynamicResource BackgroundBrush}" -->
<!-- Margin="15" -->
<!-- BorderThickness="1" -->
<!-- Notification Manager Styles -->
<Style Selector="WindowNotificationManager">
<Setter Property="Margin" Value="0 35 0 0"/>
<!-- <Setter Property="VerticalAlignment" Value="Bottom"/> -->
<!-- <Setter Property="HorizontalAlignment" Value="Center"/> -->
<Setter Property="MaxItems" Value="2"/>
</Style>
@ -59,50 +80,8 @@
</LayoutTransformControl>
</ControlTemplate>
</Setter>
<!-- <Style.Animations> -->
<!-- <Animation Duration="0:0:0.45" Easing="SineEaseIn" FillMode="Forward"> -->
<!-- <KeyFrame Cue="0%"> -->
<!-- <Setter Property="Opacity" Value="0"/> -->
<!-- <Setter Property="ZIndex" Value="0"/> -->
<!-- <Setter Property="TranslateTransform.Y" Value="-100"/> -->
<!-- <Setter Property="ScaleTransform.ScaleX" Value="1"/> -->
<!-- <Setter Property="ScaleTransform.ScaleY" Value="1"/> -->
<!-- </KeyFrame> -->
<!-- <KeyFrame Cue="30%"> -->
<!-- <Setter Property="Opacity" Value="0"/> -->
<!-- </KeyFrame> -->
<!-- <KeyFrame Cue="99%"> -->
<!-- <Setter Property="ZIndex" Value="0"/> -->
<!-- </KeyFrame> -->
<!-- <KeyFrame Cue="100%"> -->
<!-- <Setter Property="Opacity" Value="1"/> -->
<!-- <Setter Property="ZIndex" Value="1"/> -->
<!-- <Setter Property="TranslateTransform.Y" Value="0"/> -->
<!-- <Setter Property="ScaleTransform.ScaleX" Value="1"/> -->
<!-- <Setter Property="ScaleTransform.ScaleY" Value="1"/> -->
<!-- </KeyFrame> -->
<!-- </Animation> -->
<!-- </Style.Animations> -->
</Style>
<!-- <Style Selector="NotificationCard[IsClosing=true] /template/ LayoutTransformControl#PART_LayoutTransformControl"> -->
<!-- <Style.Animations> -->
<!-- <Animation Duration="0:0:0.3" Easing="SineEaseOut" FillMode="Backward"> -->
<!-- <KeyFrame Cue="0%"> -->
<!-- <Setter Property="Opacity" Value="1"/> -->
<!-- <Setter Property="TranslateTransform.X" Value="0"/> -->
<!-- <Setter Property="TranslateTransform.Y" Value="0"/> -->
<!-- </KeyFrame> -->
<!-- <KeyFrame Cue="100%"> -->
<!-- <Setter Property="Opacity" Value="0"/> -->
<!-- <Setter Property="TranslateTransform.X" Value="0"/> -->
<!-- <Setter Property="TranslateTransform.Y" Value="-100"/> -->
<!-- </KeyFrame> -->
<!-- </Animation> -->
<!-- </Style.Animations> -->
<!-- </Style> -->
<!-- TitleBar Styles -->
<Style Selector="cc|TitleBar">
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
@ -172,7 +151,7 @@
<!-- ProgressBar Styles -->
<Style Selector="ProgressBar">
<Setter Property="Foreground" Value="{DynamicResource AccentBrush3}"/>
<Setter Property="Foreground" Value="{DynamicResource AccentBrush}"/>
<Setter Property="Background" Value="{DynamicResource BackgroundBrush2}"/>
</Style>
@ -223,13 +202,13 @@
</Style>
<Style Selector="Button.acc:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AccentBrush3}"/>
<Setter Property="Background" Value="{DynamicResource AccentBrush2}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BackgroundBrush2}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="Button.acc:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AccentBrush}"/>
<Setter Property="Background" Value="{DynamicResource AccentBrush3}"/>
</Style>
<Style Selector="Button.acc:disabled /template/ ContentPresenter">
@ -244,13 +223,13 @@
</Style>
<Style Selector="Button.alt:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AltAccentBrush3}"/>
<Setter Property="Background" Value="{DynamicResource AltAccentBrush2}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BackgroundBrush2}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="Button.alt:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AltAccentBrush}"/>
<Setter Property="Background" Value="{DynamicResource AltAccentBrush3}"/>
</Style>
<Style Selector="Button.alt:disabled /template/ ContentPresenter">
@ -264,61 +243,70 @@
</Style>
<Style Selector="Button.link, Button.ulink">
<Setter Property="Foreground" Value="{DynamicResource AltAccentBrush3}"/>
<Setter Property="Foreground" Value="{DynamicResource AltAccentBrush}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style Selector="Button.link:pointerover /template/ ContentPresenter, Button.ulink:pointerover /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource AccentBrush3}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style Selector="Button.link:pressed /template/ ContentPresenter, Button.ulink:pressed /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource AccentBrush}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<!-- Button Bordered Link Style -->
<!-- <Style Selector="Button.borderedlink"> -->
<!-- <Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}"/> -->
<!-- <Setter Property="Background" Value="Transparent"/> -->
<!-- <Setter Property="BorderBrush" Value="{DynamicResource ForegroundBrush}"/> -->
<!-- <Setter Property="BorderThickness" Value="1"/> -->
<!-- </Style> -->
<!-- -->
<!-- <Style Selector="Button.borderedlink:pointerover /template/ ContentPresenter"> -->
<!-- <Setter Property="TextBlock.Foreground" Value="{DynamicResource AccentBrush}"/> -->
<!-- <Setter Property="Background" Value="Transparent"/> -->
<!-- <Setter Property="BorderBrush" Value="{DynamicResource AccentBrush}"/> -->
<!-- </Style> -->
<!-- -->
<!-- <Style Selector="Button.borderedlink:pressed /template/ ContentPresenter"> -->
<!-- <Setter Property="TextBlock.Foreground" Value="{DynamicResource BackgroundBrush2}"/> -->
<!-- <Setter Property="Background" Value="Transparent"/> -->
<!-- <Setter Property="BorderBrush" Value="{DynamicResource BackgroundBrush2}"/> -->
<!-- <Setter Property="BorderThickness" Value="0"/> -->
<!-- </Style> -->
<Style Selector="Button.link:pressed /template/ ContentPresenter, Button.ulink:pressed /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource AccentBrush3}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<!-- Button Profile Info Style -->
<!-- <Style Selector="Button.profileinfo"> -->
<!-- <Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/> -->
<!-- <Setter Property="BorderBrush" Value="{DynamicResource BackgroundBrush}"/> -->
<!-- </Style> -->
<!-- -->
<!-- <Style Selector="Button.icon"> -->
<!-- <Setter Property="Background" Value="Transparent"/> -->
<!-- <Setter Property="BorderBrush" Value="Transparent"/> -->
<!-- </Style> -->
<!-- -->
<!-- <Style Selector="Button.icon:pointerover"> -->
<!-- <Setter Property="Background" Value="{DynamicResource BackgroundBrush2}"/> -->
<!-- </Style> -->
<!-- Outlined Button -->
<Style Selector="Button.outlined">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AccentBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="Button.outlined:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AltBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AccentBrush2}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="Button.outlined:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AccentBrush3}"/>
</Style>
<Style Selector="Button.outlined:disabled /template/ ContentPresenter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="{DynamicResource BackgroundBrush2}"/>
</Style>
<!-- Icon button -->
<Style Selector="Button.icon">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="Button.icon:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AltBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AccentBrush2}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="Button.icon:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AccentBrush3}"/>
</Style>
<Style Selector="Button.icon:disabled /template/ ContentPresenter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="{DynamicResource BackgroundBrush2}"/>
</Style>
<!-- Checkbox styles -->
<Style Selector="CheckBox">
@ -335,16 +323,16 @@
<Style Selector="CheckBox:checked">
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Foreground" Value="{DynamicResource AccentBrush3}"/>
<Setter Property="Foreground" Value="{DynamicResource AccentBrush}"/>
</Style>
<Style Selector="CheckBox:checked /template/ Border#NormalRectangle">
<Setter Property="Background" Value="{DynamicResource BackgroundBrush2}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AccentBrush3}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AccentBrush}"/>
</Style>
<Style Selector="CheckBox:checked /template/ Path#CheckGlyph">
<Setter Property="Fill" Value="{DynamicResource AccentBrush3}"/>
<Setter Property="Fill" Value="{DynamicResource AccentBrush}"/>
</Style>
<!-- ComboBox Styles -->
@ -379,8 +367,8 @@
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Background="{DynamicResource AltBackgroundBrush}"
BorderBrush="{DynamicResource AltAccentBrush2}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}" />
<TextBlock x:Name="PlaceholderTextBlock"
@ -459,16 +447,25 @@
</Setter>
</Style>
<Style Selector="ComboBox">
<Setter Property="Background" Value="{DynamicResource AltBackgroundBrush}"/>
</Style>
<Style Selector="ComboBox:dropdownopen">
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AccentBrush}"/>
</Style>
<Style Selector="ComboBox /template/ Path#DropDownGlyph">
<Setter Property="Fill" Value="{DynamicResource ForegroundBrush}" />
</Style>
<Style Selector="ComboBox:pointerover /template/ Path#DropDownGlyph">
<Setter Property="Fill" Value="{DynamicResource AccentBrush3}" />
<Setter Property="Fill" Value="{DynamicResource AccentBrush}" />
</Style>
<Style Selector="ComboBox:pointerover">
<Setter Property="Foreground" Value="{DynamicResource AccentBrush3}"/>
<Setter Property="Foreground" Value="{DynamicResource AccentBrush}"/>
</Style>
<!-- ComboBoxItem Styles -->
@ -478,7 +475,7 @@
</Style>
<Style Selector="ComboBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AltAccentBrush}" />
<Setter Property="Background" Value="{DynamicResource AltAccentBrush2}" />
<Setter Property="BorderBrush" Value="{DynamicResource BackgroundBrush2}" />
<Setter Property="TextBlock.Foreground" Value="{DynamicResource ForegroundBrush}" />
</Style>

View File

@ -5,7 +5,7 @@
xmlns:helpers="using:SPT.Launcher.Helpers"
xmlns:cvt="using:SPT.Launcher.Converters"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPT.Launcher.CustomControls.ExistingProfileCard"
x:Class="SPT.Launcher.CustomControls.DetailedProfileCard"
MinWidth="250" MinHeight="250"
PointerEntered="InputElement_OnPointerEntered"
PointerExited="InputElement_OnPointerExited"
@ -16,12 +16,7 @@
<cvt:ImageSourceConverter x:Key="ImageSourceCvt" />
</UserControl.Resources>
<Border x:Name="CardBorder"
BoxShadow="2 5 5 black" CornerRadius="5"
BorderBrush="{DynamicResource AltBackgroundBrush}"
Background="{DynamicResource BackgroundBrush}"
Margin="15"
BorderThickness="1">
<Border x:Name="CardBorder" Classes="card" Margin="15">
<Border.Transitions>
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.200"/>

View File

@ -1,6 +1,4 @@
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Threading.Tasks;
using System.Windows.Input;
using Avalonia;
using Avalonia.Controls;
@ -13,9 +11,9 @@ using SPT.Launcher.Models.Launcher;
namespace SPT.Launcher.CustomControls;
public partial class ExistingProfileCard : UserControl
public partial class DetailedProfileCard : UserControl
{
public ExistingProfileCard()
public DetailedProfileCard()
{
InitializeComponent();
@ -29,15 +27,14 @@ public partial class ExistingProfileCard : UserControl
await Dispatcher.UIThread.InvokeAsync(async () =>
{
border.Opacity = 1;
border.BoxShadow = BoxShadows.Parse("2 5 5 black");
await Task.Delay(200);
border.RenderTransform = TransformOperations.Parse("scale(1)");
border.BoxShadow = BoxShadows.Parse("2 5 5 black");
});
});
}
public static readonly StyledProperty<ProfileInfo> ProfileInfoProperty =
AvaloniaProperty.Register<ExistingProfileCard, ProfileInfo>(
AvaloniaProperty.Register<DetailedProfileCard, ProfileInfo>(
"ProfileInfo");
public ProfileInfo ProfileInfo
@ -46,7 +43,7 @@ public partial class ExistingProfileCard : UserControl
set => SetValue(ProfileInfoProperty, value);
}
public static readonly StyledProperty<ICommand> LoginCommandProperty = AvaloniaProperty.Register<ExistingProfileCard, ICommand>(
public static readonly StyledProperty<ICommand> LoginCommandProperty = AvaloniaProperty.Register<DetailedProfileCard, ICommand>(
"LoginCommand");
public ICommand LoginCommand

View File

@ -0,0 +1,61 @@
<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:cvt="using:SPT.Launcher.Converters"
xmlns:helpers="using:SPT.Launcher.Helpers"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPT.Launcher.CustomControls.GameLaunchBar">
<UserControl.Resources>
<cvt:ImageSourceConverter x:Key="ImageSourceCvt" />
</UserControl.Resources>
<Border Classes="card">
<DockPanel Background="{DynamicResource BackgroundBrush}" Margin="2">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Stretch"
Spacing="10"
IsVisible="{Binding $parent[UserControl].ProfileInfo.HasData}">
<Grid RowDefinitions="AUTO,AUTO" ColumnDefinitions="AUTO,AUTO">
<Image Source="{Binding $parent[UserControl].ProfileInfo.SideImage, Converter={StaticResource ImageSourceCvt}}"
Grid.RowSpan="2" Height="40" Margin="10 0" />
<Label Content="{Binding $parent[UserControl].ProfileInfo.Nickname}" Grid.Row="0" Grid.Column="2" Classes="acc"/>
<Label Content="{Binding $parent[UserControl].ProfileInfo.Side}" Grid.Row="1" Grid.Column="2" />
</Grid>
<Label Content="{Binding $parent[UserControl].ProfileInfo.Level}" VerticalAlignment="Center"
FontSize="22" />
<ProgressBar Value="{Binding $parent[UserControl].ProfileInfo.XPLevelProgress}" />
<StackPanel>
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=next_level_in}"
HorizontalAlignment="Center"
/>
<StackPanel Orientation="Horizontal">
<Label Content="{Binding $parent[UserControl].ProfileInfo.RemainingExp}"
HorizontalAlignment="Center"
Classes="acc"/>
<Label Content="xp"/>
</StackPanel>
</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 $parent[UserControl].StartGameCommand}"
IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=!GameRunning}"
Classes="acc" />
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=logout}"
Command="{Binding $parent[UserControl].LogoutCommand}"
Margin="10 0"
Classes="ulink"
DockPanel.Dock="Right"
HorizontalAlignment="Right" />
</DockPanel>
</Border>
</UserControl>

View File

@ -0,0 +1,41 @@
using System.Windows.Input;
using Avalonia;
using Avalonia.Controls;
using SPT.Launcher.Models.Launcher;
namespace SPT.Launcher.CustomControls;
public partial class GameLaunchBar : UserControl
{
public GameLaunchBar()
{
InitializeComponent();
}
public static readonly StyledProperty<ProfileInfo> ProfileInfoProperty = AvaloniaProperty.Register<GameLaunchBar, ProfileInfo>(
"ProfileInfo");
public ProfileInfo ProfileInfo
{
get => GetValue(ProfileInfoProperty);
set => SetValue(ProfileInfoProperty, value);
}
public static readonly StyledProperty<ICommand> StartGameCommandProperty = AvaloniaProperty.Register<GameLaunchBar, ICommand>(
"StartGameCommand");
public ICommand StartGameCommand
{
get => GetValue(StartGameCommandProperty);
set => SetValue(StartGameCommandProperty, value);
}
public static readonly StyledProperty<ICommand> LogoutCommandProperty = AvaloniaProperty.Register<GameLaunchBar, ICommand>(
"LogoutCommand");
public ICommand LogoutCommand
{
get => GetValue(LogoutCommandProperty);
set => SetValue(LogoutCommandProperty, value);
}
}

View File

@ -10,7 +10,7 @@
>
<ComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type model:LocalizedLauncherAction}">
<Label Content="{Binding Name}"/>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>

View File

@ -5,11 +5,7 @@
xmlns:helpers="using:SPT.Launcher.Helpers"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPT.Launcher.CustomControls.LoginBox">
<Border BoxShadow="2 5 5 black" CornerRadius="5"
BorderBrush="{DynamicResource AltBackgroundBrush}"
Background="{DynamicResource BackgroundBrush}"
Margin="10"
BorderThickness="1">
<Border Classes="card">
<Grid RowDefinitions="Auto, Auto" ColumnDefinitions="*, Auto" Margin="10">
<!-- Username box -->

View File

@ -5,12 +5,10 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:helpers="using:SPT.Launcher.Helpers"
x:Class="SPT.Launcher.CustomControls.ModInfoCard">
<Border CornerRadius="5" HorizontalAlignment="Stretch"
BorderBrush="{DynamicResource BackgroundBrush}"
BorderThickness="5"
>
<Border Classes="card" HorizontalAlignment="Stretch">
<Grid RowDefinitions="10,AUTO,AUTO,AUTO,10" ColumnDefinitions="10,AUTO,*,AUTO,10"
Background="{DynamicResource BackgroundBrush}"
Margin="2"
>
<!-- Icon stack -->
@ -19,19 +17,19 @@
Orientation="Horizontal" Spacing="5"
>
<!-- Server Icon -->
<Path Data="{StaticResource Server}" Fill="DarkSlateGray"
<Path Data="{StaticResource Server}" Fill="{DynamicResource AltAccentBrush}"
IsVisible="{Binding IsInServer, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
<!-- Profile Icon -->
<Path Data="{StaticResource Profile}" Fill="DarkSlateGray"
<Path Data="{StaticResource Profile}" Fill="{DynamicResource AltAccentBrush}"
IsVisible="{Binding IsInProfile, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
<!-- Info Icon -->
<Canvas>
<Rectangle ToolTip.Tip="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=mod_not_in_server_warning}" Fill="Transparent" Height="20" Width="20"/>
<Path Data="{StaticResource Info}" Fill="DodgerBlue"
<Path Data="{StaticResource Info}" Fill="{DynamicResource AccentBrush}"
ToolTip.Tip="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=mod_not_in_server_warning}"
>
<Path.IsVisible>
@ -66,7 +64,7 @@
/>
<!-- Author Text -->
<Label Grid.Row="3" Grid.Column="1" FontSize="12" Foreground="DimGray"
<Label Grid.Row="3" Grid.Column="1" FontSize="12" Foreground="{DynamicResource AltAccentBrush}"
Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=author}"
/>
@ -78,6 +76,7 @@
<!-- Mod Version -->
<Label Grid.Row="3" Grid.Column="3" FontSize="12"
Content="{Binding Version, RelativeSource={RelativeSource AncestorType=UserControl}}"
Classes="acc"
/>
</Grid>
</Border>

View File

@ -0,0 +1,61 @@
<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"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPT.Launcher.CustomControls.ProfileCard">
<Border Classes="card">
<Grid RowDefinitions="10,AUTO,AUTO,AUTO,AUTO,10" ColumnDefinitions="10,AUTO,*,10" Margin="2"
Background="{DynamicResource BackgroundBrush}">
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
<Label Content="{Binding $parent[UserControl].ProfileInfo.Username}" Margin="5 0" />
<!-- profile name and version -->
<Label x:Name="SPTVersion"
Background="Transparent"
ToolTip.Tip="{Binding $parent[UserControl].ProfileInfo.MismatchMessage}"
Classes.versionMismatch="{Binding $parent[UserControl].ProfileInfo.VersionMismatch}"
Classes.acc="{Binding !$parent[UserControl].ProfileInfo.VersionMismatch}"
>
<StackPanel Orientation="Horizontal" Background="Transparent">
<TextBlock Text="{Binding $parent[UserControl].ProfileInfo.SPT.version}" />
<Path Data="{StaticResource Info}"
Fill="{Binding ElementName=SPTVersion, Path=Foreground}"
Margin="10 0"
IsVisible="{Binding $parent[UserControl].ProfileInfo.VersionMismatch}" />
</StackPanel>
</Label>
</StackPanel>
<!-- delete profile button -->
<Button HorizontalAlignment="Right" Grid.Row="1" Grid.Column="2"
Classes="icon"
Command="{Binding $parent[UserControl].RemoveProfileCommand}"
IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=!GameRunning}">
<Path Data="{StaticResource Delete}" Fill="IndianRed" />
</Button>
<!-- profile id button -->
<Button Content="{Binding $parent[UserControl].CurrentId}" Classes="ulink"
Grid.Row="2" Grid.Column="1"
Command="{Binding $parent[UserControl].CopyCommand}"
CommandParameter="{Binding $parent[UserControl].CurrentId}" />
<!-- profile edition button -->
<Button Content="{Binding $parent[UserControl].CurrentEdition}" Classes="ulink"
Grid.Row="3" Grid.Column="1"
Command="{Binding $parent[UserControl].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" Grid.ColumnSpan="2"
IsChecked="{Binding $parent[UserControl].WipeProfileOnStart}"
IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=!GameRunning}"
IsVisible="{Binding !$parent[UserControl].ProfileWipePending}"
/>
</Grid>
</Border>
</UserControl>

View File

@ -0,0 +1,86 @@
using System.Windows.Input;
using Avalonia;
using Avalonia.Controls;
using SPT.Launcher.Models.Launcher;
namespace SPT.Launcher.CustomControls;
public partial class ProfileCard : UserControl
{
public ProfileCard()
{
InitializeComponent();
}
public static readonly StyledProperty<ProfileInfo> ProfileInfoProperty = AvaloniaProperty.Register<ProfileCard, ProfileInfo>(
"ProfileInfo");
public ProfileInfo ProfileInfo
{
get => GetValue(ProfileInfoProperty);
set => SetValue(ProfileInfoProperty, value);
}
public static readonly StyledProperty<string> CurrentIdProperty = AvaloniaProperty.Register<ProfileCard, string>(
"CurrentId");
public string CurrentId
{
get => GetValue(CurrentIdProperty);
set => SetValue(CurrentIdProperty, value);
}
public static readonly StyledProperty<string> CurrentEditionProperty = AvaloniaProperty.Register<ProfileCard, string>(
"CurrentEdition");
public string CurrentEdition
{
get => GetValue(CurrentEditionProperty);
set => SetValue(CurrentEditionProperty, value);
}
public static readonly StyledProperty<bool> WipeProfileOnStartProperty = AvaloniaProperty.Register<ProfileCard, bool>(
"WipeProfileOnStart");
public bool WipeProfileOnStart
{
get => GetValue(WipeProfileOnStartProperty);
set => SetValue(WipeProfileOnStartProperty, value);
}
public static readonly StyledProperty<bool> ProfileWipePendingProperty = AvaloniaProperty.Register<ProfileCard, bool>(
"ProfileWipePending");
public bool ProfileWipePending
{
get => GetValue(ProfileWipePendingProperty);
set => SetValue(ProfileWipePendingProperty, value);
}
public static readonly StyledProperty<ICommand> RemoveProfileCommandProperty = AvaloniaProperty.Register<ProfileCard, ICommand>(
"RemoveProfileCommand");
public ICommand RemoveProfileCommand
{
get => GetValue(RemoveProfileCommandProperty);
set => SetValue(RemoveProfileCommandProperty, value);
}
public static readonly StyledProperty<ICommand> CopyCommandProperty = AvaloniaProperty.Register<ProfileCard, ICommand>(
"CopyCommand");
public ICommand CopyCommand
{
get => GetValue(CopyCommandProperty);
set => SetValue(CopyCommandProperty, value);
}
public static readonly StyledProperty<ICommand> ChangeEditionCommandProperty = AvaloniaProperty.Register<ProfileCard, ICommand>(
"ChangeEditionCommand");
public ICommand ChangeEditionCommand
{
get => GetValue(ChangeEditionCommandProperty);
set => SetValue(ChangeEditionCommandProperty, value);
}
}

View File

@ -55,12 +55,12 @@
>
<Button.Styles>
<Style Selector="Button:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="DarkSlateGray"/>
<Setter Property="Background" Value="{DynamicResource AccentBrush2}"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<!-- <Style Selector="Button:pressed /template/ ContentPresenter"> -->
<!-- <Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/> -->
<!-- </Style> -->
<Style Selector="Button:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AccentBrush3}"/>
</Style>
</Button.Styles>
</Button>

View File

@ -0,0 +1,31 @@
<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"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPT.Launcher.CustomControls.TotalModsCard">
<Border Classes="card" IsVisible="{Binding ModInfoCollection.HasMods}">
<Grid RowDefinitions="10,AUTO,10" ColumnDefinitions="10,Auto,*,AUTO,10" Margin="2"
Background="{DynamicResource BackgroundBrush}">
<!-- server mods count text -->
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=active_server_mods}" VerticalAlignment="Center"/>
<Label Content="{Binding $parent[UserControl].ActiveModsCount}" Classes="acc" FontWeight="SemiBold" VerticalAlignment="Center"/>
</StackPanel>
<!-- Show mods info view button -->
<Button Grid.Row="0" Grid.RowSpan="3" Grid.Column="3" Grid.ColumnSpan="2"
VerticalAlignment="Stretch" FontSize="18" Margin="10 0 0 0"
Command="{Binding $parent[UserControl].OpenModsInfoCommand}"
Classes="icon">
<Button.Content>
<Path Data="{StaticResource Open}" Fill="{DynamicResource ForegroundBrush}"
VerticalAlignment="Center"
/>
</Button.Content>
</Button>
</Grid>
</Border>
</UserControl>

View File

@ -0,0 +1,33 @@
using System.Collections.ObjectModel;
using System.Windows.Input;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace SPT.Launcher.CustomControls;
public partial class TotalModsCard : UserControl
{
public TotalModsCard()
{
InitializeComponent();
}
public static readonly StyledProperty<int> ActiveModsCountProperty = AvaloniaProperty.Register<TotalModsCard, int>(
"ActiveModsCount");
public int ActiveModsCount
{
get => GetValue(ActiveModsCountProperty);
set => SetValue(ActiveModsCountProperty, value);
}
public static readonly StyledProperty<ICommand> OpenModsInfoCommandProperty = AvaloniaProperty.Register<TotalModsCard, ICommand>(
"OpenModsInfoCommand");
public ICommand OpenModsInfoCommand
{
get => GetValue(OpenModsInfoCommandProperty);
set => SetValue(OpenModsInfoCommandProperty, value);
}
}

View File

@ -18,7 +18,7 @@ namespace SPT.Launcher.ViewModels
[RequireLoggedIn]
public class ProfileViewModel : ViewModelBase
{
public string CurrentUsername { get; set; }
// public string CurrentUsername { get; set; }
private string _CurrentEdition;
public string CurrentEdition
@ -41,7 +41,7 @@ namespace SPT.Launcher.ViewModels
set => this.RaiseAndSetIfChanged(ref _ProfileWipePending, value);
}
public string CurrentID { get; set; }
public string CurrentId { get; set; }
public ProfileInfo ProfileInfo { get; set; } = AccountManager.SelectedProfileInfo;
@ -49,9 +49,9 @@ namespace SPT.Launcher.ViewModels
public ModInfoCollection ModInfoCollection { get; set; } = new ModInfoCollection();
private GameStarter gameStarter = new GameStarter(new GameStarterFrontend());
private readonly GameStarter _gameStarter = new GameStarter(new GameStarterFrontend());
private ProcessMonitor monitor { get; set; }
private readonly ProcessMonitor _monitor;
public ProfileViewModel(IScreen Host) : base(Host)
{
@ -63,13 +63,13 @@ namespace SPT.Launcher.ViewModels
SideImage.Touch();
}
monitor = new ProcessMonitor("EscapeFromTarkov", 1000, aliveCallback: GameAliveCallBack, exitCallback: GameExitCallback);
_monitor = new ProcessMonitor("EscapeFromTarkov", 1000, aliveCallback: GameAliveCallBack, exitCallback: GameExitCallback);
CurrentUsername = AccountManager.SelectedAccount.username;
// CurrentUsername = AccountManager.SelectedAccount.username;
CurrentEdition = AccountManager.SelectedAccount.edition;
CurrentID = AccountManager.SelectedAccount.id;
CurrentId = AccountManager.SelectedAccount.id;
}
private async Task GameVersionCheck()
@ -155,11 +155,11 @@ namespace SPT.Launcher.ViewModels
WipeProfileOnStart = false;
}
GameStarterResult gameStartResult = await gameStarter.LaunchGame(ServerManager.SelectedServer, AccountManager.SelectedAccount, LauncherSettingsProvider.Instance.GamePath);
GameStarterResult gameStartResult = await _gameStarter.LaunchGame(ServerManager.SelectedServer, AccountManager.SelectedAccount, LauncherSettingsProvider.Instance.GamePath);
if (gameStartResult.Succeeded)
{
monitor.Start();
_monitor.Start();
switch (LauncherSettingsProvider.Instance.LauncherStartGameAction)
{

View File

@ -23,7 +23,7 @@
>
<ComboBox.ItemTemplate>
<DataTemplate>
<Label Background="Transparent" Content="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
<TextBlock Background="Transparent" Text="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
@ -32,7 +32,7 @@
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=update}"
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHost:DialogHost}, Path=CloseDialogCommand}"
CommandParameter="{Binding editions.SelectedEdition}"
Classes="alt"
Classes="acc"
/>
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=cancel}"
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHost:DialogHost}, Path=CloseDialogCommand}"

View File

@ -17,7 +17,7 @@
Orientation="Horizontal" Spacing="10">
<Button Content="{Binding ConfirmButtonText}"
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHost:DialogHost}, Path=CloseDialogCommand}"
Classes="alt"
Classes="acc"
IsEnabled="{Binding AllowConfirm}"
>
<Button.CommandParameter>

View File

@ -27,15 +27,14 @@
>
<ComboBox.ItemTemplate>
<DataTemplate>
<Label Background="Transparent" Content="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
<TextBlock Background="Transparent" Text="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- Description Area -->
<Border Grid.Row="2" Grid.ColumnSpan="3" Margin="0 10"
Background="{StaticResource SPT_Background_Light}" CornerRadius="10"
Background="{DynamicResource BackgroundBrush2}" CornerRadius="10"
MaxWidth="500" MinHeight="50"
MinWidth="500"
HorizontalAlignment="Stretch"
@ -59,7 +58,7 @@
CommandParameter="{Binding Editions.SelectedEdition}"
IsEnabled="{Binding Editions.HasSelection}"
IsDefault="True"
Classes="alt"
Classes="acc"
/>
<Button Content="{Binding CancelButtonText}"
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHost:DialogHost}, Path=CloseDialogCommand}"

View File

@ -20,7 +20,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHost:DialogHost}, Path=CloseDialogCommand}"
Classes="alt"
Classes="acc"
/>
</Grid>
</UserControl>

View File

@ -20,7 +20,7 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="launcher:ProfileInfo">
<cc:ExistingProfileCard
<cc:DetailedProfileCard
ProfileInfo="{Binding }"
LoginCommand="{Binding $parent[ItemsControl].DataContext.LoginProfileCommand}"
/>

View File

@ -19,25 +19,21 @@
<!-- Active Mods List Header -->
<Border Grid.Row="3" Grid.Column="1"
CornerRadius="5"
Background="{DynamicResource BackgroundBrush}">
Classes="card"
>
<StackPanel Spacing="2" Margin="10">
<!-- Active mods count and text -->
<Label VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16">
<Label.Content>
<MultiBinding StringFormat="{}{0}: {1}">
<Binding Source="{x:Static helpers:LocalizationProvider.Instance}" Path="active_server_mods"/>
<Binding Path="ModsCollection.ActiveMods.Count"/>
</MultiBinding>
</Label.Content>
</Label>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=active_server_mods}"/>
<Label Content="{Binding ModsCollection.ActiveMods.Count}" Classes="acc"/>
</StackPanel>
<!-- Active mods info text -->
<TextBlock Text="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=active_server_mods_info_text}"
VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="12"
TextWrapping="Wrap"
/>
Classes="alt"/>
</StackPanel>
</Border>
@ -61,24 +57,21 @@
<!-- Inactive Mods List Header -->
<Border Grid.Row="3" Grid.Column="3"
CornerRadius="5"
Background="{DynamicResource BackgroundBrush}">
Classes="card"
>
<StackPanel Spacing="2" Margin="10">
<!-- Inactive mods count and text -->
<Label VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16">
<Label.Content>
<MultiBinding StringFormat="{}{0}: {1}">
<Binding Source="{x:Static helpers:LocalizationProvider.Instance}" Path="inactive_server_mods"/>
<Binding Path="ModsCollection.InactiveMods.Count"/>
</MultiBinding>
</Label.Content>
</Label>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=inactive_server_mods}"/>
<Label Content="{Binding ModsCollection.InactiveMods.Count}" Classes="acc"/>
</StackPanel>
<!-- Inactive mods info text -->
<TextBlock Text="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=inactive_server_mods_info_text}"
VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="12"
TextWrapping="Wrap"
Classes="alt"
/>
</StackPanel>
</Border>

View File

@ -2,148 +2,36 @@
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:cvt="using:SPT.Launcher.Converters"
xmlns:cc="using:SPT.Launcher.CustomControls"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPT.Launcher.Views.ProfileView">
<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"
BorderBrush="{DynamicResource BackgroundBrush}"
BorderThickness="5">
<Grid RowDefinitions="10,AUTO,AUTO,AUTO,AUTO,10" ColumnDefinitions="10,AUTO,*,10"
Background="{DynamicResource BackgroundBrush}">
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
<Label Content="{Binding CurrentUsername}" Margin="5 0" />
<!-- profile name and version -->
<Label x:Name="SPTVersion"
Background="Transparent"
ToolTip.Tip="{Binding ProfileInfo.MismatchMessage}"
Classes.versionMismatch="{Binding ProfileInfo.VersionMismatch}">
<StackPanel Orientation="Horizontal" Background="Transparent">
<TextBlock Text="{Binding ProfileInfo.SPT.version}" />
<Path Data="{StaticResource Info}"
Fill="{Binding ElementName=SPTVersion, Path=Foreground}"
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}" />
</Grid>
</Border>
<cc:ProfileCard Grid.Row="1" Grid.Column="1"
ProfileInfo="{Binding ProfileInfo}"
CurrentEdition="{Binding CurrentEdition}"
CurrentId="{Binding CurrentId}"
WipeProfileOnStart="{Binding WipeProfileOnStart}"
ProfileWipePending="{Binding ProfileWipePending}"
CopyCommand="{Binding CopyCommand}"
ChangeEditionCommand="{Binding ChangeEditionCommand}"
RemoveProfileCommand="{Binding RemoveProfileCommand}"
/>
<!-- Total Mods Info -->
<Border Grid.Row="3" Grid.Column="1" CornerRadius="5"
BorderBrush="{DynamicResource BackgroundBrush}"
BorderThickness="5" IsVisible="{Binding ModInfoCollection.HasMods}">
<Grid RowDefinitions="10,AUTO,10" ColumnDefinitions="10,Auto,*,AUTO,10"
Background="{DynamicResource BackgroundBrush}">
<!-- server mods count text -->
<Label Grid.Row="1" Grid.Column="1">
<Label.Content>
<MultiBinding StringFormat="{}{0}: {1}">
<Binding Source="{x:Static helpers:LocalizationProvider.Instance}" Path="active_server_mods"/>
<Binding Path="ModInfoCollection.ActiveMods.Count"/>
</MultiBinding>
</Label.Content>
</Label>
<!-- Show mods info view button -->
<Button Grid.Row="0" Grid.RowSpan="3" Grid.Column="3" Grid.ColumnSpan="2"
VerticalAlignment="Stretch" FontSize="18" Margin="10 0 0 0"
Command="{Binding OpenModsInfoCommand}"
Classes="icon">
<Button.Content>
<Path Data="{StaticResource Open}" Fill="{DynamicResource ForegroundBrush}"
VerticalAlignment="Center"
<cc:TotalModsCard Grid.Row="3" Grid.Column="1"
ActiveModsCount="{Binding ModInfoCollection.ActiveMods.Count}"
OpenModsInfoCommand="{Binding OpenModsInfoCommand}"
/>
</Button.Content>
</Button>
</Grid>
</Border>
<!-- Bottom bar -->
<Border Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="3" CornerRadius="5"
BorderBrush="{DynamicResource BackgroundBrush}"
BorderThickness="5">
<DockPanel Background="{DynamicResource BackgroundBrush}">
<!-- Game bar -->
<cc:GameLaunchBar Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="3"
ProfileInfo="{Binding ProfileInfo}"
StartGameCommand="{Binding StartGameCommand}"
LogoutCommand="{Binding LogoutCommand}"
/>
<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}"
Classes="alt" />
<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>

View File

@ -18,22 +18,22 @@
<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="borderedlink"
Classes="outlined"
Margin="0 0 10 5"
/>
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=load_live_settings}"
Command="{Binding ResetGameSettingsCommand}"
Classes="borderedlink"
Classes="outlined"
Margin="0 0 10 5"
/>
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=clear_game_settings}"
Command="{Binding ClearGameSettingsCommand}"
Classes="borderedlink"
Classes="outlined"
Margin="0 0 10 5"
/>
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=clean_temp_files}"
Command="{Binding CleanTempFilesCommand}"
Classes="borderedlink"
Classes="outlined"
Margin="0 0 10 5"
/>
</WrapPanel>