diff --git a/project/SPT.Launcher.Base/Helpers/LocalizationProvider.cs b/project/SPT.Launcher.Base/Helpers/LocalizationProvider.cs index dfcd9db..411ed46 100644 --- a/project/SPT.Launcher.Base/Helpers/LocalizationProvider.cs +++ b/project/SPT.Launcher.Base/Helpers/LocalizationProvider.cs @@ -192,6 +192,7 @@ namespace SPT.Launcher.Helpers englishLocale.open_link = "Open Link"; englishLocale.dev_mode = "Developer Mode"; englishLocale.failed_to_save_settings = "Failed to save settings"; + englishLocale.register_failed_name_limit = "name cannot exceed 15 characters"; #endregion Directory.CreateDirectory(LocalizationProvider.DefaultLocaleFolderPath); @@ -228,6 +229,24 @@ namespace SPT.Launcher.Helpers #region All Properties + #region register_failed_name_limit + + private string _register_failed_name_limit; + + public string register_failed_name_limit + { + get => _register_failed_name_limit; + set + { + if (_register_failed_name_limit != value) + { + _register_failed_name_limit = value; + RaisePropertyChanged(nameof(register_failed_name_limit)); + } + } + } + #endregion + #region failed_to_save_settings private string _failed_to_save_settings; diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Simplified).json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Simplified).json index 5994d1b..745fe4f 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Simplified).json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Simplified).json @@ -95,5 +95,6 @@ "open_link_question_format_1": "Are you sure you want to open the following link: \n{0}", "open_link": "Open Link", "dev_mode": "Developer Mode", - "failed_to_save_settings": "Failed to save settings" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Traditional).json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Traditional).json index d94169b..3a65e09 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Traditional).json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Chinese (Traditional).json @@ -95,5 +95,6 @@ "open_link_question_format_1": "Are you sure you want to open the following link: \n{0}", "open_link": "Open Link", "dev_mode": "Developer Mode", - "failed_to_save_settings": "Failed to save settings" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } \ No newline at end of file diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/English.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/English.json index cac4382..7d5ea4e 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/English.json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/English.json @@ -96,5 +96,6 @@ "open_link": "Open Link", "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" + "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" } \ No newline at end of file diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/French.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/French.json index 5cbc72c..e4841f6 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/French.json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/French.json @@ -95,5 +95,6 @@ "open_link_question_format_1": "Are you sure you want to open the following link: \n{0}", "open_link": "Open Link", "dev_mode": "Developer Mode", - "failed_to_save_settings": "Failed to save settings" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } \ No newline at end of file diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/German.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/German.json index b168d6a..5bcec18 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/German.json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/German.json @@ -95,5 +95,6 @@ "open_link_question_format_1": "Are you sure you want to open the following link: \n{0}", "open_link": "Open Link", "dev_mode": "Developer Mode", - "failed_to_save_settings": "Failed to save settings" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } \ No newline at end of file diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Italian.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Italian.json index 6673693..a5022fc 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Italian.json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Italian.json @@ -95,5 +95,6 @@ "open_link_question_format_1": "Are you sure you want to open the following link: \n{0}", "open_link": "Open Link", "dev_mode": "Developer Mode", - "failed_to_save_settings": "Failed to save settings" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } \ No newline at end of file diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Japanese.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Japanese.json index fa5ed8f..c559182 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Japanese.json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Japanese.json @@ -95,5 +95,6 @@ "open_link_question_format_1": "Are you sure you want to open the following link: \n{0}", "open_link": "Open Link", "dev_mode": "Developer Mode", - "failed_to_save_settings": "Failed to save settings" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } \ No newline at end of file diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Korean.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Korean.json index 0b8bbf5..f0a50d2 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Korean.json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Korean.json @@ -95,5 +95,6 @@ "open_link_question_format_1": "Are you sure you want to open the following link: \n{0}", "open_link": "Open Link", "dev_mode": "Developer Mode", - "failed_to_save_settings": "Failed to save settings" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } \ No newline at end of file diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Polish.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Polish.json index e08485e..8c36d78 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Polish.json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Polish.json @@ -95,5 +95,6 @@ "open_link_question_format_1": "Are you sure you want to open the following link: \n{0}", "open_link": "Open Link", "dev_mode": "Tryb Dewelopera", - "failed_to_save_settings": "Failed to save settings" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } \ No newline at end of file diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Russian.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Russian.json index 0e51916..0b9c5bc 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Russian.json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Russian.json @@ -95,5 +95,6 @@ "open_link_question_format_1": "Вы уверены, что хотите открыть следующую ссылку? \n{0}", "open_link": "Открыть ссылку", "dev_mode": "Developer Mode", - "failed_to_save_settings": "Failed to save settings" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } \ No newline at end of file diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Spanish.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Spanish.json index 04d5f24..7cee140 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Spanish.json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Spanish.json @@ -95,5 +95,6 @@ "open_link_question_format_1": "Are you sure you want to open the following link: \n{0}", "open_link": "Open Link", "dev_mode": "Developer Mode", - "failed_to_save_settings": "Failed to save settings" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } \ No newline at end of file diff --git a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Turkish.json b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Turkish.json index 669c189..9f0c0a9 100644 --- a/project/SPT.Launcher/SPT_Data/Launcher/Locales/Turkish.json +++ b/project/SPT.Launcher/SPT_Data/Launcher/Locales/Turkish.json @@ -95,5 +95,6 @@ "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" + "failed_to_save_settings": "Failed to save settings", + "register_failed_name_limit": "name cannot exceed 15 characters" } \ No newline at end of file diff --git a/project/SPT.Launcher/ViewModels/LoginViewModel.cs b/project/SPT.Launcher/ViewModels/LoginViewModel.cs index 8376008..49a033b 100644 --- a/project/SPT.Launcher/ViewModels/LoginViewModel.cs +++ b/project/SPT.Launcher/ViewModels/LoginViewModel.cs @@ -49,6 +49,12 @@ namespace SPT.Launcher.ViewModels // Create account if it doesn't exist if (!string.IsNullOrWhiteSpace(Login.Username)) { + if (Login.Username.Length > 15) + { + SendNotification(LocalizationProvider.Instance.registration_failed, LocalizationProvider.Instance.register_failed_name_limit, NotificationType.Error); + return; + } + var result = await ShowDialog(new RegisterDialogViewModel(null, Login.Username)); if (result != null && result is SPTEdition edition)