From f8be6c52a3efe5fa7cf2abdb4c696c503e41c36b Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Sat, 30 Sep 2023 16:15:35 -0400 Subject: [PATCH] first launch asks to copy live settings, locale updates --- .../Helpers/LauncherSettingsProvider.cs | 2 - .../Helpers/LocalizationProvider.cs | 17 ++ .../Locales/Chinese (Simplified).json | 3 +- .../Locales/Chinese (Traditional).json | 3 +- .../Aki_Data/Launcher/Locales/English.json | 3 +- .../Aki_Data/Launcher/Locales/French.json | 3 +- .../Aki_Data/Launcher/Locales/German.json | 3 +- .../Aki_Data/Launcher/Locales/Italian.json | 3 +- .../Aki_Data/Launcher/Locales/Japanese.json | 3 +- .../Aki_Data/Launcher/Locales/Korean.json | 3 +- .../Aki_Data/Launcher/Locales/Polish.json | 177 +++++++++--------- .../Aki_Data/Launcher/Locales/Russian.json | 3 +- .../Aki_Data/Launcher/Locales/Spanish.json | 3 +- .../ViewModels/ProfileViewModel.cs | 26 ++- 14 files changed, 150 insertions(+), 102 deletions(-) diff --git a/project/Aki.Launcher.Base/Helpers/LauncherSettingsProvider.cs b/project/Aki.Launcher.Base/Helpers/LauncherSettingsProvider.cs index 9bacb1b..aa2d571 100644 --- a/project/Aki.Launcher.Base/Helpers/LauncherSettingsProvider.cs +++ b/project/Aki.Launcher.Base/Helpers/LauncherSettingsProvider.cs @@ -14,8 +14,6 @@ using Newtonsoft.Json; using System; using System.ComponentModel; using System.IO; -using System.Runtime.InteropServices; -using Microsoft.Win32; namespace Aki.Launcher.Helpers { diff --git a/project/Aki.Launcher.Base/Helpers/LocalizationProvider.cs b/project/Aki.Launcher.Base/Helpers/LocalizationProvider.cs index 700052c..34ff7d7 100644 --- a/project/Aki.Launcher.Base/Helpers/LocalizationProvider.cs +++ b/project/Aki.Launcher.Base/Helpers/LocalizationProvider.cs @@ -177,6 +177,7 @@ namespace Aki.Launcher.Helpers englishLocale.profile_mods = "Profile Mods"; englishLocale.author = "Author"; englishLocale.wipe_on_start = "Wipe profile on game start"; + englishLocale.copy_live_settings_question = "Would you like to copy your live game settings to spt"; #endregion Directory.CreateDirectory(LocalizationProvider.DefaultLocaleFolderPath); @@ -1622,6 +1623,22 @@ namespace Aki.Launcher.Helpers } #endregion + #region copy_live_settings_question + private string _copy_live_settings_question; + public string copy_live_settings_question + { + get => _copy_live_settings_question; + set + { + if (_copy_live_settings_question != value) + { + _copy_live_settings_question = value; + RaisePropertyChanged(nameof(copy_live_settings_question)); + } + } + } + #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 8a08a57..09e53c9 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Simplified).json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Simplified).json @@ -86,5 +86,6 @@ "load_live_settings": "Load Live Settings", "load_live_settings_succeeded": "Game settings copied from live", "load_live_settings_failed": "Failed to copy live settings", - "wipe_on_start": "Wipe profile on game start" + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } 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 1432bad..eb399ca 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Traditional).json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Chinese (Traditional).json @@ -86,5 +86,6 @@ "load_live_settings": "Load Live Settings", "load_live_settings_succeeded": "Game settings copied from live", "load_live_settings_failed": "Failed to copy live settings", - "wipe_on_start": "Wipe profile on game start" + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } \ 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 ba65d26..8a52cb5 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/English.json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/English.json @@ -86,5 +86,6 @@ "load_live_settings": "Load Live Settings", "load_live_settings_succeeded": "Game settings copied from live", "load_live_settings_failed": "Failed to copy live settings", - "wipe_on_start": "Wipe profile on game start" + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } \ 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 9fe6bd9..fffb0bd 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/French.json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/French.json @@ -86,5 +86,6 @@ "load_live_settings": "Load Live Settings", "load_live_settings_succeeded": "Game settings copied from live", "load_live_settings_failed": "Failed to copy live settings", - "wipe_on_start": "Wipe profile on game start" + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } \ 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 e8c2640..8295fae 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/German.json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/German.json @@ -86,5 +86,6 @@ "load_live_settings": "Load Live Settings", "load_live_settings_succeeded": "Game settings copied from live", "load_live_settings_failed": "Failed to copy live settings", - "wipe_on_start": "Wipe profile on game start" + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } \ 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 0624fca..2386dfc 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Italian.json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Italian.json @@ -86,5 +86,6 @@ "load_live_settings": "Load Live Settings", "load_live_settings_succeeded": "Game settings copied from live", "load_live_settings_failed": "Failed to copy live settings", - "wipe_on_start": "Wipe profile on game start" + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } \ 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 c48c8cf..46f9f8f 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Japanese.json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Japanese.json @@ -86,5 +86,6 @@ "load_live_settings": "Load Live Settings", "load_live_settings_succeeded": "Game settings copied from live", "load_live_settings_failed": "Failed to copy live settings", - "wipe_on_start": "Wipe profile on game start" + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } \ 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 41fc2b0..c90ab47 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Korean.json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Korean.json @@ -86,5 +86,6 @@ "load_live_settings": "Load Live Settings", "load_live_settings_succeeded": "Game settings copied from live", "load_live_settings_failed": "Failed to copy live settings", - "wipe_on_start": "Wipe profile on game start" + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } \ 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 ca0728f..0cef718 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Polish.json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Polish.json @@ -1,90 +1,91 @@ { - "native_name": "Polski", - "retry": "Ponów", - "server_connecting": "Łączenie", - "server_unavailable_format_1": "Domyślny serwer '{0}' jest niedostępny.", - "no_servers_available": "Nie znaleziono serwerów. Sprawdź listę serwerów w ustawieniach.", - "settings_menu": "Ustawienia", - "back": "Powrót", - "wipe_profile": "Wyczyść profil", - "username": "Nazwa użytkownika", - "password": "Hasło", - "update": "Aktualizuj", - "edit_account_update_error": "Wystąpił problem podczas aktualizacji profilu.", - "register": "Zarejestruj", - "go_to_register": "Przejdź do rejestracji", - "login_or_register": "Zaloguj / Zarejestruj", - "go_to_login": "Przejdź do logowania", - "login_automatically": "Automatyczne logowanie", - "incorrect_login": "Nazwa użytkownika lub hasło są niepoprawne.", - "login_failed": "Logowanie nie powiodło się", - "edition": "Edycja", - "id": "ID", - "logout": "Wyloguj", - "account": "Profil", - "edit_account": "Edytuj profil", - "start_game": "Uruchom grę", - "installed_in_live_game_warning": "Aki nie powinien być instalowany w katalogu instalacyjnym EFT. Zainstaluj Aki w kopii katalogu gry gdzie indziej na swoim komputerze.", - "no_official_game_warning": "Escape From Tarkov nie jest zainstalowany na twoim komputerze. Kup kopię gry i wesprzyj deweloperów!", - "eft_exe_not_found_warning": "Nie znaleziono pliku EscapeFromTarkov.exe w ścieżce gry. Sprawdź, czy ścieżka jest poprawna.", - "account_exist": "Profil już istnieje", - "url": "URL", - "default_language": "Domyślny język", - "game_path": "Ścieżka do gry SPT", - "clear_game_settings": "Wyczyść ustawienia gry", - "clear_game_settings_succeeded": "Ustawienia gry zostały wyczyszczone.", - "clear_game_settings_failed": "Wystąpił problem podczas czyszczenia ustawień gry.", - "remove_registry_keys": "Usuń klucze rejestru", - "remove_registry_keys_succeeded": "Klucze rejestru zostały usunięte.", - "remove_registry_keys_failed": "Wystąpił problem podczas usuwania kluczy rejestru.", - "clean_temp_files": "Wyczyść pliki tymczasowe", - "clean_temp_files_succeeded": "Pliki tymczasowe zostały wyczyszczone.", - "clean_temp_files_failed": "Wystąpił problem podczas czyszczenia plików tymczasowych.", - "select_folder": "Wybierz folder", - "registration_failed": "Rejestracja nie powiodła się.", - "minimize_action": "Minimalizuj", - "do_nothing_action": "Nic nie rób", - "exit_action": "Zamknij Launcher", - "on_game_start": "Przy uruchamianiu gry", - "game": "Gra", - "new_password": "Nowe hasło", - "cancel": "Anuluj", - "need_an_account": "Nie masz jeszcze profilu?", - "have_an_account": "Masz już profil?", - "reapply_patch": "Zastosuj patch ponownie", - "failed_to_receive_patches": "Nie udało się odczytać patchy", - "failed_core_patch": "Nieudany patch główny", - "failed_mod_patch": "Nieudany patch modów", - "ok": "OK", - "account_page_denied": "Brak dostępu do strony profilu. Albo nie jesteś zalogowany, albo gra jest uruchomiona.", - "account_updated": "Twój profil został zaktualizowany", - "nickname": "Pseudonim", - "side": "Strona", - "level": "Poziom", - "patching": "Patchowanie", - "file_mismatch_dialog_message": "Suma kontrolna pliku wejściowego nie zgadza się z oczekiwaną sumą kontrolną. Możliwe, że używasz niewłaściwej wersji AKI dla swoich plików klienta.\n\nCzy chcesz kontynuować?", - "yes": "Tak", - "no": "Nie", - "open_folder": "Otwórz folder", - "select_edition": "Wybierz edycję", - "profile_created": "Profil utworzony", - "registration_question_format_1": "Profil '{0}' nie istnieje.\n\nCzy chcesz go utworzyć?", - "next_level_in": "Poziom za", - "wipe_warning": "Zmiana edycji konta wymaga wyczyszczenia profilu. Spowoduje to zresetowanie postępu w grze.", - "copied": "Skopiowane", - "no_profile_data": "Brak danych profilu", - "profile_version_mismath": "Twój profil został utworzony przy użyciu innej wersji aki i może mieć problemy", - "profile_removed": "Profil usunięty", - "profile_removal_failed": "Nie udało się usunąć profilu", - "profile_remove_question_format_1": "Czy na pewno chcesz trwale usunąć profil '{0}'?", - "i_understand": "Rozumiem", - "game_version_mismatch_format_2": "SPT nie może zostać uruchomiony, ponieważ SPT oczekiwał wersji EFT '{1}',\nale zamiast tego znalazł wersję '{0}'\n\nUpewnij się, że zainstalowałeś starszą wersję EFT, zgodnie z instrukcją instalacji\nna stronie, z której pobrałeś SPT", - "description": "Opis", - "server_mods": "Mody serwera", - "profile_mods": "Mody profilu", - "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", - "wipe_on_start": "Wipe profile on game start" + "native_name": "Polski", + "retry": "Ponów", + "server_connecting": "Łączenie", + "server_unavailable_format_1": "Domyślny serwer '{0}' jest niedostępny.", + "no_servers_available": "Nie znaleziono serwerów. Sprawdź listę serwerów w ustawieniach.", + "settings_menu": "Ustawienia", + "back": "Powrót", + "wipe_profile": "Wyczyść profil", + "username": "Nazwa użytkownika", + "password": "Hasło", + "update": "Aktualizuj", + "edit_account_update_error": "Wystąpił problem podczas aktualizacji profilu.", + "register": "Zarejestruj", + "go_to_register": "Przejdź do rejestracji", + "login_or_register": "Zaloguj / Zarejestruj", + "go_to_login": "Przejdź do logowania", + "login_automatically": "Automatyczne logowanie", + "incorrect_login": "Nazwa użytkownika lub hasło są niepoprawne.", + "login_failed": "Logowanie nie powiodło się", + "edition": "Edycja", + "id": "ID", + "logout": "Wyloguj", + "account": "Profil", + "edit_account": "Edytuj profil", + "start_game": "Uruchom grę", + "installed_in_live_game_warning": "Aki nie powinien być instalowany w katalogu instalacyjnym EFT. Zainstaluj Aki w kopii katalogu gry gdzie indziej na swoim komputerze.", + "no_official_game_warning": "Escape From Tarkov nie jest zainstalowany na twoim komputerze. Kup kopię gry i wesprzyj deweloperów!", + "eft_exe_not_found_warning": "Nie znaleziono pliku EscapeFromTarkov.exe w ścieżce gry. Sprawdź, czy ścieżka jest poprawna.", + "account_exist": "Profil już istnieje", + "url": "URL", + "default_language": "Domyślny język", + "game_path": "Ścieżka do gry SPT", + "clear_game_settings": "Wyczyść ustawienia gry", + "clear_game_settings_succeeded": "Ustawienia gry zostały wyczyszczone.", + "clear_game_settings_failed": "Wystąpił problem podczas czyszczenia ustawień gry.", + "remove_registry_keys": "Usuń klucze rejestru", + "remove_registry_keys_succeeded": "Klucze rejestru zostały usunięte.", + "remove_registry_keys_failed": "Wystąpił problem podczas usuwania kluczy rejestru.", + "clean_temp_files": "Wyczyść pliki tymczasowe", + "clean_temp_files_succeeded": "Pliki tymczasowe zostały wyczyszczone.", + "clean_temp_files_failed": "Wystąpił problem podczas czyszczenia plików tymczasowych.", + "select_folder": "Wybierz folder", + "registration_failed": "Rejestracja nie powiodła się.", + "minimize_action": "Minimalizuj", + "do_nothing_action": "Nic nie rób", + "exit_action": "Zamknij Launcher", + "on_game_start": "Przy uruchamianiu gry", + "game": "Gra", + "new_password": "Nowe hasło", + "cancel": "Anuluj", + "need_an_account": "Nie masz jeszcze profilu?", + "have_an_account": "Masz już profil?", + "reapply_patch": "Zastosuj patch ponownie", + "failed_to_receive_patches": "Nie udało się odczytać patchy", + "failed_core_patch": "Nieudany patch główny", + "failed_mod_patch": "Nieudany patch modów", + "ok": "OK", + "account_page_denied": "Brak dostępu do strony profilu. Albo nie jesteś zalogowany, albo gra jest uruchomiona.", + "account_updated": "Twój profil został zaktualizowany", + "nickname": "Pseudonim", + "side": "Strona", + "level": "Poziom", + "patching": "Patchowanie", + "file_mismatch_dialog_message": "Suma kontrolna pliku wejściowego nie zgadza się z oczekiwaną sumą kontrolną. Możliwe, że używasz niewłaściwej wersji AKI dla swoich plików klienta.\n\nCzy chcesz kontynuować?", + "yes": "Tak", + "no": "Nie", + "open_folder": "Otwórz folder", + "select_edition": "Wybierz edycję", + "profile_created": "Profil utworzony", + "registration_question_format_1": "Profil '{0}' nie istnieje.\n\nCzy chcesz go utworzyć?", + "next_level_in": "Poziom za", + "wipe_warning": "Zmiana edycji konta wymaga wyczyszczenia profilu. Spowoduje to zresetowanie postępu w grze.", + "copied": "Skopiowane", + "no_profile_data": "Brak danych profilu", + "profile_version_mismath": "Twój profil został utworzony przy użyciu innej wersji aki i może mieć problemy", + "profile_removed": "Profil usunięty", + "profile_removal_failed": "Nie udało się usunąć profilu", + "profile_remove_question_format_1": "Czy na pewno chcesz trwale usunąć profil '{0}'?", + "i_understand": "Rozumiem", + "game_version_mismatch_format_2": "SPT nie może zostać uruchomiony, ponieważ SPT oczekiwał wersji EFT '{1}',\nale zamiast tego znalazł wersję '{0}'\n\nUpewnij się, że zainstalowałeś starszą wersję EFT, zgodnie z instrukcją instalacji\nna stronie, z której pobrałeś SPT", + "description": "Opis", + "server_mods": "Mody serwera", + "profile_mods": "Mody profilu", + "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", + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } \ 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 4520939..a32ed41 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Russian.json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Russian.json @@ -86,5 +86,6 @@ "load_live_settings": "Загрузить настройкий онлайн-версии", "load_live_settings_succeeded": "Настройки игры скопированы из онлайн-версии", "load_live_settings_failed": "Не удалось скопировать настройки онлайн-версии", - "wipe_on_start": "Wipe profile on game start" + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } \ 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 d45eec2..02441f0 100644 --- a/project/Aki.Launcher/Aki_Data/Launcher/Locales/Spanish.json +++ b/project/Aki.Launcher/Aki_Data/Launcher/Locales/Spanish.json @@ -86,5 +86,6 @@ "load_live_settings": "Load Live Settings", "load_live_settings_succeeded": "Game settings copied from live", "load_live_settings_failed": "Failed to copy live settings", - "wipe_on_start": "Wipe profile on game start" + "wipe_on_start": "Wipe profile on game start", + "copy_live_settings_question": "Would you like to copy your live game settings to spt" } \ No newline at end of file diff --git a/project/Aki.Launcher/ViewModels/ProfileViewModel.cs b/project/Aki.Launcher/ViewModels/ProfileViewModel.cs index 0a2f1d4..699545c 100644 --- a/project/Aki.Launcher/ViewModels/ProfileViewModel.cs +++ b/project/Aki.Launcher/ViewModels/ProfileViewModel.cs @@ -64,9 +64,31 @@ namespace Aki.Launcher.ViewModels { this.WhenActivated((CompositeDisposable disposables) => { - Task.Run(() => + Task.Run(async () => { - GameVersionCheck(); + await GameVersionCheck(); + + await Dispatcher.UIThread.InvokeAsync(async () => + { + if (LauncherSettingsProvider.Instance.FirstRun) + { + LauncherSettingsProvider.Instance.FirstRun = false; + + LauncherSettingsProvider.Instance.SaveSettings(); + + var confirmCopySettings = await ShowDialog(new ConfirmationDialogViewModel(Host, + LocalizationProvider.Instance.copy_live_settings_question, + LocalizationProvider.Instance.yes, + LocalizationProvider.Instance.no)); + + if (confirmCopySettings != null && confirmCopySettings is bool confirmed && confirmed) + { + var settingsVM = new SettingsViewModel(Host); + + await settingsVM.ResetGameSettingsCommand(); + } + } + }); }); });