diff --git a/project/SPT.Launcher.Base/Controllers/GameStarter.cs b/project/SPT.Launcher.Base/Controllers/GameStarter.cs index 253450b..9903c14 100644 --- a/project/SPT.Launcher.Base/Controllers/GameStarter.cs +++ b/project/SPT.Launcher.Base/Controllers/GameStarter.cs @@ -217,7 +217,7 @@ namespace SPT.Launcher { var serverVersion = new SPTVersion(ServerManager.GetVersion()); - var coreDllVersionInfo = FileVersionInfo.GetVersionInfo(Path.Combine($"{gamePath}/BepinEx/plugins/spt", "spt-core.dll")); + var coreDllVersionInfo = FileVersionInfo.GetVersionInfo(Path.Join(gamePath, @"\BepinEx\plugins\spt", "spt-core.dll")); var dllVersion = new SPTVersion(coreDllVersionInfo.FileVersion); LogManager.Instance.Info($"[LaunchGame] spt-core.dll version: {dllVersion}"); @@ -300,7 +300,6 @@ namespace SPT.Launcher foreach (var value in key.GetValueNames()) { key.DeleteValue(value); - LogManager.Instance.Debug($"Removing reg key: {key.Name}"); } } catch (Exception ex) @@ -352,7 +351,6 @@ namespace SPT.Launcher { file.IsReadOnly = false; file.Delete(); - LogManager.Instance.Debug($" -> del file: {file.FullName}"); } // remove directory diff --git a/project/SPT.Launcher.Base/Controllers/LogManager.cs b/project/SPT.Launcher.Base/Controllers/LogManager.cs index 4f263b5..d615fe1 100644 --- a/project/SPT.Launcher.Base/Controllers/LogManager.cs +++ b/project/SPT.Launcher.Base/Controllers/LogManager.cs @@ -20,16 +20,16 @@ namespace SPT.Launcher.Controllers private static LogManager _instance; public static LogManager Instance => _instance ??= new LogManager(); private readonly string _filePath; - private readonly string _logFile; + public readonly string LogFile; private LogManager() { _filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "user", "logs"); - _logFile = Path.Combine(_filePath, "launcher.log"); + LogFile = Path.Combine(_filePath, "launcher.log"); - if (File.Exists(_logFile)) + if (File.Exists(LogFile)) { - File.Delete(_logFile); + File.Delete(LogFile); } Write($" ==== Launcher Started ===="); @@ -52,7 +52,7 @@ namespace SPT.Launcher.Controllers Directory.CreateDirectory(_filePath); } - File.AppendAllLines(_logFile, new[] { $"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}]{GetDevModeTag()}{text}" }); + File.AppendAllLines(LogFile, new[] { $"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}]{GetDevModeTag()}{text}" }); } public void Debug(string text) => Write($"[Debug] {text}"); diff --git a/project/SPT.Launcher.Base/Helpers/LocalizationProvider.cs b/project/SPT.Launcher.Base/Helpers/LocalizationProvider.cs index 411ed46..40c3e3b 100644 --- a/project/SPT.Launcher.Base/Helpers/LocalizationProvider.cs +++ b/project/SPT.Launcher.Base/Helpers/LocalizationProvider.cs @@ -193,6 +193,8 @@ namespace SPT.Launcher.Helpers englishLocale.dev_mode = "Developer Mode"; englishLocale.failed_to_save_settings = "Failed to save settings"; englishLocale.register_failed_name_limit = "name cannot exceed 15 characters"; + englishLocale.copy_failed = "Failed to copy data to clipboard"; + englishLocale.copy_logs_to_clipboard = "Copy logs to clipboard"; #endregion Directory.CreateDirectory(LocalizationProvider.DefaultLocaleFolderPath); @@ -229,6 +231,39 @@ namespace SPT.Launcher.Helpers #region All Properties + #region + private string _copy_logs_to_clipboard; + public string copy_logs_to_clipboard + { + get => _copy_logs_to_clipboard; + set + { + if (_copy_logs_to_clipboard != value) + { + _copy_logs_to_clipboard = value; + RaisePropertyChanged(nameof(copy_logs_to_clipboard)); + } + } + } + + #endregion + + #region copy_failed + private string _copy_failed; + public string copy_failed + { + get => _copy_failed; + set + { + if (_copy_failed != value) + { + _copy_failed = value; + RaisePropertyChanged(nameof(copy_failed)); + } + } + } + #endregion + #region register_failed_name_limit private string _register_failed_name_limit; diff --git a/project/SPT.Launcher.Base/Models/SPT/SPTVersion.cs b/project/SPT.Launcher.Base/Models/SPT/SPTVersion.cs index ef7e45f..c0e842d 100644 --- a/project/SPT.Launcher.Base/Models/SPT/SPTVersion.cs +++ b/project/SPT.Launcher.Base/Models/SPT/SPTVersion.cs @@ -38,7 +38,7 @@ namespace SPT.Launcher.Models.SPT string[] splitVersion = SPTVersion.Split('.'); - if (splitVersion.Length == 3) + if (splitVersion.Length >= 3) { int.TryParse(splitVersion[0], out Major); int.TryParse(splitVersion[1], out Minor); diff --git a/project/SPT.Launcher/CustomControls/DetailedProfileCard.axaml b/project/SPT.Launcher/CustomControls/DetailedProfileCard.axaml index 1545524..d3ea51e 100644 --- a/project/SPT.Launcher/CustomControls/DetailedProfileCard.axaml +++ b/project/SPT.Launcher/CustomControls/DetailedProfileCard.axaml @@ -6,7 +6,8 @@ xmlns:cvt="using:SPT.Launcher.Converters" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="SPT.Launcher.CustomControls.DetailedProfileCard" - MinWidth="250" MinHeight="250" + MinWidth="250" MinHeight="300" + MaxWidth="250" MaxHeight="300" PointerEntered="InputElement_OnPointerEntered" PointerExited="InputElement_OnPointerExited" PointerPressed="InputElement_OnPointerPressed" @@ -26,22 +27,26 @@ - + -