From 12de110b04091cd2c02e2f89ee9242bf7fd5afa1 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sat, 11 Feb 2023 14:40:22 +0100 Subject: [PATCH] Update config tab names to include stable ids, add more localizable text --- .../Properties/Localization.Designer.cs | 18 +++++++++++++++++ Pal.Client/Properties/Localization.resx | 8 ++++++++ Pal.Client/Windows/ConfigWindow.cs | 20 +++++++++---------- Pal.Client/Windows/StatisticsWindow.cs | 2 +- 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/Pal.Client/Properties/Localization.Designer.cs b/Pal.Client/Properties/Localization.Designer.cs index 396182b..88f71bb 100644 --- a/Pal.Client/Properties/Localization.Designer.cs +++ b/Pal.Client/Properties/Localization.Designer.cs @@ -320,6 +320,15 @@ namespace Pal.Client.Properties { } } + /// + /// Looks up a localized string similar to Path to *.pal file. + /// + internal static string Config_SelectImportFile_Hint { + get { + return ResourceManager.GetString("Config_SelectImportFile_Hint", resourceCulture); + } + } + /// /// Looks up a localized string similar to Select which render backend to use for markers:. /// @@ -411,6 +420,15 @@ namespace Pal.Client.Properties { } } + /// + /// Looks up a localized string similar to Testing.... + /// + internal static string Config_TestConnection_Connecting { + get { + return ResourceManager.GetString("Config_TestConnection_Connecting", resourceCulture); + } + } + /// /// Looks up a localized string similar to Trap color. /// diff --git a/Pal.Client/Properties/Localization.resx b/Pal.Client/Properties/Localization.resx index b5c3045..a7f5121 100644 --- a/Pal.Client/Properties/Localization.resx +++ b/Pal.Client/Properties/Localization.resx @@ -159,6 +159,10 @@ This is not synchronized with other players and not saved between floors/runs. Test Connection + + Testing... + When clicking on the 'Test Connection' button, this is shown until a success/error message is available. + Import @@ -181,6 +185,10 @@ This is not synchronized with other players and not saved between floors/runs. File to Import: + + Path to *.pal file + When importing a file, this is the hint that shows up in the 'path' input box while no file has been selected. + Start Import diff --git a/Pal.Client/Windows/ConfigWindow.cs b/Pal.Client/Windows/ConfigWindow.cs index 8681c71..614123e 100644 --- a/Pal.Client/Windows/ConfigWindow.cs +++ b/Pal.Client/Windows/ConfigWindow.cs @@ -49,7 +49,7 @@ namespace Pal.Client.Windows public ConfigWindow() : base(WindowId) { LanguageChanged(); - + Size = new Vector2(500, 400); SizeCondition = ImGuiCond.FirstUseEver; Position = new Vector2(300, 300); @@ -129,7 +129,7 @@ namespace Pal.Client.Windows private void DrawDeepDungeonItemsTab(ref bool save, ref bool saveAndClose) { - if (ImGui.BeginTabItem(Localization.ConfigTab_DeepDungeons)) + if (ImGui.BeginTabItem($"{Localization.ConfigTab_DeepDungeons}###TabDeepDungeons")) { ImGui.Checkbox(Localization.Config_Traps_Show, ref _showTraps); ImGui.Indent(); @@ -179,7 +179,7 @@ namespace Pal.Client.Windows private void DrawCommunityTab(ref bool saveAndClose) { - if (BeginTabItemEx(Localization.ConfigTab_Community, _switchToCommunityTab ? ImGuiTabItemFlags.SetSelected : ImGuiTabItemFlags.None)) + if (BeginTabItemEx($"{Localization.ConfigTab_Community}###TabCommunity", _switchToCommunityTab ? ImGuiTabItemFlags.SetSelected : ImGuiTabItemFlags.None)) { _switchToCommunityTab = false; @@ -206,7 +206,7 @@ namespace Pal.Client.Windows private void DrawImportTab() { - if (ImGui.BeginTabItem(Localization.ConfigTab_Import)) + if (ImGui.BeginTabItem($"{Localization.ConfigTab_Import}###TabImport")) { ImGui.TextWrapped(Localization.Config_ImportExplanation1); ImGui.TextWrapped(Localization.Config_ImportExplanation2); @@ -218,7 +218,7 @@ namespace Pal.Client.Windows ImGui.Separator(); ImGui.Text(Localization.Config_SelectImportFile); ImGui.SameLine(); - ImGui.InputTextWithHint("", "Path to *.pal file", ref _openImportPath, 260); + ImGui.InputTextWithHint("", Localization.Config_SelectImportFile_Hint, ref _openImportPath, 260); ImGui.SameLine(); if (ImGuiComponents.IconButton(FontAwesomeIcon.Search)) { @@ -253,7 +253,7 @@ namespace Pal.Client.Windows private void DrawExportTab() { - if (Service.RemoteApi.HasRoleOnCurrentServer("export:run") && ImGui.BeginTabItem(Localization.ConfigTab_Export)) + if (Service.RemoteApi.HasRoleOnCurrentServer("export:run") && ImGui.BeginTabItem($"{Localization.ConfigTab_Export}###TabExport")) { string todaysFileName = $"export-{DateTime.Today:yyyy-MM-dd}.pal"; if (string.IsNullOrEmpty(_saveExportPath) && !string.IsNullOrEmpty(_saveExportDialogStartPath)) @@ -262,7 +262,7 @@ namespace Pal.Client.Windows ImGui.TextWrapped(string.Format(Localization.Config_ExportSource, RemoteApi.RemoteUrl)); ImGui.Text(Localization.Config_Export_SaveAs); ImGui.SameLine(); - ImGui.InputTextWithHint("", "Path to *.pal file", ref _saveExportPath, 260); + ImGui.InputTextWithHint("", Localization.Config_SelectImportFile_Hint, ref _saveExportPath, 260); ImGui.SameLine(); if (ImGuiComponents.IconButton(FontAwesomeIcon.Search)) { @@ -287,7 +287,7 @@ namespace Pal.Client.Windows private void DrawRenderTab(ref bool save, ref bool saveAndClose) { - if (ImGui.BeginTabItem(Localization.ConfigTab_Renderer)) + if (ImGui.BeginTabItem($"{Localization.ConfigTab_Renderer}###TabRenderer")) { ImGui.Text(Localization.Config_SelectRenderBackend); ImGui.RadioButton($"{Localization.Config_Renderer_Splatoon} ({Localization.Config_Renderer_Splatoon_Hint})", ref _renderer, (int)Configuration.ERenderer.Splatoon); @@ -312,7 +312,7 @@ namespace Pal.Client.Windows private void DrawDebugTab() { - if (ImGui.BeginTabItem(Localization.ConfigTab_Debug)) + if (ImGui.BeginTabItem($"{Localization.ConfigTab_Debug}###TabDebug")) { var plugin = Service.Plugin; if (plugin.IsInDeepDungeon()) @@ -374,7 +374,7 @@ namespace Pal.Client.Windows { Task.Run(async () => { - _connectionText = "Testing..."; + _connectionText = Localization.Config_TestConnection_Connecting; _switchToCommunityTab = true; CancellationTokenSource cts = new CancellationTokenSource(); diff --git a/Pal.Client/Windows/StatisticsWindow.cs b/Pal.Client/Windows/StatisticsWindow.cs index 264640d..e9545d8 100644 --- a/Pal.Client/Windows/StatisticsWindow.cs +++ b/Pal.Client/Windows/StatisticsWindow.cs @@ -22,7 +22,7 @@ namespace Pal.Client.Windows public StatisticsWindow() : base(WindowId) { LanguageChanged(); - + Size = new Vector2(500, 500); SizeCondition = ImGuiCond.FirstUseEver; Flags = ImGuiWindowFlags.AlwaysAutoResize;