mirror of
https://github.com/sp-tarkov/launcher.git
synced 2025-02-12 16:50:43 -05:00
Merge pull request 'bug fixes' (!63) from waffle.lord/Launcher:fix/profile-wipe into master
Reviewed-on: SPT/Launcher#63
This commit is contained in:
commit
c121b7fee7
@ -18,8 +18,6 @@ namespace SPT.Launcher.ViewModels
|
||||
[RequireLoggedIn]
|
||||
public class ProfileViewModel : ViewModelBase
|
||||
{
|
||||
// public string CurrentUsername { get; set; }
|
||||
|
||||
private string _CurrentEdition;
|
||||
public string CurrentEdition
|
||||
{
|
||||
@ -65,8 +63,6 @@ namespace SPT.Launcher.ViewModels
|
||||
|
||||
_monitor = new ProcessMonitor("EscapeFromTarkov", 1000, aliveCallback: GameAliveCallBack, exitCallback: GameExitCallback);
|
||||
|
||||
// CurrentUsername = AccountManager.SelectedAccount.username;
|
||||
|
||||
CurrentEdition = AccountManager.SelectedAccount.edition;
|
||||
|
||||
CurrentId = AccountManager.SelectedAccount.id;
|
||||
|
@ -11,7 +11,9 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Controls.Notifications;
|
||||
using Avalonia.Platform.Storage;
|
||||
|
||||
namespace SPT.Launcher.ViewModels
|
||||
{
|
||||
@ -148,18 +150,22 @@ namespace SPT.Launcher.ViewModels
|
||||
|
||||
public async Task SelectGameFolderCommand()
|
||||
{
|
||||
OpenFolderDialog dialog = new OpenFolderDialog();
|
||||
|
||||
dialog.Directory = Assembly.GetExecutingAssembly().Location;
|
||||
|
||||
if (Application.Current?.ApplicationLifetime is Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime desktop)
|
||||
if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
string? result = await dialog.ShowAsync(desktop.MainWindow);
|
||||
var startPath = await desktop.MainWindow.StorageProvider.TryGetFolderFromPathAsync(Assembly.GetExecutingAssembly().Location);
|
||||
|
||||
if (result != null)
|
||||
var dir = await desktop.MainWindow.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions()
|
||||
{
|
||||
LauncherSettingsProvider.Instance.GamePath = result;
|
||||
Title = "Select your SPT folder",
|
||||
SuggestedStartLocation = startPath
|
||||
});
|
||||
|
||||
if (dir == null || dir.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LauncherSettingsProvider.Instance.GamePath = dir[0].Path.LocalPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
ProfileInfo="{Binding ProfileInfo}"
|
||||
CurrentEdition="{Binding CurrentEdition}"
|
||||
CurrentId="{Binding CurrentId}"
|
||||
WipeProfileOnStart="{Binding WipeProfileOnStart}"
|
||||
WipeProfileOnStart="{Binding WipeProfileOnStart, Mode=TwoWay}"
|
||||
ProfileWipePending="{Binding ProfileWipePending}"
|
||||
CopyCommand="{Binding CopyCommand}"
|
||||
ChangeEditionCommand="{Binding ChangeEditionCommand}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user