mirror of
https://github.com/sp-tarkov/launcher.git
synced 2025-02-12 14:10:44 -05:00
Merge pull request 'various-fixes' (!64) from waffle.lord/Launcher:various-fixes into master
Reviewed-on: SPT/Launcher#64
This commit is contained in:
commit
94fbc9d380
@ -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
|
||||
|
@ -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}");
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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 @@
|
||||
</Transitions>
|
||||
</Border.Transitions>
|
||||
|
||||
<Grid RowDefinitions="Auto, Auto, *, Auto, Auto" ColumnDefinitions="Auto, *, Auto" Margin="10">
|
||||
<Grid RowDefinitions="30, Auto, *, 20, Auto" ColumnDefinitions="Auto, *, Auto" Margin="10">
|
||||
<!-- SPT version -->
|
||||
<Label x:Name="SptVersion" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3"
|
||||
<Viewbox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Stretch="Uniform">
|
||||
<Label x:Name="SptVersion"
|
||||
Background="Transparent" HorizontalAlignment="Center"
|
||||
ToolTip.Tip="{Binding $parent[UserControl].ProfileInfo.MismatchMessage}"
|
||||
Classes.versionMismatch="{Binding $parent[UserControl].ProfileInfo.VersionMismatch}"
|
||||
>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding $parent[UserControl].ProfileInfo.SPT.version}"
|
||||
/>
|
||||
<TextBlock>
|
||||
<Run Text="{Binding $parent[UserControl].ProfileInfo.SPT.version}"
|
||||
/>
|
||||
<InlineUIContainer>
|
||||
<Path Data="{StaticResource Alert}" Fill="{Binding ElementName=SptVersion, Path=Foreground}"
|
||||
Margin="10 0"
|
||||
IsVisible="{Binding $parent[UserControl].ProfileInfo.VersionMismatch}"
|
||||
/>
|
||||
</StackPanel>
|
||||
</InlineUIContainer>
|
||||
</TextBlock>
|
||||
</Label>
|
||||
</Viewbox>
|
||||
|
||||
<!-- Side image -->
|
||||
<Image Grid.Row="1" Grid.Column="0"
|
||||
@ -89,21 +94,16 @@
|
||||
</StackPanel>
|
||||
|
||||
<!-- remaining xp -->
|
||||
<StackPanel Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
IsVisible="{Binding $parent[UserControl].ProfileInfo.HasData}"
|
||||
>
|
||||
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=next_level_in}"/>
|
||||
<Label Content="{Binding $parent[UserControl].ProfileInfo.RemainingExp}"
|
||||
FontWeight="SemiBold"
|
||||
Classes="acc"
|
||||
/>
|
||||
<Label Content="xp"/>
|
||||
</StackPanel>
|
||||
<Viewbox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" Stretch="Uniform" IsVisible="{Binding $parent[UserControl].ProfileInfo.HasData}">
|
||||
<TextBlock>
|
||||
<Run Text="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=next_level_in}"/>
|
||||
<Run Text="{Binding $parent[UserControl].ProfileInfo.RemainingExp}" Foreground="{DynamicResource AccentBrush}"/>
|
||||
<Run>xp</Run>
|
||||
</TextBlock>
|
||||
</Viewbox>
|
||||
|
||||
<!-- xp progress -->
|
||||
<ProgressBar Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3"
|
||||
<ProgressBar Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 10"
|
||||
Value="{Binding $parent[UserControl].ProfileInfo.XPLevelProgress}"
|
||||
IsVisible="{Binding $parent[UserControl].ProfileInfo.HasData}"
|
||||
/>
|
||||
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
||||
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -97,5 +97,7 @@
|
||||
"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"
|
||||
"register_failed_name_limit": "name cannot exceed 15 characters",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
}
|
@ -7,12 +7,14 @@ using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using ReactiveUI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Controls.Notifications;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Platform.Storage;
|
||||
|
||||
namespace SPT.Launcher.ViewModels
|
||||
@ -36,6 +38,64 @@ namespace SPT.Launcher.ViewModels
|
||||
LauncherSettingsProvider.Instance.SaveSettings();
|
||||
}
|
||||
|
||||
public async Task CopyLogsToClipboard()
|
||||
{
|
||||
LogManager.Instance.Info("[Settings] Copying logs to clipboard ...");
|
||||
|
||||
if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
if (desktop.MainWindow?.Clipboard == null)
|
||||
{
|
||||
LogManager.Instance.Error("[Settings] Failed to get clipboard");
|
||||
return;
|
||||
}
|
||||
|
||||
var traceLogs = Directory.GetFiles(Path.Join(LauncherSettingsProvider.Instance.GamePath, "Logs"), $"{DateTime.Now:yyyy.MM.dd}_* traces.log", SearchOption.AllDirectories);
|
||||
|
||||
var traceLog = traceLogs.Length > 0 ? traceLogs[0] : "";
|
||||
|
||||
var filesToCopy = new string[]
|
||||
{
|
||||
Path.Join(LauncherSettingsProvider.Instance.GamePath, @"\user\logs", $"server-{DateTime.Now:yyyy-MM-dd}.log"),
|
||||
traceLog,
|
||||
Path.Join(LauncherSettingsProvider.Instance.GamePath, @"BepInEx\LogOutput.log"),
|
||||
Path.Join(LauncherSettingsProvider.Instance.GamePath, @"\user\profiles", $"{AccountManager.SelectedAccount.id}.json"),
|
||||
LogManager.Instance.LogFile,
|
||||
};
|
||||
|
||||
List<IStorageFile> files = new List<IStorageFile>();
|
||||
|
||||
foreach (var logPath in filesToCopy)
|
||||
{
|
||||
var file = await desktop.MainWindow.StorageProvider.TryGetFileFromPathAsync(logPath);
|
||||
|
||||
if (file != null)
|
||||
{
|
||||
LogManager.Instance.Debug($"file to copy :: {logPath}");
|
||||
files.Add(file);
|
||||
continue;
|
||||
}
|
||||
|
||||
LogManager.Instance.Warning($"failed to get file to copy :: {logPath}");
|
||||
}
|
||||
|
||||
if (files.Count == 0)
|
||||
{
|
||||
LogManager.Instance.Warning("[Settings] Failed to copy log files");
|
||||
SendNotification("", LocalizationProvider.Instance.copy_failed);
|
||||
}
|
||||
|
||||
var data = new DataObject();
|
||||
|
||||
data.Set(DataFormats.Files, files.ToArray());
|
||||
|
||||
await desktop.MainWindow.Clipboard.SetDataObjectAsync(data);
|
||||
|
||||
LogManager.Instance.Info($"[Settings] {files.Count} log/s copied to clipboard");
|
||||
SendNotification("", $"{files.Count} {LocalizationProvider.Instance.copied}");
|
||||
}
|
||||
}
|
||||
|
||||
public void GoBackCommand()
|
||||
{
|
||||
if (Application.Current?.ApplicationLifetime is Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime desktop)
|
||||
@ -55,40 +115,47 @@ namespace SPT.Launcher.ViewModels
|
||||
|
||||
public void CleanTempFilesCommand()
|
||||
{
|
||||
LogManager.Instance.Info("[Settings] Clearing temp files ...");
|
||||
bool filesCleared = gameStarter.CleanTempFiles();
|
||||
|
||||
if (filesCleared)
|
||||
{
|
||||
LogManager.Instance.Info("[Settings] Temp files cleared");
|
||||
SendNotification("", LocalizationProvider.Instance.clean_temp_files_succeeded, NotificationType.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogManager.Instance.Info("[Settings] Temp files failed to clear");
|
||||
SendNotification("", LocalizationProvider.Instance.clean_temp_files_failed, NotificationType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegistryKeysCommand()
|
||||
{
|
||||
LogManager.Instance.Info("[Settings] Removing registry keys ...");
|
||||
bool regKeysRemoved = gameStarter.RemoveRegistryKeys();
|
||||
|
||||
if (regKeysRemoved)
|
||||
{
|
||||
LogManager.Instance.Info("[Settings] Registry keys removed");
|
||||
SendNotification("", LocalizationProvider.Instance.remove_registry_keys_succeeded, Avalonia.Controls.Notifications.NotificationType.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogManager.Instance.Info("[Settings] Registry keys failed to remove");
|
||||
SendNotification("", LocalizationProvider.Instance.remove_registry_keys_failed, Avalonia.Controls.Notifications.NotificationType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ResetGameSettingsCommand()
|
||||
{
|
||||
LogManager.Instance.Info("[Settings] Reseting game settings ...");
|
||||
string EFTSettingsFolder = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Battlestate Games", "Escape from Tarkov", "Settings");
|
||||
string SPTSettingsFolder = Path.Join(LauncherSettingsProvider.Instance.GamePath, "user", "sptsettings");
|
||||
|
||||
if (!Directory.Exists(EFTSettingsFolder))
|
||||
{
|
||||
LogManager.Instance.Warning($"EFT settings folder not found, can't reset :: Path: {EFTSettingsFolder}");
|
||||
LogManager.Instance.Warning($"[Settings] EFT settings folder not found, can't reset :: Path: {EFTSettingsFolder}");
|
||||
SendNotification("", LocalizationProvider.Instance.load_live_settings_failed, Avalonia.Controls.Notifications.NotificationType.Error);
|
||||
return;
|
||||
}
|
||||
@ -114,12 +181,14 @@ namespace SPT.Launcher.ViewModels
|
||||
SendNotification("", LocalizationProvider.Instance.load_live_settings_failed, Avalonia.Controls.Notifications.NotificationType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
LogManager.Instance.Info("[Settings] Game settings reset to live settings");
|
||||
SendNotification("", LocalizationProvider.Instance.load_live_settings_succeeded, Avalonia.Controls.Notifications.NotificationType.Success);
|
||||
}
|
||||
|
||||
public async Task ClearGameSettingsCommand()
|
||||
{
|
||||
LogManager.Instance.Info("[Settings] Clearing game settings ...");
|
||||
var SPTSettingsDir = new DirectoryInfo(Path.Join(LauncherSettingsProvider.Instance.GamePath, "user", "sptsettings"));
|
||||
|
||||
try
|
||||
@ -134,7 +203,8 @@ namespace SPT.Launcher.ViewModels
|
||||
SendNotification("", LocalizationProvider.Instance.clear_game_settings_failed, Avalonia.Controls.Notifications.NotificationType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
LogManager.Instance.Info("[Settings] Game settings cleared");
|
||||
SendNotification("", LocalizationProvider.Instance.clear_game_settings_succeeded, Avalonia.Controls.Notifications.NotificationType.Success);
|
||||
}
|
||||
|
||||
|
@ -12,29 +12,29 @@
|
||||
|
||||
<!-- Backdrop -->
|
||||
<Rectangle Fill="{DynamicResource BackgroundBrush}"
|
||||
Grid.RowSpan="7" Grid.ColumnSpan="5"
|
||||
Grid.RowSpan="8" Grid.ColumnSpan="5"
|
||||
Opacity=".7"
|
||||
/>
|
||||
<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="outlined"
|
||||
Margin="0 0 10 5"
|
||||
Classes="outlined" Margin="0 0 10 5"
|
||||
/>
|
||||
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=load_live_settings}"
|
||||
Command="{Binding ResetGameSettingsCommand}"
|
||||
Classes="outlined"
|
||||
Margin="0 0 10 5"
|
||||
Classes="outlined" Margin="0 0 10 5"
|
||||
/>
|
||||
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=clear_game_settings}"
|
||||
Command="{Binding ClearGameSettingsCommand}"
|
||||
Classes="outlined"
|
||||
Margin="0 0 10 5"
|
||||
Classes="outlined" Margin="0 0 10 5"
|
||||
/>
|
||||
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=clean_temp_files}"
|
||||
Command="{Binding CleanTempFilesCommand}"
|
||||
Classes="outlined"
|
||||
Margin="0 0 10 5"
|
||||
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"
|
||||
/>
|
||||
</WrapPanel>
|
||||
|
||||
@ -68,9 +68,11 @@
|
||||
|
||||
<!-- Game Path -->
|
||||
<StackPanel Grid.Row="5" Grid.Column="1" Margin="0 10 10 10" IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=IsDevMode}">
|
||||
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=game_path}"/>
|
||||
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=game_path}"
|
||||
/>
|
||||
<TextBox Watermark="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=game_path}"
|
||||
Text="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=GamePath}"
|
||||
VerticalContentAlignment="Center"
|
||||
/>
|
||||
</StackPanel>
|
||||
|
||||
@ -101,6 +103,7 @@
|
||||
<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}"
|
||||
VerticalContentAlignment="Center"
|
||||
/>
|
||||
</StackPanel>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user