mirror of
https://github.com/sp-tarkov/launcher.git
synced 2025-02-12 15:10:43 -05:00
Merge branch '3.10.0-DEV'
This commit is contained in:
commit
b899cf0882
@ -1,35 +0,0 @@
|
||||
name: Trigger Main Build Pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
trigger-main-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Git Config
|
||||
run: |
|
||||
git config --global user.email "noreply@sp-tarkov.com"
|
||||
git config --global user.name "TriggerBot"
|
||||
|
||||
- name: Clone Build Repository
|
||||
run: |
|
||||
rm -rf ../Build
|
||||
git clone https://${{ secrets.BUILD_USERNAME }}:${{ secrets.BUILD_ACCESS_TOKEN }}@dev.sp-tarkov.com/SPT-AKI/Build.git ../Build
|
||||
|
||||
- name: Trigger Branch
|
||||
working-directory: ../Build
|
||||
run: git checkout -b trigger || git checkout trigger
|
||||
|
||||
- name: Create Trigger File
|
||||
working-directory: ../Build
|
||||
run: |
|
||||
echo "${GITHUB_REF_NAME}" > .gitea/trigger
|
||||
git add .gitea/trigger
|
||||
git commit -m "Launcher triggered build with tag '${GITHUB_REF_NAME}'"
|
||||
|
||||
- name: Force Push
|
||||
working-directory: ../Build
|
||||
run: git push --force origin trigger
|
22
.github/workflows/build-trigger.yaml
vendored
Normal file
22
.github/workflows/build-trigger.yaml
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
name: Trigger Main Build Pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
trigger-main-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger Build Workflow
|
||||
uses: peter-evans/repository-dispatch@v3
|
||||
with:
|
||||
token: ${{ secrets.BUILD_REPO_ACCESS_TOKEN }}
|
||||
repository: sp-tarkov/build
|
||||
event-type: build-trigger
|
||||
client-payload: |
|
||||
{
|
||||
"repository": "${{ github.repository }}",
|
||||
"tag": "${{ github.ref_name }}"
|
||||
}
|
@ -19,7 +19,7 @@ git config --local user.email "USERNAME@SOMETHING.com"
|
||||
|
||||
## Requirements
|
||||
|
||||
- Escape From Tarkov 31124
|
||||
- Escape From Tarkov 33420
|
||||
- .NET 8 SDK
|
||||
- Visual Studio Code
|
||||
- [PowerShell v7](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows)
|
||||
|
@ -289,6 +289,7 @@ namespace SPT.Launcher
|
||||
}
|
||||
|
||||
SelectedAccount.edition = edition;
|
||||
SelectedAccount.wipe = true;
|
||||
LogManager.Instance.Info($"Account Wiped: {data.username} -> {edition}");
|
||||
return AccountStatus.OK;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ using SPT.Launcher.Controllers;
|
||||
using SPT.Launcher.Interfaces;
|
||||
using System.Runtime.InteropServices;
|
||||
using SPT.Launcher.Models.SPT;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace SPT.Launcher
|
||||
{
|
||||
@ -90,7 +91,7 @@ namespace SPT.Launcher
|
||||
if (account.wipe)
|
||||
{
|
||||
LogManager.Instance.Info("[LaunchGame] Wipe profile requested");
|
||||
RemoveRegistryKeys();
|
||||
RemoveProfileRegistryKeys(account.id);
|
||||
CleanTempFiles();
|
||||
}
|
||||
|
||||
@ -288,27 +289,24 @@ namespace SPT.Launcher
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove the registry keys
|
||||
/// Remove the SPT JSON-based registry keys associated with the given profile ID
|
||||
/// </summary>
|
||||
/// <returns>returns true if the keys were removed. returns false if an exception occured</returns>
|
||||
public bool RemoveRegistryKeys()
|
||||
public void RemoveProfileRegistryKeys(string profileId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var key = Registry.CurrentUser.OpenSubKey(registrySettings, true);
|
||||
var registryFile = new FileInfo(Path.Combine(Environment.CurrentDirectory, "user\\sptRegistry\\registry.json"));
|
||||
|
||||
foreach (var value in key.GetValueNames())
|
||||
if (!registryFile.Exists)
|
||||
{
|
||||
key.DeleteValue(value);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.Instance.Exception(ex);
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
return true;
|
||||
JObject registryData = JObject.Parse(File.ReadAllText(registryFile.FullName));
|
||||
|
||||
// Find any property that has a key containing the profileId, and remove it
|
||||
var propsToRemove = registryData.Properties().Where(prop => prop.Name.Contains(profileId, StringComparison.CurrentCultureIgnoreCase)).ToList();
|
||||
propsToRemove.ForEach(prop => prop.Remove());
|
||||
|
||||
File.WriteAllText(registryFile.FullName, registryData.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -33,7 +33,7 @@ namespace SPT.Launcher.Helpers
|
||||
switch (result.Result)
|
||||
{
|
||||
case PatchResultType.Success:
|
||||
File.Copy(targetfile, $"{targetfile}.bak");
|
||||
File.Copy(targetfile, $"{targetfile}.spt-bak");
|
||||
VFS.WriteFile(targetfile, result.PatchedData);
|
||||
break;
|
||||
|
||||
@ -109,7 +109,7 @@ namespace SPT.Launcher.Helpers
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
if (file.Extension == ".bak")
|
||||
if (file.Extension == ".spt-bak")
|
||||
{
|
||||
var target = Path.ChangeExtension(file.FullName, null);
|
||||
|
||||
|
@ -13,6 +13,7 @@ using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using SPT.Launcher.Utilities;
|
||||
using SPT.Launcher.Controllers;
|
||||
|
||||
namespace SPT.Launcher.Helpers
|
||||
@ -23,7 +24,7 @@ namespace SPT.Launcher.Helpers
|
||||
public static Settings Instance { get; } = Json.Load<Settings>(DefaultSettingsFileLocation) ?? new Settings();
|
||||
}
|
||||
|
||||
public class Settings : INotifyPropertyChanged
|
||||
public class Settings : NotifyPropertyChangedBase
|
||||
{
|
||||
public bool FirstRun { get; set; } = true;
|
||||
|
||||
@ -72,121 +73,65 @@ namespace SPT.Launcher.Helpers
|
||||
|
||||
public string DefaultLocale { get; set; } = "English";
|
||||
|
||||
private bool _IsAddingServer;
|
||||
private bool _isAddingServer;
|
||||
[JsonIgnore]
|
||||
public bool IsAddingServer
|
||||
{
|
||||
get => _IsAddingServer;
|
||||
set
|
||||
{
|
||||
if (_IsAddingServer != value)
|
||||
{
|
||||
_IsAddingServer = value;
|
||||
RaisePropertyChanged(nameof(IsAddingServer));
|
||||
}
|
||||
}
|
||||
get => _isAddingServer;
|
||||
set => SetProperty(ref _isAddingServer, value);
|
||||
}
|
||||
|
||||
private bool _AllowSettings;
|
||||
private bool _allowSettings;
|
||||
[JsonIgnore]
|
||||
public bool AllowSettings
|
||||
{
|
||||
get => _AllowSettings;
|
||||
set
|
||||
{
|
||||
if (_AllowSettings != value)
|
||||
{
|
||||
_AllowSettings = value;
|
||||
RaisePropertyChanged(nameof(AllowSettings));
|
||||
}
|
||||
}
|
||||
get => _allowSettings;
|
||||
set => SetProperty(ref _allowSettings, value);
|
||||
}
|
||||
|
||||
private bool _GameRunning;
|
||||
private bool _gameRunning;
|
||||
[JsonIgnore]
|
||||
public bool GameRunning
|
||||
{
|
||||
get => _GameRunning;
|
||||
set
|
||||
{
|
||||
if (_GameRunning != value)
|
||||
{
|
||||
_GameRunning = value;
|
||||
RaisePropertyChanged(nameof(GameRunning));
|
||||
}
|
||||
}
|
||||
get => _gameRunning;
|
||||
set => SetProperty(ref _gameRunning, value);
|
||||
}
|
||||
|
||||
private LauncherAction _LauncherStartGameAction;
|
||||
private LauncherAction _launcherStartGameAction;
|
||||
public LauncherAction LauncherStartGameAction
|
||||
{
|
||||
get => _LauncherStartGameAction;
|
||||
set
|
||||
{
|
||||
if (_LauncherStartGameAction != value)
|
||||
{
|
||||
_LauncherStartGameAction = value;
|
||||
RaisePropertyChanged(nameof(LauncherStartGameAction));
|
||||
}
|
||||
}
|
||||
get => _launcherStartGameAction;
|
||||
set => SetProperty(ref _launcherStartGameAction, value);
|
||||
}
|
||||
|
||||
private bool _UseAutoLogin;
|
||||
private bool _useAutoLogin;
|
||||
public bool UseAutoLogin
|
||||
{
|
||||
get => _UseAutoLogin;
|
||||
set
|
||||
{
|
||||
if (_UseAutoLogin != value)
|
||||
{
|
||||
_UseAutoLogin = value;
|
||||
RaisePropertyChanged(nameof(UseAutoLogin));
|
||||
}
|
||||
}
|
||||
get => _useAutoLogin;
|
||||
set => SetProperty(ref _useAutoLogin, value);
|
||||
}
|
||||
|
||||
private bool _IsDevMode;
|
||||
private bool _isDevMode;
|
||||
|
||||
public bool IsDevMode
|
||||
{
|
||||
get => _IsDevMode;
|
||||
set
|
||||
{
|
||||
if (_IsDevMode != value)
|
||||
{
|
||||
_IsDevMode = value;
|
||||
RaisePropertyChanged(nameof(IsDevMode));
|
||||
}
|
||||
}
|
||||
get => _isDevMode;
|
||||
set => SetProperty(ref _isDevMode, value);
|
||||
}
|
||||
|
||||
private string _GamePath;
|
||||
private string _gamePath;
|
||||
public string GamePath
|
||||
{
|
||||
get => _GamePath;
|
||||
set
|
||||
{
|
||||
if (_GamePath != value)
|
||||
{
|
||||
_GamePath = value;
|
||||
RaisePropertyChanged(nameof(GamePath));
|
||||
}
|
||||
}
|
||||
get => _gamePath;
|
||||
set => SetProperty(ref _gamePath, value);
|
||||
}
|
||||
|
||||
private string[] _ExcludeFromCleanup;
|
||||
private string[] _excludeFromCleanup = [];
|
||||
|
||||
public string[] ExcludeFromCleanup
|
||||
{
|
||||
get => _ExcludeFromCleanup ??= Array.Empty<string>();
|
||||
set
|
||||
{
|
||||
if (_ExcludeFromCleanup != value)
|
||||
{
|
||||
_ExcludeFromCleanup = value;
|
||||
RaisePropertyChanged(nameof(ExcludeFromCleanup));
|
||||
}
|
||||
}
|
||||
get => _excludeFromCleanup;
|
||||
set => SetProperty(ref _excludeFromCleanup, value);
|
||||
}
|
||||
|
||||
public ServerSetting Server { get; set; } = new ServerSetting();
|
||||
@ -202,18 +147,15 @@ namespace SPT.Launcher.Helpers
|
||||
GamePath = Environment.CurrentDirectory;
|
||||
IsDevMode = false;
|
||||
|
||||
Server = new ServerSetting { Name = "SPT", Url = "http://127.0.0.1:6969" };
|
||||
Server = new ServerSetting
|
||||
{
|
||||
Name = "SPT",
|
||||
Url = "http://127.0.0.1:6969"
|
||||
};
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
LogManager.Instance.Info($"Using launcher config at: {LauncherSettingsProvider.DefaultSettingsFileLocation}");
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -6,45 +6,24 @@
|
||||
*/
|
||||
|
||||
|
||||
using System.ComponentModel;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher
|
||||
{
|
||||
public class ConnectServerModel : INotifyPropertyChanged
|
||||
public class ConnectServerModel : NotifyPropertyChangedBase
|
||||
{
|
||||
private string _InfoText;
|
||||
private string _infoText;
|
||||
public string InfoText
|
||||
{
|
||||
get => _InfoText;
|
||||
set
|
||||
{
|
||||
if (_InfoText != value)
|
||||
{
|
||||
_InfoText = value;
|
||||
RaisePropertyChanged(nameof(InfoText));
|
||||
}
|
||||
}
|
||||
get => _infoText;
|
||||
set => SetProperty(ref _infoText, value);
|
||||
}
|
||||
|
||||
private bool _ConnectionFailed;
|
||||
private bool _connectionFailed;
|
||||
public bool ConnectionFailed
|
||||
{
|
||||
get => _ConnectionFailed;
|
||||
set
|
||||
{
|
||||
if(_ConnectionFailed != value)
|
||||
{
|
||||
_ConnectionFailed = value;
|
||||
RaisePropertyChanged(nameof(ConnectionFailed));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
get => _connectionFailed;
|
||||
set => SetProperty(ref _connectionFailed, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,53 +9,32 @@
|
||||
using SPT.Launcher.Models.SPT;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher
|
||||
{
|
||||
public class EditionCollection : INotifyPropertyChanged
|
||||
public class EditionCollection : NotifyPropertyChangedBase
|
||||
{
|
||||
private bool _HasSelection;
|
||||
private bool _hasSelection;
|
||||
public bool HasSelection
|
||||
{
|
||||
get => _HasSelection;
|
||||
set
|
||||
{
|
||||
if(_HasSelection != value)
|
||||
{
|
||||
_HasSelection = value;
|
||||
RaisePropertyChanged(nameof(HasSelection));
|
||||
get => _hasSelection;
|
||||
set => SetProperty(ref _hasSelection, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
private int _SelectedEditionIndex;
|
||||
private int _selectedEditionIndex;
|
||||
public int SelectedEditionIndex
|
||||
{
|
||||
get => _SelectedEditionIndex;
|
||||
set
|
||||
{
|
||||
if (_SelectedEditionIndex != value)
|
||||
{
|
||||
_SelectedEditionIndex = value;
|
||||
RaisePropertyChanged(nameof(SelectedEditionIndex));
|
||||
}
|
||||
}
|
||||
get => _selectedEditionIndex;
|
||||
set => SetProperty(ref _selectedEditionIndex, value);
|
||||
}
|
||||
|
||||
private SPTEdition _SelectedEdition;
|
||||
private SPTEdition _selectedEdition;
|
||||
public SPTEdition SelectedEdition
|
||||
{
|
||||
get => _SelectedEdition;
|
||||
set
|
||||
{
|
||||
if (_SelectedEdition != value)
|
||||
{
|
||||
_SelectedEdition = value;
|
||||
HasSelection = _SelectedEdition != null;
|
||||
RaisePropertyChanged(nameof(SelectedEdition));
|
||||
get => _selectedEdition;
|
||||
set => SetProperty(ref _selectedEdition, value, () => HasSelection = _selectedEdition != null);
|
||||
}
|
||||
}
|
||||
}
|
||||
public ObservableCollection<SPTEdition> AvailableEditions { get; private set; } = new ObservableCollection<SPTEdition>();
|
||||
public ObservableCollection<SPTEdition> AvailableEditions { get; private set; } = [];
|
||||
|
||||
public EditionCollection()
|
||||
{
|
||||
@ -66,12 +45,5 @@ namespace SPT.Launcher.Models.Launcher
|
||||
AvailableEditions.Add(new SPTEdition(edition));
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,38 +11,24 @@ using SPT.Launcher.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher
|
||||
{
|
||||
public class LocaleCollection : INotifyPropertyChanged
|
||||
public class LocaleCollection : NotifyPropertyChangedBase
|
||||
{
|
||||
private string _SelectedLocale;
|
||||
private string _selectedLocale;
|
||||
public string SelectedLocale
|
||||
{
|
||||
get => _SelectedLocale;
|
||||
set
|
||||
{
|
||||
if (_SelectedLocale != value)
|
||||
{
|
||||
_SelectedLocale = value;
|
||||
RaisePropertyChanged(nameof(SelectedLocale));
|
||||
LocalizationProvider.LoadLocalByName(value);
|
||||
}
|
||||
}
|
||||
get => _selectedLocale;
|
||||
set => SetProperty(ref _selectedLocale, value, () => LocalizationProvider.LoadLocalByName(value));
|
||||
}
|
||||
|
||||
public ObservableCollection<string> AvailableLocales { get; set; } = LocalizationProvider.GetAvailableLocales();
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public LocaleCollection()
|
||||
{
|
||||
SelectedLocale = LocalizationProvider.LocaleNameDictionary.GetValueOrDefault(LauncherSettingsProvider.Instance.DefaultLocale, "English");
|
||||
}
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,25 +2,19 @@
|
||||
using SPT.Launcher.Models.Launcher;
|
||||
using System.ComponentModel;
|
||||
using System.Text.RegularExpressions;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models
|
||||
{
|
||||
public class LocalizedLauncherAction : INotifyPropertyChanged
|
||||
public class LocalizedLauncherAction : NotifyPropertyChangedBase
|
||||
{
|
||||
public LauncherAction Action { get; set; }
|
||||
|
||||
private string _Name;
|
||||
private string _name;
|
||||
public string Name
|
||||
{
|
||||
get => _Name;
|
||||
set
|
||||
{
|
||||
if(_Name != value)
|
||||
{
|
||||
_Name = value;
|
||||
RaisePropertyChanged(nameof(Name));
|
||||
}
|
||||
}
|
||||
get => _name;
|
||||
set => SetProperty(ref _name, value);
|
||||
}
|
||||
|
||||
public void UpdateLocaleName()
|
||||
@ -49,12 +43,5 @@ namespace SPT.Launcher.Models
|
||||
|
||||
UpdateLocaleName();
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,44 +6,24 @@
|
||||
*/
|
||||
|
||||
|
||||
using System.ComponentModel;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher
|
||||
{
|
||||
public class LoginModel : INotifyPropertyChanged
|
||||
public class LoginModel : NotifyPropertyChangedBase
|
||||
{
|
||||
private string _Username = "";
|
||||
private string _username = "";
|
||||
public string Username
|
||||
{
|
||||
get => _Username;
|
||||
set
|
||||
{
|
||||
if (_Username != value)
|
||||
{
|
||||
_Username = value;
|
||||
RaisePropertyChanged(nameof(Username));
|
||||
}
|
||||
}
|
||||
get => _username;
|
||||
set => SetProperty(ref _username, value);
|
||||
}
|
||||
|
||||
private string _Password = "";
|
||||
private string _password = "";
|
||||
public string Password
|
||||
{
|
||||
get => _Password;
|
||||
set
|
||||
{
|
||||
if (_Password != value)
|
||||
{
|
||||
_Password = value;
|
||||
RaisePropertyChanged(nameof(Password));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
get => _password;
|
||||
set => SetProperty(ref _password, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,62 +9,35 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher
|
||||
{
|
||||
public class MenuBarItem : INotifyPropertyChanged
|
||||
public class MenuBarItem : NotifyPropertyChangedBase
|
||||
{
|
||||
private string _Name;
|
||||
private string _name;
|
||||
public string Name
|
||||
{
|
||||
get => _Name;
|
||||
set
|
||||
{
|
||||
if (_Name != value)
|
||||
{
|
||||
_Name = value;
|
||||
RaisePropertyChanged(nameof(Name));
|
||||
}
|
||||
}
|
||||
get => _name;
|
||||
set => SetProperty(ref _name, value);
|
||||
}
|
||||
|
||||
private bool _IsSelected;
|
||||
private bool _isSelected;
|
||||
public bool IsSelected
|
||||
{
|
||||
get => _IsSelected;
|
||||
set
|
||||
{
|
||||
if (_IsSelected != value)
|
||||
{
|
||||
_IsSelected = value;
|
||||
RaisePropertyChanged(nameof(IsSelected));
|
||||
}
|
||||
}
|
||||
get => _isSelected;
|
||||
set => SetProperty(ref _isSelected, value);
|
||||
}
|
||||
|
||||
private Action _ItemAction;
|
||||
private Action _itemAction;
|
||||
public Action ItemAction
|
||||
{
|
||||
get => _ItemAction;
|
||||
set
|
||||
{
|
||||
if (_ItemAction != value)
|
||||
{
|
||||
_ItemAction = value;
|
||||
RaisePropertyChanged(nameof(ItemAction));
|
||||
}
|
||||
}
|
||||
get => _itemAction;
|
||||
set => SetProperty(ref _itemAction, value);
|
||||
}
|
||||
|
||||
public Func<Task<bool>> CanUseAction = async () => await Task.FromResult(true);
|
||||
|
||||
public Action OnFailedToUseAction = null;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,55 +2,35 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher
|
||||
{
|
||||
public class ModInfoCollection : INotifyPropertyChanged
|
||||
public class ModInfoCollection : NotifyPropertyChangedBase
|
||||
{
|
||||
private int _serverModsCount;
|
||||
public int ServerModsCount
|
||||
{
|
||||
get => _serverModsCount;
|
||||
set
|
||||
{
|
||||
if (_serverModsCount != value)
|
||||
{
|
||||
_serverModsCount = value;
|
||||
RaisePropertyChanged(nameof(ServerModsCount));
|
||||
}
|
||||
}
|
||||
set => SetProperty(ref _serverModsCount, value);
|
||||
}
|
||||
|
||||
private int _profileModsCount;
|
||||
public int ProfileModsCount
|
||||
{
|
||||
get => _profileModsCount;
|
||||
set
|
||||
{
|
||||
if (_profileModsCount != value)
|
||||
{
|
||||
_profileModsCount = value;
|
||||
RaisePropertyChanged(nameof(ProfileModsCount));
|
||||
}
|
||||
}
|
||||
set => SetProperty(ref _profileModsCount, value);
|
||||
}
|
||||
|
||||
private bool _hasMods;
|
||||
public bool HasMods
|
||||
{
|
||||
get => _hasMods;
|
||||
set
|
||||
{
|
||||
if (_hasMods != value)
|
||||
{
|
||||
_hasMods = value;
|
||||
RaisePropertyChanged(nameof(HasMods));
|
||||
}
|
||||
}
|
||||
set => SetProperty(ref _hasMods, value);
|
||||
}
|
||||
|
||||
public ObservableCollection<SPTMod> ActiveMods { get; private set; } = new ObservableCollection<SPTMod>();
|
||||
public ObservableCollection<SPTMod> InactiveMods { get; private set; } = new ObservableCollection<SPTMod>();
|
||||
public ObservableCollection<SPTMod> ActiveMods { get; private set; } = [];
|
||||
public ObservableCollection<SPTMod> InactiveMods { get; private set; } = [];
|
||||
|
||||
public ModInfoCollection()
|
||||
{
|
||||
@ -68,7 +48,7 @@ namespace SPT.Launcher.Models.Launcher
|
||||
|
||||
foreach (var inactiveMod in profileMods)
|
||||
{
|
||||
var existingMod = ActiveMods.Where(x => x.Name == inactiveMod.Name && x.Version == inactiveMod.Version && x.Author == inactiveMod.Author).FirstOrDefault();
|
||||
var existingMod = ActiveMods.FirstOrDefault(x => x.Name == inactiveMod.Name && x.Version == inactiveMod.Version && x.Author == inactiveMod.Author);
|
||||
|
||||
if (existingMod != null)
|
||||
{
|
||||
@ -82,11 +62,5 @@ namespace SPT.Launcher.Models.Launcher
|
||||
|
||||
HasMods = ActiveMods.Count > 0 || InactiveMods.Count > 0;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,75 +9,48 @@
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher.Notifications
|
||||
{
|
||||
public class NotificationItem : INotifyPropertyChanged
|
||||
public class NotificationItem : NotifyPropertyChangedBase
|
||||
{
|
||||
private string _Message;
|
||||
private string _message;
|
||||
public string Message
|
||||
{
|
||||
get => _Message;
|
||||
set
|
||||
{
|
||||
if (_Message != value)
|
||||
{
|
||||
_Message = value;
|
||||
RaisePropertyChanged(nameof(Message));
|
||||
}
|
||||
}
|
||||
get => _message;
|
||||
set => SetProperty(ref _message, value);
|
||||
}
|
||||
|
||||
private string _ButtonText;
|
||||
private string _buttonText;
|
||||
public string ButtonText
|
||||
{
|
||||
get => _ButtonText;
|
||||
set
|
||||
{
|
||||
if (_ButtonText != value)
|
||||
{
|
||||
_ButtonText = value;
|
||||
RaisePropertyChanged(nameof(ButtonText));
|
||||
}
|
||||
}
|
||||
get => _buttonText;
|
||||
set => SetProperty(ref _buttonText, value);
|
||||
}
|
||||
|
||||
private bool _HasButton;
|
||||
private bool _hasButton;
|
||||
public bool HasButton
|
||||
{
|
||||
get => _HasButton;
|
||||
set
|
||||
{
|
||||
if (_HasButton != value)
|
||||
{
|
||||
_HasButton = value;
|
||||
RaisePropertyChanged(nameof(HasButton));
|
||||
}
|
||||
}
|
||||
get => _hasButton;
|
||||
set => SetProperty(ref _hasButton, value);
|
||||
}
|
||||
|
||||
public Action ItemAction = null;
|
||||
|
||||
public NotificationItem(string Message)
|
||||
public NotificationItem(string message)
|
||||
{
|
||||
this.Message = Message;
|
||||
Message = message;
|
||||
ButtonText = string.Empty;
|
||||
HasButton = false;
|
||||
}
|
||||
|
||||
public NotificationItem(string Message, string ButtonText, Action ItemAction)
|
||||
public NotificationItem(string message, string buttonText, Action itemAction)
|
||||
{
|
||||
this.Message = Message;
|
||||
this.ButtonText = ButtonText;
|
||||
Message = message;
|
||||
ButtonText = buttonText;
|
||||
HasButton = true;
|
||||
this.ItemAction = ItemAction;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
ItemAction = itemAction;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,35 +13,29 @@ using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher.Notifications
|
||||
{
|
||||
public class NotificationQueue : INotifyPropertyChanged, IDisposable
|
||||
public class NotificationQueue : NotifyPropertyChangedBase, IDisposable
|
||||
{
|
||||
public Timer queueTimer = new Timer();
|
||||
private Timer animateChangeTimer = new Timer(230);
|
||||
private Timer animateCloseTimer = new Timer(230);
|
||||
|
||||
public ObservableCollection<NotificationItem> queue { get; set; } = new ObservableCollection<NotificationItem>();
|
||||
public ObservableCollection<NotificationItem> queue { get; set; } = [];
|
||||
|
||||
private bool _ShowBanner;
|
||||
private bool _showBanner;
|
||||
public bool ShowBanner
|
||||
{
|
||||
get => _ShowBanner;
|
||||
set
|
||||
{
|
||||
if (_ShowBanner != value)
|
||||
{
|
||||
_ShowBanner = value;
|
||||
RaisePropertyChanged(nameof(ShowBanner));
|
||||
}
|
||||
}
|
||||
get => _showBanner;
|
||||
set => SetProperty(ref _showBanner, value);
|
||||
}
|
||||
|
||||
public NotificationQueue(int ShowTimeInMiliseconds)
|
||||
public NotificationQueue(int showTimeInMilliseconds)
|
||||
{
|
||||
ShowBanner = false;
|
||||
queueTimer.Interval = ShowTimeInMiliseconds;
|
||||
queueTimer.Interval = showTimeInMilliseconds;
|
||||
queueTimer.Elapsed += QueueTimer_Elapsed;
|
||||
|
||||
animateChangeTimer.Elapsed += AnimateChange_Elapsed;
|
||||
@ -71,43 +65,43 @@ namespace SPT.Launcher.Models.Launcher.Notifications
|
||||
}
|
||||
}
|
||||
|
||||
public void Enqueue(string Message, bool AutowNext = false, bool NoDefaultButton = false)
|
||||
public void Enqueue(string message, bool autoNext = false, bool noDefaultButton = false)
|
||||
{
|
||||
if (queue.Where(x => x.Message == Message).Count() == 0)
|
||||
if (queue.All(x => x.Message != message))
|
||||
{
|
||||
if (NoDefaultButton)
|
||||
if (noDefaultButton)
|
||||
{
|
||||
queue.Add(new NotificationItem(Message));
|
||||
queue.Add(new NotificationItem(message));
|
||||
}
|
||||
else
|
||||
{
|
||||
queue.Add(new NotificationItem(Message, LocalizationProvider.Instance.ok, () => { }));
|
||||
queue.Add(new NotificationItem(message, LocalizationProvider.Instance.ok, () => { }));
|
||||
}
|
||||
|
||||
CheckAndShowNotifications();
|
||||
|
||||
if (AutowNext && queue.Count == 2)
|
||||
if (autoNext && queue.Count == 2)
|
||||
{
|
||||
Next(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Enqueue(string Message, string ButtonText, Action ButtonAction, bool AllowNext = false)
|
||||
public void Enqueue(string message, string buttonText, Action buttonAction, bool allowNext = false)
|
||||
{
|
||||
if (queue.Where(x => x.Message == Message && x.ButtonText == ButtonText).Count() == 0)
|
||||
if (queue.All(x=>x.Message != message && x.ButtonText != buttonText))
|
||||
{
|
||||
queue.Add(new NotificationItem(Message, ButtonText, ButtonAction));
|
||||
queue.Add(new NotificationItem(message, buttonText, buttonAction));
|
||||
CheckAndShowNotifications();
|
||||
|
||||
if (AllowNext && queue.Count == 2)
|
||||
if (allowNext && queue.Count == 2)
|
||||
{
|
||||
Next(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Next(bool ResetTimer = false)
|
||||
public void Next(bool resetTimer = false)
|
||||
{
|
||||
if (queue.Count - 1 <= 0)
|
||||
{
|
||||
@ -115,7 +109,7 @@ namespace SPT.Launcher.Models.Launcher.Notifications
|
||||
return;
|
||||
}
|
||||
|
||||
if (ResetTimer)
|
||||
if (resetTimer)
|
||||
{
|
||||
queueTimer.Stop();
|
||||
queueTimer.Start();
|
||||
@ -142,13 +136,6 @@ namespace SPT.Launcher.Models.Launcher.Notifications
|
||||
ShowBanner = true;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
queueTimer.Dispose();
|
||||
|
@ -12,210 +12,127 @@ using SPT.Launcher.Models.SPT;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher
|
||||
{
|
||||
public class ProfileInfo : INotifyPropertyChanged
|
||||
public class ProfileInfo : NotifyPropertyChangedBase
|
||||
{
|
||||
private string _Username;
|
||||
private string _username;
|
||||
public string Username
|
||||
{
|
||||
get => _Username;
|
||||
set
|
||||
{
|
||||
if(_Username != value)
|
||||
{
|
||||
_Username = value;
|
||||
RaisePropertyChanged(nameof(Username));
|
||||
}
|
||||
}
|
||||
get => _username;
|
||||
set => SetProperty(ref _username, value);
|
||||
}
|
||||
|
||||
private string _Nickname;
|
||||
private string _nickname;
|
||||
public string Nickname
|
||||
{
|
||||
get => _Nickname;
|
||||
set
|
||||
{
|
||||
if (_Nickname != value)
|
||||
{
|
||||
_Nickname = value;
|
||||
RaisePropertyChanged(nameof(Nickname));
|
||||
}
|
||||
}
|
||||
get => _nickname;
|
||||
set => SetProperty(ref _nickname, value);
|
||||
}
|
||||
|
||||
private string _SideImage;
|
||||
private string _sideImage;
|
||||
public string SideImage
|
||||
{
|
||||
get => _SideImage;
|
||||
set
|
||||
{
|
||||
if (_SideImage != value)
|
||||
{
|
||||
_SideImage = value;
|
||||
RaisePropertyChanged(nameof(SideImage));
|
||||
}
|
||||
}
|
||||
get => _sideImage;
|
||||
set => SetProperty(ref _sideImage, value);
|
||||
}
|
||||
|
||||
private string _Side;
|
||||
private string _side;
|
||||
public string Side
|
||||
{
|
||||
get => _Side;
|
||||
set
|
||||
{
|
||||
if (_Side != value)
|
||||
{
|
||||
_Side = value;
|
||||
RaisePropertyChanged(nameof(Side));
|
||||
}
|
||||
}
|
||||
get => _side;
|
||||
set => SetProperty(ref _side, value);
|
||||
}
|
||||
|
||||
private string _Level;
|
||||
private string _level;
|
||||
public string Level
|
||||
{
|
||||
get => _Level;
|
||||
set
|
||||
{
|
||||
if (_Level != value)
|
||||
{
|
||||
_Level = value;
|
||||
RaisePropertyChanged(nameof(Level));
|
||||
}
|
||||
}
|
||||
get => _level;
|
||||
set => SetProperty(ref _level, value);
|
||||
}
|
||||
|
||||
private int _XPLevelProgress;
|
||||
public int XPLevelProgress
|
||||
{
|
||||
get => _XPLevelProgress;
|
||||
set
|
||||
{
|
||||
if (_XPLevelProgress != value)
|
||||
{
|
||||
_XPLevelProgress = value;
|
||||
RaisePropertyChanged(nameof(XPLevelProgress));
|
||||
}
|
||||
}
|
||||
set => SetProperty(ref _XPLevelProgress, value);
|
||||
}
|
||||
|
||||
private long _CurrentXP;
|
||||
private long _currentXP;
|
||||
public long CurrentExp
|
||||
{
|
||||
get => _CurrentXP;
|
||||
set
|
||||
{
|
||||
if (_CurrentXP != value)
|
||||
{
|
||||
_CurrentXP = value;
|
||||
RaisePropertyChanged(nameof(CurrentExp));
|
||||
}
|
||||
}
|
||||
get => _currentXP;
|
||||
set => SetProperty(ref _currentXP, value);
|
||||
}
|
||||
|
||||
private long _RemainingExp;
|
||||
private long _remainingExp;
|
||||
public long RemainingExp
|
||||
{
|
||||
get => _RemainingExp;
|
||||
set
|
||||
{
|
||||
if (_RemainingExp != value)
|
||||
{
|
||||
_RemainingExp = value;
|
||||
RaisePropertyChanged(nameof(RemainingExp));
|
||||
}
|
||||
}
|
||||
get => _remainingExp;
|
||||
set => SetProperty(ref _remainingExp, value);
|
||||
}
|
||||
|
||||
private long _NextLvlExp;
|
||||
private long _nextLvlExp;
|
||||
public long NextLvlExp
|
||||
{
|
||||
get => _NextLvlExp;
|
||||
set
|
||||
{
|
||||
if (_NextLvlExp != value)
|
||||
{
|
||||
_NextLvlExp = value;
|
||||
RaisePropertyChanged(nameof(NextLvlExp));
|
||||
}
|
||||
}
|
||||
get => _nextLvlExp;
|
||||
set => SetProperty(ref _nextLvlExp, value);
|
||||
}
|
||||
|
||||
private bool _HasData;
|
||||
private bool _hasData;
|
||||
public bool HasData
|
||||
{
|
||||
get => _HasData;
|
||||
set
|
||||
{
|
||||
if (_HasData != value)
|
||||
{
|
||||
_HasData = value;
|
||||
RaisePropertyChanged(nameof(HasData));
|
||||
}
|
||||
}
|
||||
get => _hasData;
|
||||
set => SetProperty(ref _hasData, value);
|
||||
}
|
||||
|
||||
public string MismatchMessage => VersionMismatch ? LocalizationProvider.Instance.profile_version_mismath : null;
|
||||
|
||||
private bool _VersionMismatch;
|
||||
private bool _versionMismatch;
|
||||
public bool VersionMismatch
|
||||
{
|
||||
get => _VersionMismatch;
|
||||
set
|
||||
{
|
||||
if(_VersionMismatch != value)
|
||||
{
|
||||
_VersionMismatch = value;
|
||||
RaisePropertyChanged(nameof(VersionMismatch));
|
||||
}
|
||||
}
|
||||
get => _versionMismatch;
|
||||
set => SetProperty(ref _versionMismatch, value);
|
||||
}
|
||||
|
||||
private SPTData _SPT;
|
||||
private SPTData _spt;
|
||||
public SPTData SPT
|
||||
{
|
||||
get => _SPT;
|
||||
set
|
||||
{
|
||||
if(_SPT != value)
|
||||
{
|
||||
_SPT = value;
|
||||
RaisePropertyChanged(nameof(SPT));
|
||||
}
|
||||
}
|
||||
get => _spt;
|
||||
set => SetProperty(ref _spt, value);
|
||||
}
|
||||
|
||||
public void UpdateDisplayedProfile(ProfileInfo PInfo)
|
||||
public void UpdateDisplayedProfile(ProfileInfo pInfo)
|
||||
{
|
||||
if (PInfo.Side == null || string.IsNullOrWhiteSpace(PInfo.Side) || PInfo.Side == "unknown") return;
|
||||
if (pInfo.Side == null || string.IsNullOrWhiteSpace(pInfo.Side) || pInfo.Side == "unknown") return;
|
||||
|
||||
HasData = true;
|
||||
Nickname = PInfo.Nickname;
|
||||
Side = PInfo.Side;
|
||||
SideImage = PInfo.SideImage;
|
||||
Level = PInfo.Level;
|
||||
CurrentExp = PInfo.CurrentExp;
|
||||
NextLvlExp = PInfo.NextLvlExp;
|
||||
RemainingExp = PInfo.RemainingExp;
|
||||
XPLevelProgress = PInfo.XPLevelProgress;
|
||||
Nickname = pInfo.Nickname;
|
||||
Side = pInfo.Side;
|
||||
SideImage = pInfo.SideImage;
|
||||
Level = pInfo.Level;
|
||||
CurrentExp = pInfo.CurrentExp;
|
||||
NextLvlExp = pInfo.NextLvlExp;
|
||||
RemainingExp = pInfo.RemainingExp;
|
||||
XPLevelProgress = pInfo.XPLevelProgress;
|
||||
|
||||
SPT = PInfo.SPT;
|
||||
SPT = pInfo.SPT;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the SPT versions are compatible (non-major changes)
|
||||
/// </summary>
|
||||
/// <param name="CurrentVersion"></param>
|
||||
/// <param name="ExpectedVersion"></param>
|
||||
/// <param name="currentVersion"></param>
|
||||
/// <param name="expectedVersion"></param>
|
||||
/// <returns></returns>
|
||||
private bool CompareVersions(string CurrentVersion, string ExpectedVersion)
|
||||
private bool CompareVersions(string currentVersion, string expectedVersion)
|
||||
{
|
||||
if (ExpectedVersion == "") return false;
|
||||
if (expectedVersion == "") return false;
|
||||
|
||||
SPTVersion v1 = new SPTVersion(CurrentVersion);
|
||||
SPTVersion v2 = new SPTVersion(ExpectedVersion);
|
||||
var v1 = new SPTVersion(currentVersion);
|
||||
var v2 = new SPTVersion(expectedVersion);
|
||||
|
||||
// check 'X'.x.x
|
||||
if (v1.Major != v2.Major) return false;
|
||||
@ -242,14 +159,7 @@ namespace SPT.Launcher.Models.Launcher
|
||||
|
||||
SideImage = Path.Combine(ImageRequest.ImageCacheFolder, $"side_{Side.ToLower()}.png");
|
||||
|
||||
if (Side != null && !string.IsNullOrWhiteSpace(Side) && Side != "unknown")
|
||||
{
|
||||
HasData = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
HasData = false;
|
||||
}
|
||||
HasData = Side != null && !string.IsNullOrWhiteSpace(Side) && Side != "unknown";
|
||||
|
||||
Level = serverProfileInfo.currlvl.ToString();
|
||||
CurrentExp = serverProfileInfo.currexp;
|
||||
@ -269,12 +179,5 @@ namespace SPT.Launcher.Models.Launcher
|
||||
|
||||
XPLevelProgress = (int)Math.Floor((((double)currentLvlTotal) - RemainingExp) / currentLvlTotal * 100);
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,47 +6,27 @@
|
||||
*/
|
||||
|
||||
|
||||
using System.ComponentModel;
|
||||
using SPT.Launcher.Utilities;
|
||||
using SPT.Launcher.Models.Launcher;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher
|
||||
namespace SPT.Launch.Models.Launcher
|
||||
{
|
||||
public class RegisterModel : INotifyPropertyChanged
|
||||
public class RegisterModel : NotifyPropertyChangedBase
|
||||
{
|
||||
private string _Username;
|
||||
private string _username;
|
||||
public string Username
|
||||
{
|
||||
get => _Username;
|
||||
set
|
||||
{
|
||||
if (_Username != value)
|
||||
{
|
||||
_Username = value;
|
||||
RaisePropertyChanged(nameof(Username));
|
||||
}
|
||||
}
|
||||
get => _username;
|
||||
set => SetProperty(ref _username, value);
|
||||
}
|
||||
|
||||
private string _Password;
|
||||
private string _password;
|
||||
public string Password
|
||||
{
|
||||
get => _Password;
|
||||
set
|
||||
{
|
||||
if (_Password != value)
|
||||
{
|
||||
_Password = value;
|
||||
RaisePropertyChanged(nameof(Password));
|
||||
}
|
||||
}
|
||||
get => _password;
|
||||
set => SetProperty(ref _password, value);
|
||||
}
|
||||
|
||||
public EditionCollection EditionsCollection { get; set; } = new EditionCollection();
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,47 +7,26 @@
|
||||
*/
|
||||
|
||||
|
||||
using System.ComponentModel;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.Launcher
|
||||
{
|
||||
public class ServerSetting : INotifyPropertyChanged
|
||||
public class ServerSetting : NotifyPropertyChangedBase
|
||||
{
|
||||
public LoginModel AutoLoginCreds { get; set; } = null;
|
||||
|
||||
private string _Name;
|
||||
private string _name;
|
||||
public string Name
|
||||
{
|
||||
get => _Name;
|
||||
set
|
||||
{
|
||||
if (_Name != value)
|
||||
{
|
||||
_Name = value;
|
||||
RaisePropertyChanged(nameof(Name));
|
||||
}
|
||||
}
|
||||
get => _name;
|
||||
set => SetProperty(ref _name, value);
|
||||
}
|
||||
|
||||
private string _Url;
|
||||
private string _url;
|
||||
public string Url
|
||||
{
|
||||
get => _Url;
|
||||
set
|
||||
{
|
||||
if (_Url != value)
|
||||
{
|
||||
_Url = value;
|
||||
RaisePropertyChanged(nameof(Url));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
get => _url;
|
||||
set => SetProperty(ref _url, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,42 +1,34 @@
|
||||
using System.ComponentModel;
|
||||
using SPT.Launcher.Utilities;
|
||||
|
||||
namespace SPT.Launcher.Models.SPT
|
||||
{
|
||||
public class SPTVersion : INotifyPropertyChanged
|
||||
public class SPTVersion : NotifyPropertyChangedBase
|
||||
{
|
||||
public int Major;
|
||||
public int Minor;
|
||||
public int Build;
|
||||
|
||||
public bool HasTag => Tag != null;
|
||||
public bool HasTag => Tag != string.Empty;
|
||||
|
||||
private string _Tag = null;
|
||||
private string _tag = string.Empty;
|
||||
public string Tag
|
||||
{
|
||||
get => _Tag;
|
||||
set
|
||||
{
|
||||
if(_Tag != value)
|
||||
{
|
||||
_Tag = value;
|
||||
RaisePropertyChanged(nameof(Tag));
|
||||
RaisePropertyChanged(nameof(HasTag));
|
||||
}
|
||||
}
|
||||
get => _tag;
|
||||
set => SetProperty(ref _tag, value, () => RaisePropertyChanged(nameof(HasTag)));
|
||||
}
|
||||
|
||||
public void ParseVersionInfo(string SPTVersion)
|
||||
public void ParseVersionInfo(string sptVersion)
|
||||
{
|
||||
if (SPTVersion.Contains('-'))
|
||||
if (sptVersion.Contains('-'))
|
||||
{
|
||||
string[] versionInfo = SPTVersion.Split('-');
|
||||
string[] versionInfo = sptVersion.Split('-');
|
||||
|
||||
SPTVersion = versionInfo[0];
|
||||
sptVersion = versionInfo[0];
|
||||
|
||||
Tag = versionInfo[1];
|
||||
}
|
||||
|
||||
string[] splitVersion = SPTVersion.Split('.');
|
||||
string[] splitVersion = sptVersion.Split('.');
|
||||
|
||||
if (splitVersion.Length >= 3)
|
||||
{
|
||||
@ -48,16 +40,9 @@ namespace SPT.Launcher.Models.SPT
|
||||
|
||||
public SPTVersion() { }
|
||||
|
||||
public SPTVersion(string SPTVersion)
|
||||
public SPTVersion(string sptVersion)
|
||||
{
|
||||
ParseVersionInfo(SPTVersion);
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void RaisePropertyChanged(string property)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
|
||||
ParseVersionInfo(sptVersion);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>SPT.Launch</RootNamespace>
|
||||
<RootNamespace>SPT.Launcher</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace SPT.Launcher.Utilities;
|
||||
|
||||
public abstract class NotifyPropertyChangedBase : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected void RaisePropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
protected void SetProperty<T>(ref T field, T value, Action afterSetAction = null, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (!EqualityComparer<T>.Default.Equals(field, value))
|
||||
{
|
||||
field = value;
|
||||
RaisePropertyChanged(propertyName);
|
||||
afterSetAction?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
protected void SetNotNullableProperty<T>(ref T field, T value, Action afterSetAction = null, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (value is not null)
|
||||
{
|
||||
SetProperty(ref field, value, afterSetAction, propertyName );
|
||||
}
|
||||
}
|
||||
}
|
@ -80,5 +80,17 @@
|
||||
FillRule="NonZero"
|
||||
/>
|
||||
|
||||
<PathGeometry x:Key="BackArrow" Figures="M12 2.001c5.524 0 10 4.477 10 10s-4.476 10-10 10c-5.522 0-10-4.477-10-10s4.478-10 10-10Zm.781 5.469-.084-.073a.75.75 0 0 0-.883-.007l-.094.08-.072.084a.75.75 0 0 0-.007.883l.08.094 2.719 2.72H7.75l-.102.006a.75.75 0 0 0-.641.642L7 12l.007.102a.75.75 0 0 0 .641.641l.102.007h6.69l-2.72 2.72-.073.085a.75.75 0 0 0 1.05 1.05l.083-.073 4.002-4 .072-.085a.75.75 0 0 0 .008-.882l-.08-.094-4-4.001-.085-.073.084.073Z"
|
||||
FillRule="NonZero"
|
||||
/>
|
||||
|
||||
<PathGeometry x:Key="Close" Figures="m4.21 4.387.083-.094a1 1 0 0 1 1.32-.083l.094.083L12 10.585l6.293-6.292a1 1 0 1 1 1.414 1.414L13.415 12l6.292 6.293a1 1 0 0 1 .083 1.32l-.083.094a1 1 0 0 1-1.32.083l-.094-.083L12 13.415l-6.293 6.292a1 1 0 0 1-1.414-1.414L10.585 12 4.293 5.707a1 1 0 0 1-.083-1.32l.083-.094-.083.094Z"
|
||||
FillRule="NonZero"
|
||||
/>
|
||||
|
||||
<PathGeometry x:Key="Minimize" Figures="M3.997 13H20a1 1 0 1 0 0-2H3.997a1 1 0 1 0 0 2Z"
|
||||
FillRule="NonZero"
|
||||
/>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
@ -23,8 +23,7 @@
|
||||
/>
|
||||
|
||||
<!-- Setting button -->
|
||||
<Button x:Name="stb"
|
||||
Grid.Column="2"
|
||||
<Button Grid.Column="2"
|
||||
FontSize="12"
|
||||
Command="{Binding SettingsButtonCommand, RelativeSource={
|
||||
RelativeSource AncestorType=UserControl}}"
|
||||
@ -33,14 +32,19 @@
|
||||
IsVisible="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=AllowSettings}"
|
||||
>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Path Data="{StaticResource Gear}" Fill="{Binding ElementName=stb, Path=Foreground}"
|
||||
Margin="2"/>
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Viewbox Width="14" Height="14" Margin="2">
|
||||
<Path Data="{StaticResource Gear}"
|
||||
Fill="{Binding $parent[TextBlock].Foreground}"
|
||||
/>
|
||||
</Viewbox>
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=settings_menu}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<!-- Minimize (-) Button -->
|
||||
<Button Content="" Grid.Column="4"
|
||||
<Button Grid.Column="4"
|
||||
Foreground="{Binding ButtonForeground, RelativeSource={
|
||||
RelativeSource AncestorType=UserControl}}"
|
||||
Command="{Binding MinButtonCommand, RelativeSource={
|
||||
@ -49,10 +53,16 @@
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
VerticalAlignment="Stretch"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
CornerRadius="0"
|
||||
Width="35"
|
||||
>
|
||||
<Viewbox Width="15" Height="15">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Path Data="{StaticResource Minimize}"
|
||||
Fill="{Binding $parent[TextBlock].Foreground}"
|
||||
/>
|
||||
</TextBlock>
|
||||
</Viewbox>
|
||||
<Button.Styles>
|
||||
<Style Selector="Button:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource AccentBrush2}"/>
|
||||
@ -65,7 +75,7 @@
|
||||
</Button>
|
||||
|
||||
<!-- Close (X) Button -->
|
||||
<Button Content="" Grid.Column="5"
|
||||
<Button Grid.Column="5"
|
||||
Foreground="{Binding ButtonForeground, RelativeSource={
|
||||
RelativeSource AncestorType=UserControl}}"
|
||||
Command="{Binding XButtonCommand, RelativeSource={
|
||||
@ -74,10 +84,16 @@
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
VerticalAlignment="Stretch"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
CornerRadius="0"
|
||||
Width="35"
|
||||
>
|
||||
<Viewbox Width="15" Height="15">
|
||||
<TextBlock>
|
||||
<Path Data="{StaticResource Close}"
|
||||
Fill="{Binding $parent[TextBlock].Foreground}"
|
||||
/>
|
||||
</TextBlock>
|
||||
</Viewbox>
|
||||
<Button.Styles>
|
||||
<Style Selector="Button:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="IndianRed"/>
|
||||
|
@ -6,6 +6,7 @@
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
<Nullable>enable</Nullable>
|
||||
<ApplicationIcon>Assets\spt-logo.ico</ApplicationIcon>
|
||||
<NoWin32Manifest>true</NoWin32Manifest>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AvaloniaResource Include="Assets\**" />
|
||||
@ -22,12 +23,12 @@
|
||||
<Content Include="Assets\icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.1.0-rc2" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.1.0-rc2" />
|
||||
<PackageReference Include="Avalonia" Version="11.1.1" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.1.1" />
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.12" />
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="11.1.0-rc2" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.0-rc2" />
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="11.1.1" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.1" />
|
||||
<PackageReference Include="DialogHost.Avalonia" Version="0.8.0-avalonia11dot1-3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -1,103 +1,103 @@
|
||||
{
|
||||
"ietf_tag": "tr",
|
||||
"native_name": "Turkish",
|
||||
"native_name": "Türkçe",
|
||||
"retry": "Yeniden Dene",
|
||||
"server_connecting": "Bağlanıyor",
|
||||
"server_unavailable_format_1": "Varsayılan sunucu '{0}' mevcut değil.",
|
||||
"no_servers_available": "Sunucu bulunamadı. AyarlardSPT sunucu listesini kontrol edin.",
|
||||
"server_unavailable_format_1": "Bağlanmak için Önce 'SPT.Server.exe' dosyasını çalıştırdığınızdan emin olun.",
|
||||
"no_servers_available": "SPT Sunucusu bulunamadı. SPT sunucunuzun çalıştığından emin olun ve ayarlar sayfasında sunucu URL'sinin doğru olup olmadığını kontrol edin.",
|
||||
"settings_menu": "Ayarlar",
|
||||
"back": "Geri dön",
|
||||
"wipe_profile": "Profili Wipela",
|
||||
"wipe_profile": "Profili Sıfırla",
|
||||
"username": "Kullanıcı Adı",
|
||||
"password": "Şifre",
|
||||
"update": "Güncelleme",
|
||||
"update": "Güncelle",
|
||||
"edit_account_update_error": "Profilinizi güncellerken bir sorun oluştu.",
|
||||
"register": "Kayıt Ol",
|
||||
"go_to_register": "Kayıt Ol'a git",
|
||||
"go_to_register": "Kaydol'a git",
|
||||
"login_or_register": "Giriş Yap / Kaydol",
|
||||
"go_to_login": "Giriş Yap'a git",
|
||||
"login_automatically": "Otomatik Oturum Açma",
|
||||
"login_automatically": "Otomatik Giriş",
|
||||
"incorrect_login": "Kullanıcı adı veya şifre yanlış.",
|
||||
"login_failed": "Oturum Açma Başarısız",
|
||||
"login_failed": "Giriş Başarısız",
|
||||
"edition": "Sürüm",
|
||||
"id": "ID",
|
||||
"logout": "Oturumu Kapat",
|
||||
"account": "Profil",
|
||||
"edit_account": "Profil Düzenle",
|
||||
"edit_account": "Profili Düzenle",
|
||||
"start_game": "Oyunu Başlat",
|
||||
"installed_in_live_game_warning": "SPT canlı oyun dizinine yüklenmemelidir. Lütfen SPT'yi bilgisayarınızın başka bir yerindeki oyun dizininin bir kopyasına yükleyin.",
|
||||
"no_official_game_warning": "Escape From Tarkov oyunu bilgisayarınızda yüklü değil. Lütfen oyunun bir kopyasını satın alın ve geliştiricileri destekleyin!",
|
||||
"eft_exe_not_found_warning": "EscapeFromTarkov.exe oyun yolunda bulunamadı. Lütfen dizinin doğru olup olmadığını kontrol edin.",
|
||||
"no_official_game_warning": "Escape From Tarkov bilgisayarınızda yüklü değil. SPT'yi başlatmadan önce BSG başlatıcınızın oyunu başlatabildiğinden emin olun.",
|
||||
"eft_exe_not_found_warning": "EscapeFromTarkov.exe oyun yolunda bulunamadı. Lütfen SPT'yi yüklediğiniz klasörde bu dosyanın olup olmadığını kontrol edin.",
|
||||
"account_exist": "Profil zaten mevcut",
|
||||
"url": "URL",
|
||||
"default_language": "Varsayılan Dil",
|
||||
"game_path": "SPT Oyun Klasörü",
|
||||
"game_path": "SPT Oyun Dosyası",
|
||||
"clear_game_settings": "Oyun Ayarlarını Temizle",
|
||||
"clear_game_settings_succeeded": "Oyun ayarları temizlendi.",
|
||||
"clear_game_settings_failed": "Oyun ayarları temizlenirken bir sorun oluştu.",
|
||||
"remove_registry_keys": "Kayıt Defteri Anahtarlarını Kaldır",
|
||||
"remove_registry_keys_succeeded": "Kayıt defteri anahtarları kaldırıldı.",
|
||||
"remove_registry_keys_failed": "Kayıt defteri anahtarları kaldırılırken bir sorun oluştu.",
|
||||
"clean_temp_files": "Temp Dosyalarını Temizleme",
|
||||
"remove_registry_keys": "Kayıt Defteri Anahtarlarını Silme",
|
||||
"remove_registry_keys_succeeded": "Kayıt defteri anahtarları silindi.",
|
||||
"remove_registry_keys_failed": "Kayıt defteri anahtarları silerken bir sorun oluştu.",
|
||||
"clean_temp_files": "Temp Dosyalarını Temizle",
|
||||
"clean_temp_files_succeeded": "Temp dosyaları temizlendi.",
|
||||
"clean_temp_files_failed": "Temp dosyalar temizlenirken bir sorun oluştu.",
|
||||
"clean_temp_files_failed": "Temp dosyası temizlenirken bir sorun oluştu.",
|
||||
"select_folder": "Klasör Seçin",
|
||||
"registration_failed": "Kayıt başarısız oldu.",
|
||||
"minimize_action": "Küçült",
|
||||
"do_nothing_action": "Hiçbir şey yapma",
|
||||
"exit_action": "Başlatıcıyı Kapat",
|
||||
"on_game_start": "Oyun Başlayınca başlatıcıya ne yapılsın",
|
||||
"on_game_start": "Oyun Başlayınca launcher ne yapılsın",
|
||||
"game": "Oyun",
|
||||
"new_password": "Yeni Parola",
|
||||
"cancel": "İptal",
|
||||
"new_password": "Yeni Şifre",
|
||||
"cancel": "İptal et",
|
||||
"need_an_account": "Henüz bir profiliniz yok mu?",
|
||||
"have_an_account": "Zaten bir profiliniz var mı?",
|
||||
"reapply_patch": "Yamayı Yeniden Uygula",
|
||||
"failed_to_receive_patches": "Yamalar alınamadı",
|
||||
"failed_core_patch": "Core yaması başarısız",
|
||||
"failed_core_patch": "Çekirdek yaması başarısız oldu",
|
||||
"failed_mod_patch": "Mod yaması başarısız oldu",
|
||||
"ok": "TAMAM.",
|
||||
"account_page_denied": "Profil sayfası reddedildi. Ya giriş yapmadınız ya da oyun çalışıyor.",
|
||||
"ok": "Tamam",
|
||||
"account_page_denied": "Oyun çalışırken veya oturum açmamışken ayarlar sayfasına erişemezsiniz.",
|
||||
"account_updated": "Profiliniz güncellendi",
|
||||
"nickname": "Kullanıcı adı",
|
||||
"nickname": "Takma ad",
|
||||
"side": "Taraf",
|
||||
"level": "Level",
|
||||
"patching": "Yama",
|
||||
"file_mismatch_dialog_message": "Girdi dosyası hash'i beklenen hash ile eşleşmiyor. İstemci dosyalarınız için SPT'nin yanlış sürümünü kullanıyor olabilirsiniz.\n\nDevam etmek istiyor musunuz?",
|
||||
"patching": "Yamalanıyor",
|
||||
"file_mismatch_dialog_message": "EFT dosyalarınız SPT için beklenenlerle eşleşmiyor: {0}\nEn son EFT sürümünün yüklü olup olmadığını kontrol edin\nEğer değilse, SPT'yi silin, canlı EFT'yi güncelleyin ve Yükleyiciyi boş bir klasörde tekrar çalıştırın\n\nDevam etmek istediğinizden emin misiniz?",
|
||||
"yes": "Evet",
|
||||
"no": "Hayır",
|
||||
"open_folder": "Klasörü Aç",
|
||||
"select_edition": "Versiyon Seçin",
|
||||
"select_edition": "Seçilmiş Sürüm",
|
||||
"profile_created": "Profil Oluşturuldu",
|
||||
"registration_question_format_1": "Profil '{0}' mevcut değil.\n\nBunu oluşturmak ister misiniz?",
|
||||
"next_level_in": "Bir sonraki seviye",
|
||||
"wipe_warning": "Hesap sürümünüzü değiştirmek için profil silmeniz gerekir. Bu, oyun ilerlemenizi sıfırlayacaktır.",
|
||||
"next_level_in": "Sonraki seviyeye",
|
||||
"wipe_warning": "Hesap sürümünüzü değiştirmek için profil silmeniz gerekir. Bu işlem profilinizi sıfırlayacaktır.",
|
||||
"copied": "Kopyalandı",
|
||||
"no_profile_data": "Profil verisi yok",
|
||||
"profile_version_mismath": "Profiliniz farklı bir SPT sürümü kullanılarak oluşturulmuştur ve sorunları olabilir",
|
||||
"profile_removed": "Profil kaldırıldı",
|
||||
"profile_removal_failed": "Profil kaldırılamadı",
|
||||
"profile_remove_question_format_1": "'{0}' profilini kalıcı olarak kaldıralım mı?",
|
||||
"no_profile_data": "Profil verileri yok",
|
||||
"profile_version_mismath": "Profiliniz SPT'nin farklı bir sürümü kullanılarak oluşturulmuştur ve sorunları olabilir",
|
||||
"profile_removed": "Profil silindi",
|
||||
"profile_removal_failed": "Profil silinemedi",
|
||||
"profile_remove_question_format_1": "Profil '{0}' kalıcı olarak silinsinmi mi?",
|
||||
"i_understand": "Anlıyorum.",
|
||||
"game_version_mismatch_format_2": "SPT çalıştırılamıyor, bunun nedeni SPT'nin '{1}' EFT sürümünü bulmayı beklemesi, ancak bunun yerine '{0}' sürümünü bulmasıdır\n\nEFT'nizi SPT'yi indirdiğiniz sayfada değil\nkurulum kılavuzunda açıklandığı şekilde düşürdüğünüzden emin olun",
|
||||
"game_version_mismatch_format_2": "SPT çalıştırılamıyor çünkü SPT EFT sürümünü bulmayı bekliyordu: '{1}',\nancak bunun yerine sürümü buldu: '{0}'\n\nEFT'nizi yükleme kılavuzunda açıklandığı gibi düşürdüğünüzden emin olun SPT'yi indirdiğiniz sayfada değil",
|
||||
"description": "Açıklama",
|
||||
"author": "Yazar",
|
||||
"load_live_settings": "Canlı Ayarları Yükle",
|
||||
"load_live_settings_succeeded": "Oyun ayarları canlıdan kopyalandı",
|
||||
"load_live_settings_failed": "Canlı ayarlar kopyalanamadı",
|
||||
"wipe_on_start": "Oyun başladığında profili wipela",
|
||||
"copy_live_settings_question": "Canlı oyun ayarlarınızı spt'ye kopyalamak ister misiniz",
|
||||
"mod_not_in_server_warning":"Bu mod profilinizde bulundu, ancak sunucuda yüklü değil",
|
||||
"load_live_settings": "Orjinal Oyun Ayarları Yükle",
|
||||
"load_live_settings_succeeded": "Oyun ayarları kopyalandı",
|
||||
"load_live_settings_failed": "Orjinal Oyun ayarları kopyalama başarısız oldu",
|
||||
"wipe_on_start": "Oyun başladığında profili sıfırla",
|
||||
"copy_live_settings_question": "Orjinal oyun ayarlarınızı SPT'ye kopyalamak ister misiniz?",
|
||||
"mod_not_in_server_warning": "Bu mod profilinizde bulundu, ancak sunucuda yüklü değil",
|
||||
"active_server_mods": "Aktif Sunucu Modları",
|
||||
"active_server_mods_info_text": "Bu modlar şu anda sunucuda çalışmaktadır",
|
||||
"inactive_server_mods": "Aktif Olmayan Sunucu Modları",
|
||||
"inactive_server_mods": "Etkin Olmayan Sunucu Modları",
|
||||
"inactive_server_mods_info_text": "Bu modlar sunucu tarafından yüklenmedi, ancak profiliniz geçmişte bunları kullandı",
|
||||
"open_link_question_format_1": "Aşağıdaki bağlantıyı açmak istediğinizden emin misiniz? \n{0}",
|
||||
"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",
|
||||
"copy_failed": "Failed to copy data to clipboard",
|
||||
"copy_logs_to_clipboard": "Copy logs to clipboard"
|
||||
"dev_mode": "Geliştirici Modu",
|
||||
"failed_to_save_settings": "Ayarlar kaydedilemedi",
|
||||
"core_dll_file_version_mismatch": "BepinEx/plugins/spt/spt-core.dll dosya sürümünüz beklenenle eşleşmiyor ve başlatılamıyor. SPT'yi yeniden yüklemeyi deneyin",
|
||||
"register_failed_name_limit": "isim 15 karakteri geçemez",
|
||||
"copy_failed": "Veriler panoya kopyalanamadı",
|
||||
"copy_logs_to_clipboard": "Günlükleri(Logs) panoya kopyala"
|
||||
}
|
Binary file not shown.
@ -2,9 +2,7 @@
|
||||
using SPT.Launcher.Helpers;
|
||||
using SPT.Launcher.Models;
|
||||
using SPT.Launcher.Models.Launcher;
|
||||
using SPT.Launcher.ViewModels.Dialogs;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using ReactiveUI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -50,18 +48,41 @@ namespace SPT.Launcher.ViewModels
|
||||
return;
|
||||
}
|
||||
|
||||
var traceLogs = Directory.GetFiles(Path.Join(LauncherSettingsProvider.Instance.GamePath, "Logs"), $"{DateTime.Now:yyyy.MM.dd}_* traces.log", SearchOption.AllDirectories);
|
||||
var filesToCopy = new List<string> { LogManager.Instance.LogFile };
|
||||
|
||||
var traceLog = traceLogs.Length > 0 ? traceLogs[0] : "";
|
||||
var serverLog = Path.Join(LauncherSettingsProvider.Instance.GamePath, @"\user\logs",
|
||||
$"server-{DateTime.Now:yyyy-MM-dd}.log");
|
||||
var bepinexLog = Path.Join(LauncherSettingsProvider.Instance.GamePath, @"BepInEx\LogOutput.log");
|
||||
|
||||
var filesToCopy = new string[]
|
||||
if (AccountManager.SelectedAccount?.id != null)
|
||||
{
|
||||
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,
|
||||
};
|
||||
filesToCopy.Add(Path.Join(LauncherSettingsProvider.Instance.GamePath, @"\user\profiles",
|
||||
$"{AccountManager.SelectedAccount.id}.json"));
|
||||
}
|
||||
|
||||
if (File.Exists(serverLog))
|
||||
{
|
||||
filesToCopy.Add(serverLog);
|
||||
}
|
||||
|
||||
if (File.Exists(bepinexLog))
|
||||
{
|
||||
filesToCopy.Add(bepinexLog);
|
||||
}
|
||||
|
||||
var logsPath = Path.Join(LauncherSettingsProvider.Instance.GamePath, "Logs");
|
||||
if (Directory.Exists(logsPath))
|
||||
{
|
||||
var traceLogs = Directory.GetFiles(logsPath, $"{DateTime.Now:yyyy.MM.dd}_* traces.log",
|
||||
SearchOption.AllDirectories);
|
||||
|
||||
var log = traceLogs.Length > 0 ? traceLogs[0] : "";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(log))
|
||||
{
|
||||
filesToCopy.Add(log);
|
||||
}
|
||||
}
|
||||
|
||||
List<IStorageFile> files = new List<IStorageFile>();
|
||||
|
||||
@ -130,23 +151,6 @@ namespace SPT.Launcher.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
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 ...");
|
||||
|
@ -16,10 +16,6 @@
|
||||
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"
|
||||
/>
|
||||
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=load_live_settings}"
|
||||
Command="{Binding ResetGameSettingsCommand}"
|
||||
Classes="outlined" Margin="0 0 10 5"
|
||||
@ -39,11 +35,17 @@
|
||||
</WrapPanel>
|
||||
|
||||
<!-- Go Back -->
|
||||
<Button Content="➜" FontSize="25"
|
||||
Grid.Row="1" Grid.Column="3"
|
||||
<Button Grid.Row="1" Grid.Column="3"
|
||||
Command="{Binding GoBackCommand}"
|
||||
Classes="link"
|
||||
Classes="link">
|
||||
<TextBlock>
|
||||
<Viewbox Height="30" Width="30">
|
||||
<Path Data="{StaticResource BackArrow}"
|
||||
Fill="{Binding $parent[TextBlock].Foreground}"
|
||||
/>
|
||||
</Viewbox>
|
||||
</TextBlock>
|
||||
</Button>
|
||||
|
||||
<!-- Default locale -->
|
||||
<StackPanel Grid.Row="2" Grid.Column="1">
|
||||
|
Loading…
x
Reference in New Issue
Block a user