diff --git a/project/Aki.Launcher.Base/Helpers/LocalizationProvider.cs b/project/Aki.Launcher.Base/Helpers/LocalizationProvider.cs
index b343b79..700052c 100644
--- a/project/Aki.Launcher.Base/Helpers/LocalizationProvider.cs
+++ b/project/Aki.Launcher.Base/Helpers/LocalizationProvider.cs
@@ -176,6 +176,7 @@ namespace Aki.Launcher.Helpers
englishLocale.server_mods = "Server Mods";
englishLocale.profile_mods = "Profile Mods";
englishLocale.author = "Author";
+ englishLocale.wipe_on_start = "Wipe profile on game start";
#endregion
Directory.CreateDirectory(LocalizationProvider.DefaultLocaleFolderPath);
@@ -1605,6 +1606,22 @@ namespace Aki.Launcher.Helpers
#endregion
+ #region wipe_on_start
+ private string _wipe_on_start;
+ public string wipe_on_start
+ {
+ get => _wipe_on_start;
+ set
+ {
+ if (_wipe_on_start != value)
+ {
+ _wipe_on_start = value;
+ RaisePropertyChanged(nameof(wipe_on_start));
+ }
+ }
+ }
+ #endregion
+
#endregion
public event PropertyChangedEventHandler PropertyChanged;
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Simplified).json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Simplified).json
index 90b8970..8a08a57 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Simplified).json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Simplified).json
@@ -85,5 +85,6 @@
"author": "Author",
"load_live_settings": "Load Live Settings",
"load_live_settings_succeeded": "Game settings copied from live",
- "load_live_settings_failed": "Failed to copy live settings"
+ "load_live_settings_failed": "Failed to copy live settings",
+ "wipe_on_start": "Wipe profile on game start"
}
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Traditional).json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Traditional).json
index 2637628..1432bad 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Traditional).json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Traditional).json
@@ -85,5 +85,6 @@
"author": "Author",
"load_live_settings": "Load Live Settings",
"load_live_settings_succeeded": "Game settings copied from live",
- "load_live_settings_failed": "Failed to copy live settings"
+ "load_live_settings_failed": "Failed to copy live settings",
+ "wipe_on_start": "Wipe profile on game start"
}
\ No newline at end of file
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/English.json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/English.json
index 0739763..ba65d26 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/English.json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/English.json
@@ -85,5 +85,6 @@
"author": "Author",
"load_live_settings": "Load Live Settings",
"load_live_settings_succeeded": "Game settings copied from live",
- "load_live_settings_failed": "Failed to copy live settings"
+ "load_live_settings_failed": "Failed to copy live settings",
+ "wipe_on_start": "Wipe profile on game start"
}
\ No newline at end of file
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/French.json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/French.json
index d28065f..9fe6bd9 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/French.json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/French.json
@@ -85,5 +85,6 @@
"author": "Author",
"load_live_settings": "Load Live Settings",
"load_live_settings_succeeded": "Game settings copied from live",
- "load_live_settings_failed": "Failed to copy live settings"
+ "load_live_settings_failed": "Failed to copy live settings",
+ "wipe_on_start": "Wipe profile on game start"
}
\ No newline at end of file
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/German.json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/German.json
index 9afa428..e8c2640 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/German.json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/German.json
@@ -85,5 +85,6 @@
"author": "Author",
"load_live_settings": "Load Live Settings",
"load_live_settings_succeeded": "Game settings copied from live",
- "load_live_settings_failed": "Failed to copy live settings"
+ "load_live_settings_failed": "Failed to copy live settings",
+ "wipe_on_start": "Wipe profile on game start"
}
\ No newline at end of file
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Italian.json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Italian.json
index b58de25..0624fca 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Italian.json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Italian.json
@@ -85,5 +85,6 @@
"author": "Author",
"load_live_settings": "Load Live Settings",
"load_live_settings_succeeded": "Game settings copied from live",
- "load_live_settings_failed": "Failed to copy live settings"
+ "load_live_settings_failed": "Failed to copy live settings",
+ "wipe_on_start": "Wipe profile on game start"
}
\ No newline at end of file
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Japanese.json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Japanese.json
index 22b63cb..c48c8cf 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Japanese.json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Japanese.json
@@ -85,5 +85,6 @@
"author": "Author",
"load_live_settings": "Load Live Settings",
"load_live_settings_succeeded": "Game settings copied from live",
- "load_live_settings_failed": "Failed to copy live settings"
+ "load_live_settings_failed": "Failed to copy live settings",
+ "wipe_on_start": "Wipe profile on game start"
}
\ No newline at end of file
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Korean.json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Korean.json
index 005b808..41fc2b0 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Korean.json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Korean.json
@@ -85,5 +85,6 @@
"author": "Author",
"load_live_settings": "Load Live Settings",
"load_live_settings_succeeded": "Game settings copied from live",
- "load_live_settings_failed": "Failed to copy live settings"
+ "load_live_settings_failed": "Failed to copy live settings",
+ "wipe_on_start": "Wipe profile on game start"
}
\ No newline at end of file
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Polish.json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Polish.json
index 84af70f..ca0728f 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Polish.json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Polish.json
@@ -85,5 +85,6 @@
"author": "Autor",
"load_live_settings": "Wczytaj ustawienia EFT",
"load_live_settings_succeeded": "Ustawienia gry skopiowane z EFT",
- "load_live_settings_failed": "Nie udało się skopiować ustawień EFT"
+ "load_live_settings_failed": "Nie udało się skopiować ustawień EFT",
+ "wipe_on_start": "Wipe profile on game start"
}
\ No newline at end of file
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Russian.json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Russian.json
index ea3873d..4520939 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Russian.json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Russian.json
@@ -85,5 +85,6 @@
"author": "Автор",
"load_live_settings": "Загрузить настройкий онлайн-версии",
"load_live_settings_succeeded": "Настройки игры скопированы из онлайн-версии",
- "load_live_settings_failed": "Не удалось скопировать настройки онлайн-версии"
+ "load_live_settings_failed": "Не удалось скопировать настройки онлайн-версии",
+ "wipe_on_start": "Wipe profile on game start"
}
\ No newline at end of file
diff --git a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Spanish.json b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Spanish.json
index 16393f1..d45eec2 100644
--- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Spanish.json
+++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Spanish.json
@@ -85,5 +85,6 @@
"author": "Author",
"load_live_settings": "Load Live Settings",
"load_live_settings_succeeded": "Game settings copied from live",
- "load_live_settings_failed": "Failed to copy live settings"
+ "load_live_settings_failed": "Failed to copy live settings",
+ "wipe_on_start": "Wipe profile on game start"
}
\ No newline at end of file
diff --git a/project/Aki.Launcher/Assets/Styles.axaml b/project/Aki.Launcher/Assets/Styles.axaml
index 7f47fc2..798adf9 100644
--- a/project/Aki.Launcher/Assets/Styles.axaml
+++ b/project/Aki.Launcher/Assets/Styles.axaml
@@ -8,6 +8,7 @@
+
@@ -297,6 +298,14 @@
+
+
+
+
diff --git a/project/Aki.Launcher/ViewModels/ProfileViewModel.cs b/project/Aki.Launcher/ViewModels/ProfileViewModel.cs
index 3d0f675..0a2f1d4 100644
--- a/project/Aki.Launcher/ViewModels/ProfileViewModel.cs
+++ b/project/Aki.Launcher/ViewModels/ProfileViewModel.cs
@@ -34,6 +34,20 @@ namespace Aki.Launcher.ViewModels
set => this.RaiseAndSetIfChanged(ref _ModsListIsVisible, value);
}
+ private bool _WipeProfileOnStart;
+ public bool WipeProfileOnStart
+ {
+ get => _WipeProfileOnStart;
+ set => this.RaiseAndSetIfChanged(ref _WipeProfileOnStart, value);
+ }
+
+ private bool _ProfileWipePending;
+ public bool ProfileWipePending
+ {
+ get => _ProfileWipePending;
+ set => this.RaiseAndSetIfChanged(ref _ProfileWipePending, value);
+ }
+
public string CurrentID { get; set; }
public ProfileInfo ProfileInfo { get; set; } = AccountManager.SelectedProfileInfo;
@@ -144,6 +158,19 @@ namespace Aki.Launcher.ViewModels
LauncherSettingsProvider.Instance.GameRunning = true;
+ if (WipeProfileOnStart)
+ {
+ var wipeStatus = await WipeProfile(AccountManager.SelectedAccount.edition);
+
+ if (wipeStatus != AccountStatus.OK)
+ {
+ LauncherSettingsProvider.Instance.GameRunning = false;
+ return;
+ }
+
+ WipeProfileOnStart = false;
+ }
+
GameStarterResult gameStartResult = await gameStarter.LaunchGame(ServerManager.SelectedServer, AccountManager.SelectedAccount, LauncherSettingsProvider.Instance.GamePath);
if (gameStartResult.Succeeded)
@@ -171,33 +198,41 @@ namespace Aki.Launcher.ViewModels
}
}
+ private async Task WipeProfile(string edition)
+ {
+ AccountStatus status = await AccountManager.WipeAsync(edition);
+
+ switch (status)
+ {
+ case AccountStatus.OK:
+ {
+ ProfileWipePending = true;
+ CurrentEdition = AccountManager.SelectedAccount.edition;
+ SendNotification("", LocalizationProvider.Instance.account_updated);
+ break;
+ }
+ case AccountStatus.NoConnection:
+ {
+ NavigateTo(new ConnectServerViewModel(HostScreen));
+ break;
+ }
+ default:
+ {
+ SendNotification("", LocalizationProvider.Instance.edit_account_update_error);
+ break;
+ }
+ }
+
+ return status;
+ }
+
public async Task ChangeEditionCommand()
{
var result = await ShowDialog(new ChangeEditionDialogViewModel(null));
if(result != null && result is AkiEdition edition)
{
- AccountStatus status = await AccountManager.WipeAsync(edition.Name);
-
- switch (status)
- {
- case AccountStatus.OK:
- {
- CurrentEdition = AccountManager.SelectedAccount.edition;
- SendNotification("", LocalizationProvider.Instance.account_updated);
- break;
- }
- case AccountStatus.NoConnection:
- {
- NavigateTo(new ConnectServerViewModel(HostScreen));
- break;
- }
- default:
- {
- SendNotification("", LocalizationProvider.Instance.edit_account_update_error);
- break;
- }
- }
+ await WipeProfile(edition.Name);
}
}
@@ -285,6 +320,7 @@ namespace Aki.Launcher.ViewModels
case LauncherAction.MinimizeAction:
{
ChangeWindowState(Avalonia.Controls.WindowState.Normal);
+ ProfileWipePending = false;
break;
}
diff --git a/project/Aki.Launcher/Views/ProfileView.axaml b/project/Aki.Launcher/Views/ProfileView.axaml
index df67337..a37723b 100644
--- a/project/Aki.Launcher/Views/ProfileView.axaml
+++ b/project/Aki.Launcher/Views/ProfileView.axaml
@@ -19,13 +19,13 @@
-
-
+
-
+
+
+
+
+ CommandParameter="{Binding CurrentID}"
+ />
+
+
+ Command="{Binding ChangeEditionCommand}"
+ IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=!GameRunning}"
+ />
+
+
+