diff --git a/project/SPT.Launcher.Base/Controllers/GameStarter.cs b/project/SPT.Launcher.Base/Controllers/GameStarter.cs
index e700593..253450b 100644
--- a/project/SPT.Launcher.Base/Controllers/GameStarter.cs
+++ b/project/SPT.Launcher.Base/Controllers/GameStarter.cs
@@ -141,7 +141,6 @@ namespace SPT.Launcher
try
{
-
Process.Start(clientProcess);
LogManager.Instance.Info("[LaunchGame] Game process started");
}
@@ -319,7 +318,7 @@ namespace SPT.Launcher
/// returns true if the temp folder was cleaned succefully or doesn't exist. returns false if something went wrong.
public bool CleanTempFiles()
{
- var rootdir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), @"Battlestate Games\EscapeFromTarkov"));
+ var rootdir = new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, "user\\sptappdata"));
if (!rootdir.Exists)
{
diff --git a/project/SPT.Launcher.Base/SPT.Launcher.Base.csproj b/project/SPT.Launcher.Base/SPT.Launcher.Base.csproj
index 5c039d0..d7cf473 100644
--- a/project/SPT.Launcher.Base/SPT.Launcher.Base.csproj
+++ b/project/SPT.Launcher.Base/SPT.Launcher.Base.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/project/SPT.Launcher/App.axaml b/project/SPT.Launcher/App.axaml
index 5377cca..f7def06 100644
--- a/project/SPT.Launcher/App.axaml
+++ b/project/SPT.Launcher/App.axaml
@@ -1,32 +1,49 @@
+ x:Class="SPT.Launcher.App"
+ RequestedThemeVariant="Dark"
+ >
-
+
-
- #121212
- #FFC107
- #FFFFFF
- #282828
- #323947
-
-
-
-
-
-
-
-
-
+
+
+
+
+ #436082
+ #567ca8
+ #6998ce
+ #6a6357
+ #908676
+ #b6a995
+ White
+ #cccccc
+ #cca480
+ Black
+
+
+ #54a4ff
+ #4383cc
+ #326299
+ #b2a58d
+ #7f7564
+ #4c463b
+ #181a1b
+ #393e41
+ #37332d
+ White
+
+
+
+
diff --git a/project/SPT.Launcher/Assets/Styles.axaml b/project/SPT.Launcher/Assets/Styles.axaml
index 8f31d4f..658405f 100644
--- a/project/SPT.Launcher/Assets/Styles.axaml
+++ b/project/SPT.Launcher/Assets/Styles.axaml
@@ -1,24 +1,64 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Item 1
+ Item 2
+ Item 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -40,296 +80,266 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
+
-
+
-
-
+
-
+
-
-
-
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project/SPT.Launcher/CustomControls/DetailedProfileCard.axaml b/project/SPT.Launcher/CustomControls/DetailedProfileCard.axaml
new file mode 100644
index 0000000..1545524
--- /dev/null
+++ b/project/SPT.Launcher/CustomControls/DetailedProfileCard.axaml
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/project/SPT.Launcher/CustomControls/DetailedProfileCard.axaml.cs b/project/SPT.Launcher/CustomControls/DetailedProfileCard.axaml.cs
new file mode 100644
index 0000000..e48451c
--- /dev/null
+++ b/project/SPT.Launcher/CustomControls/DetailedProfileCard.axaml.cs
@@ -0,0 +1,107 @@
+using System.Threading.Tasks;
+using System.Windows.Input;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.Media;
+using Avalonia.Media.Immutable;
+using Avalonia.Media.Transformation;
+using Avalonia.Threading;
+using SPT.Launcher.Models.Launcher;
+
+namespace SPT.Launcher.CustomControls;
+
+public partial class DetailedProfileCard : UserControl
+{
+ public DetailedProfileCard()
+ {
+ InitializeComponent();
+
+ var border = this.GetControl("CardBorder");
+ border.Opacity = 0;
+ border.BoxShadow = BoxShadows.Parse("0 0 0 black");
+ border.RenderTransform = TransformOperations.Parse("scale(0.95)");
+
+ Task.Run(async () =>
+ {
+ await Dispatcher.UIThread.InvokeAsync(async () =>
+ {
+ border.Opacity = 1;
+ border.RenderTransform = TransformOperations.Parse("scale(1)");
+ border.BoxShadow = BoxShadows.Parse("2 5 5 black");
+ });
+ });
+ }
+
+ public static readonly StyledProperty ProfileInfoProperty =
+ AvaloniaProperty.Register(
+ "ProfileInfo");
+
+ public ProfileInfo ProfileInfo
+ {
+ get => GetValue(ProfileInfoProperty);
+ set => SetValue(ProfileInfoProperty, value);
+ }
+
+ public static readonly StyledProperty LoginCommandProperty = AvaloniaProperty.Register(
+ "LoginCommand");
+
+ public ICommand LoginCommand
+ {
+ get => GetValue(LoginCommandProperty);
+ set => SetValue(LoginCommandProperty, value);
+ }
+
+ private void InputElement_OnPointerEntered(object? sender, PointerEventArgs e)
+ {
+ if (Application.Current != null && Application.Current.TryFindResource("AltBackgroundBrush", this.ActualThemeVariant, out var brush))
+ {
+ if (brush is ImmutableSolidColorBrush immutableBrush)
+ {
+ var border = this.GetControl("CardBorder");
+
+ border.BoxShadow = BoxShadows.Parse("5 7 10 black");
+ border.Background = immutableBrush;
+ border.RenderTransform = TransformOperations.Parse("scale(1.02)");
+ }
+ }
+ }
+
+ private void InputElement_OnPointerExited(object? sender, PointerEventArgs e)
+ {
+ if (Application.Current != null && Application.Current.TryFindResource("BackgroundBrush", this.ActualThemeVariant, out var brush))
+ {
+ if (brush is ImmutableSolidColorBrush immutableBrush)
+ {
+ var border = this.GetControl("CardBorder");
+
+ border.BoxShadow = BoxShadows.Parse("2 5 5 black");
+ border.Background = immutableBrush;
+ border.RenderTransform = TransformOperations.Parse("scale(1)");
+ }
+ }
+ }
+
+ private void InputElement_OnPointerPressed(object? sender, PointerPressedEventArgs e)
+ {
+ var border = this.GetControl("CardBorder");
+
+ border.RenderTransform = TransformOperations.Parse("scale(0.98)");
+ }
+
+ private void InputElement_OnPointerReleased(object? sender, PointerReleasedEventArgs e)
+ {
+ var border = this.GetControl("CardBorder");
+ var pos = e.GetPosition(border);
+
+ if (border.Bounds.Contains(pos))
+ {
+ // pointer was released inside the control
+ border.RenderTransform = TransformOperations.Parse("scale(1.02)");
+ LoginCommand.Execute(ProfileInfo.Username);
+ return;
+ }
+
+ border.RenderTransform = TransformOperations.Parse("scale(1)");
+ }
+}
\ No newline at end of file
diff --git a/project/SPT.Launcher/CustomControls/GameLaunchBar.axaml b/project/SPT.Launcher/CustomControls/GameLaunchBar.axaml
new file mode 100644
index 0000000..6c66e77
--- /dev/null
+++ b/project/SPT.Launcher/CustomControls/GameLaunchBar.axaml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/project/SPT.Launcher/CustomControls/GameLaunchBar.axaml.cs b/project/SPT.Launcher/CustomControls/GameLaunchBar.axaml.cs
new file mode 100644
index 0000000..fe58c4d
--- /dev/null
+++ b/project/SPT.Launcher/CustomControls/GameLaunchBar.axaml.cs
@@ -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 ProfileInfoProperty = AvaloniaProperty.Register(
+ "ProfileInfo");
+
+ public ProfileInfo ProfileInfo
+ {
+ get => GetValue(ProfileInfoProperty);
+ set => SetValue(ProfileInfoProperty, value);
+ }
+
+ public static readonly StyledProperty StartGameCommandProperty = AvaloniaProperty.Register(
+ "StartGameCommand");
+
+ public ICommand StartGameCommand
+ {
+ get => GetValue(StartGameCommandProperty);
+ set => SetValue(StartGameCommandProperty, value);
+ }
+
+ public static readonly StyledProperty LogoutCommandProperty = AvaloniaProperty.Register(
+ "LogoutCommand");
+
+ public ICommand LogoutCommand
+ {
+ get => GetValue(LogoutCommandProperty);
+ set => SetValue(LogoutCommandProperty, value);
+ }
+}
\ No newline at end of file
diff --git a/project/SPT.Launcher/CustomControls/LocalizedLauncherActionSelector.axaml b/project/SPT.Launcher/CustomControls/LocalizedLauncherActionSelector.axaml
index 1e2be3a..34ec783 100644
--- a/project/SPT.Launcher/CustomControls/LocalizedLauncherActionSelector.axaml
+++ b/project/SPT.Launcher/CustomControls/LocalizedLauncherActionSelector.axaml
@@ -10,7 +10,7 @@
>
-
+
diff --git a/project/SPT.Launcher/CustomControls/LocalizedLauncherActionSelector.axaml.cs b/project/SPT.Launcher/CustomControls/LocalizedLauncherActionSelector.axaml.cs
index ac1f818..0433987 100644
--- a/project/SPT.Launcher/CustomControls/LocalizedLauncherActionSelector.axaml.cs
+++ b/project/SPT.Launcher/CustomControls/LocalizedLauncherActionSelector.axaml.cs
@@ -61,7 +61,7 @@ namespace SPT.Launcher.CustomControls
}
}
- comboBox.Items = actionsList;
+ comboBox.ItemsSource = actionsList;
foreach(var item in comboBox.Items)
{
diff --git a/project/SPT.Launcher/CustomControls/LoginBox.axaml b/project/SPT.Launcher/CustomControls/LoginBox.axaml
new file mode 100644
index 0000000..4008c6b
--- /dev/null
+++ b/project/SPT.Launcher/CustomControls/LoginBox.axaml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/project/SPT.Launcher/CustomControls/LoginBox.axaml.cs b/project/SPT.Launcher/CustomControls/LoginBox.axaml.cs
new file mode 100644
index 0000000..4ff5060
--- /dev/null
+++ b/project/SPT.Launcher/CustomControls/LoginBox.axaml.cs
@@ -0,0 +1,40 @@
+using System.Windows.Input;
+using Avalonia;
+using Avalonia.Controls;
+
+namespace SPT.Launcher.CustomControls;
+
+public partial class LoginBox : UserControl
+{
+ public LoginBox()
+ {
+ InitializeComponent();
+ }
+
+ public static readonly StyledProperty UsernameProperty = AvaloniaProperty.Register(
+ "Username");
+
+ public string Username
+ {
+ get => GetValue(UsernameProperty);
+ set => SetValue(UsernameProperty, value);
+ }
+
+ public static readonly StyledProperty LoginCommandProperty = AvaloniaProperty.Register(
+ "LoginCommand");
+
+ public ICommand LoginCommand
+ {
+ get => GetValue(LoginCommandProperty);
+ set => SetValue(LoginCommandProperty, value);
+ }
+
+ public static readonly StyledProperty IsLoggedInProperty = AvaloniaProperty.Register(
+ "IsLoggedIn");
+
+ public bool IsLoggedIn
+ {
+ get => GetValue(IsLoggedInProperty);
+ set => SetValue(IsLoggedInProperty, value);
+ }
+}
\ No newline at end of file
diff --git a/project/SPT.Launcher/CustomControls/ModInfoCard.axaml b/project/SPT.Launcher/CustomControls/ModInfoCard.axaml
index dd4fadc..a0727be 100644
--- a/project/SPT.Launcher/CustomControls/ModInfoCard.axaml
+++ b/project/SPT.Launcher/CustomControls/ModInfoCard.axaml
@@ -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">
-
-
+
@@ -19,19 +17,19 @@
Orientation="Horizontal" Spacing="5"
>
-
-
diff --git a/project/SPT.Launcher/CustomControls/ProfileCard.axaml b/project/SPT.Launcher/CustomControls/ProfileCard.axaml
new file mode 100644
index 0000000..afb8815
--- /dev/null
+++ b/project/SPT.Launcher/CustomControls/ProfileCard.axaml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/project/SPT.Launcher/CustomControls/ProfileCard.axaml.cs b/project/SPT.Launcher/CustomControls/ProfileCard.axaml.cs
new file mode 100644
index 0000000..8585407
--- /dev/null
+++ b/project/SPT.Launcher/CustomControls/ProfileCard.axaml.cs
@@ -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 ProfileInfoProperty = AvaloniaProperty.Register(
+ "ProfileInfo");
+
+ public ProfileInfo ProfileInfo
+ {
+ get => GetValue(ProfileInfoProperty);
+ set => SetValue(ProfileInfoProperty, value);
+ }
+
+ public static readonly StyledProperty CurrentIdProperty = AvaloniaProperty.Register(
+ "CurrentId");
+
+ public string CurrentId
+ {
+ get => GetValue(CurrentIdProperty);
+ set => SetValue(CurrentIdProperty, value);
+ }
+
+ public static readonly StyledProperty CurrentEditionProperty = AvaloniaProperty.Register(
+ "CurrentEdition");
+
+ public string CurrentEdition
+ {
+ get => GetValue(CurrentEditionProperty);
+ set => SetValue(CurrentEditionProperty, value);
+ }
+
+ public static readonly StyledProperty WipeProfileOnStartProperty = AvaloniaProperty.Register(
+ "WipeProfileOnStart");
+
+ public bool WipeProfileOnStart
+ {
+ get => GetValue(WipeProfileOnStartProperty);
+ set => SetValue(WipeProfileOnStartProperty, value);
+ }
+
+ public static readonly StyledProperty ProfileWipePendingProperty = AvaloniaProperty.Register(
+ "ProfileWipePending");
+
+ public bool ProfileWipePending
+ {
+ get => GetValue(ProfileWipePendingProperty);
+ set => SetValue(ProfileWipePendingProperty, value);
+ }
+
+ public static readonly StyledProperty RemoveProfileCommandProperty = AvaloniaProperty.Register(
+ "RemoveProfileCommand");
+
+ public ICommand RemoveProfileCommand
+ {
+ get => GetValue(RemoveProfileCommandProperty);
+ set => SetValue(RemoveProfileCommandProperty, value);
+ }
+
+ public static readonly StyledProperty CopyCommandProperty = AvaloniaProperty.Register(
+ "CopyCommand");
+
+ public ICommand CopyCommand
+ {
+ get => GetValue(CopyCommandProperty);
+ set => SetValue(CopyCommandProperty, value);
+ }
+
+ public static readonly StyledProperty ChangeEditionCommandProperty = AvaloniaProperty.Register(
+ "ChangeEditionCommand");
+
+ public ICommand ChangeEditionCommand
+ {
+ get => GetValue(ChangeEditionCommandProperty);
+ set => SetValue(ChangeEditionCommandProperty, value);
+ }
+}
\ No newline at end of file
diff --git a/project/SPT.Launcher/CustomControls/TitleBar.axaml b/project/SPT.Launcher/CustomControls/TitleBar.axaml
index 86179b4..2be7281 100644
--- a/project/SPT.Launcher/CustomControls/TitleBar.axaml
+++ b/project/SPT.Launcher/CustomControls/TitleBar.axaml
@@ -55,11 +55,11 @@
>
diff --git a/project/SPT.Launcher/CustomControls/TotalModsCard.axaml b/project/SPT.Launcher/CustomControls/TotalModsCard.axaml
new file mode 100644
index 0000000..e31b467
--- /dev/null
+++ b/project/SPT.Launcher/CustomControls/TotalModsCard.axaml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/project/SPT.Launcher/CustomControls/TotalModsCard.axaml.cs b/project/SPT.Launcher/CustomControls/TotalModsCard.axaml.cs
new file mode 100644
index 0000000..5da6cf4
--- /dev/null
+++ b/project/SPT.Launcher/CustomControls/TotalModsCard.axaml.cs
@@ -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 ActiveModsCountProperty = AvaloniaProperty.Register(
+ "ActiveModsCount");
+
+ public int ActiveModsCount
+ {
+ get => GetValue(ActiveModsCountProperty);
+ set => SetValue(ActiveModsCountProperty, value);
+ }
+
+ public static readonly StyledProperty OpenModsInfoCommandProperty = AvaloniaProperty.Register(
+ "OpenModsInfoCommand");
+
+ public ICommand OpenModsInfoCommand
+ {
+ get => GetValue(OpenModsInfoCommandProperty);
+ set => SetValue(OpenModsInfoCommandProperty, value);
+ }
+}
\ No newline at end of file
diff --git a/project/SPT.Launcher/Models/GameStarterFrontend.cs b/project/SPT.Launcher/Models/GameStarterFrontend.cs
index 016347e..5d01217 100644
--- a/project/SPT.Launcher/Models/GameStarterFrontend.cs
+++ b/project/SPT.Launcher/Models/GameStarterFrontend.cs
@@ -7,6 +7,7 @@ using Avalonia.Controls.Notifications;
using Splat;
using System.Collections.Generic;
using System.Threading.Tasks;
+using DialogHostAvalonia;
namespace SPT.Launcher.Models
{
@@ -30,7 +31,7 @@ namespace SPT.Launcher.Models
var localeText = string.Format(LocalizationProvider.Instance.file_mismatch_dialog_message, serverVersion);
- var result = await DialogHost.DialogHost.Show(new ConfirmationDialogViewModel(null, localeText, null, null, LauncherSettingsProvider.Instance.IsDevMode));
+ var result = await DialogHost.Show(new ConfirmationDialogViewModel(null, localeText, null, null, LauncherSettingsProvider.Instance.IsDevMode));
if(result != null && result is bool confirmation && !confirmation)
{
diff --git a/project/SPT.Launcher/SPT.Launcher.csproj b/project/SPT.Launcher/SPT.Launcher.csproj
index a32dfc4..6c941f6 100644
--- a/project/SPT.Launcher/SPT.Launcher.csproj
+++ b/project/SPT.Launcher/SPT.Launcher.csproj
@@ -22,12 +22,13 @@
-
-
+
+
-
-
+
+
+
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Simplified).json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Simplified).json
index 745fe4f..8eacf00 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Simplified).json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Simplified).json
@@ -96,5 +96,6 @@
"open_link": "Open Link",
"dev_mode": "Developer Mode",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Traditional).json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Traditional).json
index 3a65e09..67f57ad 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Traditional).json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Traditional).json
@@ -96,5 +96,6 @@
"open_link": "Open Link",
"dev_mode": "Developer Mode",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
\ No newline at end of file
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/French.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/French.json
index e4841f6..f047423 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/French.json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/French.json
@@ -96,5 +96,6 @@
"open_link": "Open Link",
"dev_mode": "Developer Mode",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
\ No newline at end of file
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/German.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/German.json
index 5bcec18..af4dbdf 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/German.json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/German.json
@@ -96,5 +96,6 @@
"open_link": "Open Link",
"dev_mode": "Developer Mode",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
\ No newline at end of file
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Italian.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Italian.json
index a5022fc..6b0a23d 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Italian.json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Italian.json
@@ -96,5 +96,6 @@
"open_link": "Open Link",
"dev_mode": "Developer Mode",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
\ No newline at end of file
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Japanese.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Japanese.json
index c559182..031cb08 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Japanese.json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Japanese.json
@@ -96,5 +96,6 @@
"open_link": "Open Link",
"dev_mode": "Developer Mode",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
\ No newline at end of file
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Korean.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Korean.json
index f0a50d2..8d1efc4 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Korean.json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Korean.json
@@ -96,5 +96,6 @@
"open_link": "Open Link",
"dev_mode": "Developer Mode",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
\ No newline at end of file
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Polish.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Polish.json
index 8c36d78..eb74db2 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Polish.json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Polish.json
@@ -96,5 +96,6 @@
"open_link": "Open Link",
"dev_mode": "Tryb Dewelopera",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
\ No newline at end of file
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Russian.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Russian.json
index 0b9c5bc..83c1be0 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Russian.json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Russian.json
@@ -96,5 +96,6 @@
"open_link": "Открыть ссылку",
"dev_mode": "Developer Mode",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
\ No newline at end of file
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Spanish.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Spanish.json
index 7cee140..0206465 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Spanish.json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Spanish.json
@@ -96,5 +96,6 @@
"open_link": "Open Link",
"dev_mode": "Developer Mode",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
\ No newline at end of file
diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Turkish.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Turkish.json
index 9f0c0a9..2a6c64a 100644
--- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Turkish.json
+++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Turkish.json
@@ -96,5 +96,6 @@
"open_link": "Bağlantıyı Aç",
"dev_mode": "Developer Mode",
"failed_to_save_settings": "Failed to save settings",
+ "core_dll_file_version_mismatch": "Your BepinEx/plugins/spt/spt-core.dll file version doesn't match what was expected and is unable to start. Try reinstalling SPT",
"register_failed_name_limit": "name cannot exceed 15 characters"
}
\ No newline at end of file
diff --git a/project/SPT.Launcher/ViewLocator.cs b/project/SPT.Launcher/ViewLocator.cs
index 54efb46..7292b00 100644
--- a/project/SPT.Launcher/ViewLocator.cs
+++ b/project/SPT.Launcher/ViewLocator.cs
@@ -7,7 +7,7 @@ namespace SPT.Launcher
{
public class ViewLocator : IDataTemplate
{
- public IControl Build(object data)
+ public Control Build(object data)
{
var name = data.GetType().FullName!.Replace("ViewModel", "View");
var type = Type.GetType(name);
diff --git a/project/SPT.Launcher/ViewModels/LoginViewModel.cs b/project/SPT.Launcher/ViewModels/LoginViewModel.cs
index 49a033b..e9e16e7 100644
--- a/project/SPT.Launcher/ViewModels/LoginViewModel.cs
+++ b/project/SPT.Launcher/ViewModels/LoginViewModel.cs
@@ -146,8 +146,10 @@ namespace SPT.Launcher.ViewModels
});
}
- public void GetExistingProfiles()
+ public async Task GetExistingProfiles()
{
+ await Task.Delay(200);
+
ServerProfileInfo[] existingProfiles = AccountManager.GetExistingProfiles();
if(existingProfiles != null)
@@ -164,6 +166,8 @@ namespace SPT.Launcher.ViewModels
ImageHelper sideImage = new ImageHelper() { Path = profileInfo.SideImage };
sideImage.Touch();
+
+ await Task.Delay(100);
}
}
}
diff --git a/project/SPT.Launcher/ViewModels/MainWindowViewModel.cs b/project/SPT.Launcher/ViewModels/MainWindowViewModel.cs
index 6091479..2623452 100644
--- a/project/SPT.Launcher/ViewModels/MainWindowViewModel.cs
+++ b/project/SPT.Launcher/ViewModels/MainWindowViewModel.cs
@@ -9,7 +9,7 @@ using SPT.Launcher.Models.SPT;
using SPT.Launcher.Helpers;
using SPT.Launcher.ViewModels.Dialogs;
using Avalonia.Threading;
-using dialogHost = DialogHost.DialogHost;
+using DialogHostAvalonia;
namespace SPT.Launcher.ViewModels
@@ -48,7 +48,7 @@ namespace SPT.Launcher.ViewModels
LocalizationProvider.Instance.yes,
LocalizationProvider.Instance.no);
- var confirmCopySettings = await dialogHost.Show(viewModel);
+ var confirmCopySettings = await DialogHost.Show(viewModel);
if (confirmCopySettings is bool and true)
{
diff --git a/project/SPT.Launcher/ViewModels/ProfileViewModel.cs b/project/SPT.Launcher/ViewModels/ProfileViewModel.cs
index 2cd4c90..59e8c4a 100644
--- a/project/SPT.Launcher/ViewModels/ProfileViewModel.cs
+++ b/project/SPT.Launcher/ViewModels/ProfileViewModel.cs
@@ -10,6 +10,7 @@ using SPT.Launcher.ViewModels.Dialogs;
using Avalonia.Threading;
using System.Diagnostics;
using System.IO;
+using Avalonia.Controls.ApplicationLifetimes;
using SPT.Launcher.Models.SPT;
namespace SPT.Launcher.ViewModels
@@ -17,8 +18,8 @@ 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
{
@@ -40,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;
@@ -48,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)
{
@@ -62,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()
@@ -154,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)
{
@@ -221,9 +222,14 @@ namespace SPT.Launcher.ViewModels
public async Task CopyCommand(object parameter)
{
- if (Application.Current.Clipboard != null && parameter != null && parameter is string text)
+ if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop && parameter is string text)
{
- await Application.Current.Clipboard.SetTextAsync(text);
+ if (desktop?.MainWindow?.Clipboard == null)
+ {
+ return;
+ }
+
+ await desktop.MainWindow.Clipboard.SetTextAsync(text);
SendNotification("", $"{text} {LocalizationProvider.Instance.copied}", Avalonia.Controls.Notifications.NotificationType.Success);
}
}
diff --git a/project/SPT.Launcher/ViewModels/ViewModelBase.cs b/project/SPT.Launcher/ViewModels/ViewModelBase.cs
index 2064f27..ae658fd 100644
--- a/project/SPT.Launcher/ViewModels/ViewModelBase.cs
+++ b/project/SPT.Launcher/ViewModels/ViewModelBase.cs
@@ -8,7 +8,7 @@ using ReactiveUI;
using Splat;
using System;
using System.Threading.Tasks;
-using dialogHost = DialogHost.DialogHost;
+using DialogHostAvalonia;
namespace SPT.Launcher.ViewModels
{
@@ -162,7 +162,7 @@ namespace SPT.Launcher.ViewModels
///
public async Task