From cec8bd458632912e151b2b427a898b3246d5257f Mon Sep 17 00:00:00 2001 From: Xorus Date: Mon, 5 Feb 2024 20:38:49 +0100 Subject: [PATCH] rename Resources.resx to Strings.resx --- Plugin/Commands/MainCommand.cs | 13 +- Plugin/Commands/SettingsCommand.cs | 5 +- Plugin/EngageTimer.csproj | 21 +- Plugin/Localization/Translator.cs | 16 +- ...ources.Designer.cs => Strings.Designer.cs} | 33 +- .../{Resources.de.resx => Strings.de.resx} | 0 .../{Resources.en.resx => Strings.en.resx} | 413 +++++++++++------- .../{Resources.fr.resx => Strings.fr.resx} | 0 .../{Resources.ja.resx => Strings.ja.resx} | 0 .../{Resources.ko.resx => Strings.ko.resx} | 0 .../{Resources.resx => Strings.resx} | 9 + .../{Resources.zh.resx => Strings.zh.resx} | 0 Plugin/Status/CombatAlarm.cs | 9 +- Plugin/Ui/Components.cs | 3 +- Plugin/Ui/Modal.cs | 8 +- Plugin/Ui/Settings.cs | 15 +- Plugin/Ui/SettingsTab/AlarmsTab.cs | 47 +- Plugin/Ui/SettingsTab/DtrTab.cs | 3 +- Plugin/Ui/SettingsTab/FloatingWindowTab.cs | 23 +- Plugin/Ui/SettingsTab/WebServerTab.cs | 3 +- 20 files changed, 387 insertions(+), 234 deletions(-) rename Plugin/Properties/{Resources.Designer.cs => Strings.Designer.cs} (98%) rename Plugin/Properties/{Resources.de.resx => Strings.de.resx} (100%) rename Plugin/Properties/{Resources.en.resx => Strings.en.resx} (54%) rename Plugin/Properties/{Resources.fr.resx => Strings.fr.resx} (100%) rename Plugin/Properties/{Resources.ja.resx => Strings.ja.resx} (100%) rename Plugin/Properties/{Resources.ko.resx => Strings.ko.resx} (100%) rename Plugin/Properties/{Resources.resx => Strings.resx} (98%) rename Plugin/Properties/{Resources.zh.resx => Strings.zh.resx} (100%) diff --git a/Plugin/Commands/MainCommand.cs b/Plugin/Commands/MainCommand.cs index f577f7f..e3ce7fc 100644 --- a/Plugin/Commands/MainCommand.cs +++ b/Plugin/Commands/MainCommand.cs @@ -16,6 +16,7 @@ using System; using Dalamud.Game.Command; using EngageTimer.Localization; +using EngageTimer.Properties; namespace EngageTimer.Commands; @@ -42,13 +43,13 @@ private void Register() { HelpMessage = "\n" + Tab + Command + " c|countdown [on|off] → " + - $"{Translator.Tr("MainCommand_Help_Countdown")}\n" + + $"{Strings.MainCommand_Help_Countdown}\n" + Tab + Command + " fw [on|off] → " + - $"{Translator.Tr("MainCommand_Help_FW")}\n" + + $"{Strings.MainCommand_Help_FW}\n" + Tab + Command + " dtr [on|off] → " + - $"{Translator.Tr("MainCommand_Help_Dtr")}\n" + + $"{Strings.MainCommand_Help_Dtr}\n" + Tab + Command + " s|settings → " + - $"{Translator.Tr("MainCommand_Help_Settings")}\n" + $"{Strings.MainCommand_Help_Settings}\n" }); } @@ -68,9 +69,9 @@ private static bool ToStatus(string input, bool current) }; } - private string StatusStr(bool value) + private static string StatusStr(bool value) { - return Translator.Tr(value ? "MainCommand_Status_On" : "MainCommand_Status_Off"); + return value ? Strings.MainCommand_Status_On : Strings.MainCommand_Status_Off; } private void OnCommand(string command, string args) diff --git a/Plugin/Commands/SettingsCommand.cs b/Plugin/Commands/SettingsCommand.cs index 862e048..9028be5 100644 --- a/Plugin/Commands/SettingsCommand.cs +++ b/Plugin/Commands/SettingsCommand.cs @@ -15,8 +15,7 @@ using System; using Dalamud.Game.Command; -using EngageTimer.Localization; -using EngageTimer.Ui; +using EngageTimer.Properties; namespace EngageTimer.Commands; @@ -26,7 +25,7 @@ public SettingsCommand() { Plugin.Commands.AddHandler("/egsettings", new CommandInfo(OpenSettingsCommand) { - HelpMessage = Translator.Tr("MainCommand_Help_Settings") + HelpMessage = Strings.MainCommand_Help_Settings }); } diff --git a/Plugin/EngageTimer.csproj b/Plugin/EngageTimer.csproj index d1809a8..75cbbf8 100644 --- a/Plugin/EngageTimer.csproj +++ b/Plugin/EngageTimer.csproj @@ -47,6 +47,21 @@ Always + + Strings.resx + + + Strings.resx + + + Strings.resx + + + Strings.resx + + + Strings.resx + @@ -59,15 +74,15 @@ - + True True - Resources.resx + Strings.resx - + ResXFileCodeGenerator Resources.Designer.cs diff --git a/Plugin/Localization/Translator.cs b/Plugin/Localization/Translator.cs index 1b57eab..d234318 100644 --- a/Plugin/Localization/Translator.cs +++ b/Plugin/Localization/Translator.cs @@ -36,22 +36,21 @@ public static void Unregister() public static string TrId(string id) { - return $"{Resources.ResourceManager.GetString(id, Resources.Culture) ?? id}###EngageTimer_{id}"; + return $"{Strings.ResourceManager.GetString(id, Strings.Culture) ?? id}###EngageTimer_{id}"; } public static string TrId(string id, string fallback) { - return $"{Resources.ResourceManager.GetString(id, Resources.Culture) ?? fallback}###EngageTimer_{id}"; + return $"{Strings.ResourceManager.GetString(id, Strings.Culture) ?? fallback}###EngageTimer_{id}"; } public static string Tr(string id) { - return Resources.ResourceManager.GetString(id, Resources.Culture) ?? id; + return Strings.ResourceManager.GetString(id, Strings.Culture) ?? id; } - public static string Tr(string id, params string[] replacements) + public static string Re(string str, params string[] replacements) { - var str = Tr(id); for (var index = 0; index < replacements.Length; index++) { var value = replacements[index]; @@ -61,6 +60,11 @@ public static string Tr(string id, params string[] replacements) return str; } + public static string Tr(string id, params string[] replacements) + { + return Re(id, replacements); + } + private static void ConfigureLanguage(string? langCode = null) { var lang = (langCode ?? Plugin.PluginInterface.UiLanguage) switch @@ -71,7 +75,7 @@ private static void ConfigureLanguage(string? langCode = null) "zh" => "zh", _ => "en" }; - Resources.Culture = new CultureInfo(lang ?? "en"); + Strings.Culture = new CultureInfo(lang ?? "en"); LocaleChanged?.Invoke(null, EventArgs.Empty); } } \ No newline at end of file diff --git a/Plugin/Properties/Resources.Designer.cs b/Plugin/Properties/Strings.Designer.cs similarity index 98% rename from Plugin/Properties/Resources.Designer.cs rename to Plugin/Properties/Strings.Designer.cs index 11fe5b2..eff3320 100644 --- a/Plugin/Properties/Resources.Designer.cs +++ b/Plugin/Properties/Strings.Designer.cs @@ -21,14 +21,14 @@ namespace EngageTimer.Properties { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { + internal class Strings { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { + internal Strings() { } /// @@ -38,7 +38,7 @@ internal Resources() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EngageTimer.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EngageTimer.Properties.Strings", typeof(Strings).Assembly); resourceMan = temp; } return resourceMan; @@ -266,6 +266,15 @@ internal static string AlarmEdit_Text_Clear { } } + /// + /// Looks up a localized string similar to No text. + /// + internal static string AlarmEdit_Text_NoText { + get { + return ResourceManager.GetString("AlarmEdit_Text_NoText", resourceCulture); + } + } + /// /// Looks up a localized string similar to Test. /// @@ -302,6 +311,15 @@ internal static string AlarmEdit_Text_Type { } } + /// + /// Looks up a localized string similar to Type:. + /// + internal static string AlarmEdit_Text_Type_Colon { + get { + return ResourceManager.GetString("AlarmEdit_Text_Type_Colon", resourceCulture); + } + } + /// /// Looks up a localized string similar to Chat log. /// @@ -500,6 +518,15 @@ internal static string Modal_Ok { } } + /// + /// Looks up a localized string similar to About. + /// + internal static string Settings_AboutTab_Title { + get { + return ResourceManager.GetString("Settings_AboutTab_Title", resourceCulture); + } + } + /// /// Looks up a localized string similar to This page allows you to set alarms based on elapsed combat time.. /// diff --git a/Plugin/Properties/Resources.de.resx b/Plugin/Properties/Strings.de.resx similarity index 100% rename from Plugin/Properties/Resources.de.resx rename to Plugin/Properties/Strings.de.resx diff --git a/Plugin/Properties/Resources.en.resx b/Plugin/Properties/Strings.en.resx similarity index 54% rename from Plugin/Properties/Resources.en.resx rename to Plugin/Properties/Strings.en.resx index ae97266..d4bdc6b 100644 --- a/Plugin/Properties/Resources.en.resx +++ b/Plugin/Properties/Strings.en.resx @@ -1,126 +1,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + text/microsoft-resx - 2.0 + 1.3 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 EngageTimer settings @@ -148,6 +37,7 @@ Sound volume + Displayed next to the "sound volume" slider that appear when the legacy system is enabled. Hide original countdown @@ -156,12 +46,12 @@ Enable accurate countdown mode (countdown - 1) - Uses the actual and precise countdown value instead of the rounded-up value the game originally shows. + Uses the actual and precise countdown value instead of the rounded-up value the game originally shows. I strongly recommend enabling this option when using decimals as they would not make sense otherwise. However, I recommend disabling this if you don't use decimals so that the numbers will match what is displayed for your party members. Note: this setting only works when the original countdown is hidden (otherwise it would display 6 - 5 - 5 - 4...) - + Floating window @@ -277,21 +167,31 @@ Note: this setting only works when the original countdown is hidden (otherwise i FFXIV + Settings_CountdownTab_Texture_default +The FFXIV number style preset name WoW + Settings_CountdownTab_Texture_wow +The wow number style preset name Texture Folder + Settings_CountdownTab_Texture_Custom_Path Load Readable + Settings_CountdownTab_Texture_yellow +The yellow number style preset name Disable test mode + Settings_CountdownTab_Test_Stop +Displays "stop" when the test button is clicked and test mode is enabled. + Enable test mode @@ -318,11 +218,11 @@ Note: this setting only works when the original countdown is hidden (otherwise i Enable animation - X% - + X% + - Y% - + Y% + Countdown offset @@ -336,8 +236,8 @@ Note: this setting only works when the original countdown is hidden (otherwise i Light effect - Warning : when not hiding the original countdown, changing values in this section might create incoherent results - + Warning : when not hiding the original countdown, changing values in this section might create incoherent results + Display combat time in seconds instead of time format @@ -363,63 +263,262 @@ Note: this setting only works when the original countdown is hidden (otherwise i pixels - When using the multi monitor windows option, positioning the countdown outside of the game (even a little bit) will create a background. As rendering transparent windows is impossible outside of the game, this cannot be fixed for now. Please use the border as a guide. - + When using the multi monitor windows option, positioning the countdown outside of the game (even a little bit) will create a background. As rendering transparent windows is impossible outside of the game, this cannot be fixed for now. Please use the border as a guide. + - Alignement - + Alignment + - Center countdown window - + Center countdown window + - Enable Server Info Bar integation - + Enable Server Info Bar integration + - Prefix - + Prefix + - Suffix - + Suffix + - Server Info Bar - + Server Info Bar + - Always hide when not bound by duty - + Always hide when not bound by duty + - Milliseconds to show - + Milliseconds to show + - Hide - + Hide + - seconds after combat end - + seconds after combat end + - Reset to default - + Reset to default + - This option will display the current combat time in the Server Info Bar (right next to the world & time). Please note that you can reorder all integrations in Dalamud Settings. - + This option will display the current combat time in the Server Info Bar (right next to the world & time). Please note that you can reorder all integrations in Dalamud Settings. + - Use duty pop timer sound - + Use duty pop timer sound + - Use legacy audio (breaks linux) - + Use legacy audio (breaks linux) + - Will be removed, please contact me if you use it. Crashes on non-Windows systems. + Will be removed, please contact me if you use it. Crashes on non-Windows systems. + + + enable or disable the big countdown (toggles by default) + help text for the /eg c [on|off] command + + + enable or disable the floating window (toggles by default) + help text for the /eg fw [on|off] command + + + enable or disable the server info bar (toggles by default) + MainCommand_Help_Dtr +help text for the /eg dtr [on|off] command + + + open the settings menu + MainCommand_Help_Settings +help text for the /eg settings command + + + Countdown is now {0} + {0} is the translation MainCommand_Status_On or MainCommand_Status_Off + + + + enabled + For use in success sentences "Countdown is now enabled" + + + disabled + For use in success sentences "Countdown is now disabled" + + + Server info bar is now {0} + + + Floating window is now {0} + + + Unrecognized subcommand: {0} + MainCommand_Error_InvalidSubcommand +{0} is the un recognized command name + + + + Unrecognized argument for {0}: {1} + MainCommand_Error_InvalidArgument +{0} is the command name (countdown, c, fw, settings, ...) +{1} is the unrecognized argument typed + + + Enable pre-pull warning - - This setting determines at what point during the countdown the timer will become visible. For example, if the value is set to 7, the countdown timer will not be shown until 7 seconds have passed, and will then be displayed until the end of the countdown. + + Changes the countdown color when casting a spell that would result in a pre-pull. + + + Offset in seconds + + + Leave at 0 unless you have very consistent lag or some specific reason. Display threshold + + This setting determines at what point during the countdown the timer will become visible. For example, if the value is set to 7, the countdown timer will not be shown until 7 seconds have passed, and will then be displayed until the end of the countdown. + - Start ticking from + Start playing from This setting will make it so the sound plays from numbers 5 to the selected value. Note: this plugin cannot remove the tick sound for numbers 1-5. + + Alarms + + + Active + + + Start time + + + Color + + + Blink + + + Duration + + + Sound + + + None + + + Text + + + Dalamud Notification + + + Game toast + + + Chat log + + + Enables / disables this alarm + + + The alarm will start at this specified combat time + + + Applies the color to the floating window stopwatch during the alarm + + + Makes the floating window stopwatch blink during the alarm + + + Stops the color/blink after this amount of time + + + Plays a game sound effect at the alarm time + + + Allows you to display a text notification at the alarm time + + + Type + + + Text + + + Clear + + + This page allows you to set alarms based on elapsed combat time. + + + A common use is to notify you of the potion window. + + + Create new + + + Clear all + + + Do you really want to remove all the alarms? + + + Export + + + Import + + + Test + + + Exports the active alarms to a file + + + Select file to import + + + Select file to export + + + OK + + + Cancel + + + Confirm + + + Could not save the file in this directory (access denied). Please try again with another directory. + + + An error occured while trying to save the alarms to {0}: {1}. + + + An error occured while trying to read the alarms in {0}: {1}. + + + The alarms file format is incompatible or incorrect + + + An empty or invalid alarm list was imported + + + Draw even if original countdown is visible + + + Allows you to have the vanilla countdown showing on your game but still use the custom one in a corner or overlaping if you like chaos. Useful if you setup your OBS to not capture addons and want to look unmodified. + + + Don't overlap with game countdown (default) + + + Hides the custom countdown under 5 to prevent overlapping with the vanilla one. + + + About + \ No newline at end of file diff --git a/Plugin/Properties/Resources.fr.resx b/Plugin/Properties/Strings.fr.resx similarity index 100% rename from Plugin/Properties/Resources.fr.resx rename to Plugin/Properties/Strings.fr.resx diff --git a/Plugin/Properties/Resources.ja.resx b/Plugin/Properties/Strings.ja.resx similarity index 100% rename from Plugin/Properties/Resources.ja.resx rename to Plugin/Properties/Strings.ja.resx diff --git a/Plugin/Properties/Resources.ko.resx b/Plugin/Properties/Strings.ko.resx similarity index 100% rename from Plugin/Properties/Resources.ko.resx rename to Plugin/Properties/Strings.ko.resx diff --git a/Plugin/Properties/Resources.resx b/Plugin/Properties/Strings.resx similarity index 98% rename from Plugin/Properties/Resources.resx rename to Plugin/Properties/Strings.resx index 05983f1..a8d7f01 100644 --- a/Plugin/Properties/Resources.resx +++ b/Plugin/Properties/Strings.resx @@ -551,6 +551,12 @@ help text for the /eg settings command Allows you to display a text notification at the alarm time + + Type: + + + No text + Type @@ -629,4 +635,7 @@ help text for the /eg settings command Hides the custom countdown under 5 to prevent overlapping with the vanilla one. + + About + \ No newline at end of file diff --git a/Plugin/Properties/Resources.zh.resx b/Plugin/Properties/Strings.zh.resx similarity index 100% rename from Plugin/Properties/Resources.zh.resx rename to Plugin/Properties/Strings.zh.resx diff --git a/Plugin/Status/CombatAlarm.cs b/Plugin/Status/CombatAlarm.cs index 1a5dd77..b9bd796 100644 --- a/Plugin/Status/CombatAlarm.cs +++ b/Plugin/Status/CombatAlarm.cs @@ -23,8 +23,11 @@ using EngageTimer.Configuration; using EngageTimer.Game; using EngageTimer.Localization; +using EngageTimer.Properties; using EngageTimer.Ui; +using Microsoft.VisualBasic; using Newtonsoft.Json; +using Strings = EngageTimer.Properties.Strings; namespace EngageTimer.Status; @@ -66,7 +69,7 @@ public CombatAlarm() // using "TypeNameHandling.Objects" causes a "resolving to a collectible assembly is not supported" TypeNameHandling = TypeNameHandling.None }); - if (data == null || data.Count == 0) return Translator.Tr("CombatAlarm_ImportedEmpty"); + if (data == null || data.Count == 0) return Strings.CombatAlarm_ImportedEmpty; Plugin.Config.CombatAlarms.Alarms.AddRange(data); } catch (JsonSerializationException e) @@ -77,7 +80,7 @@ public CombatAlarm() catch (Exception e) { Plugin.Logger.Error(e, $"Could not read file {fileName}"); - return Translator.Tr("CombatAlarm_ReadGeneric", fileName, e.Message); + return Translator.Re(Strings.CombatAlarm_ReadGeneric, fileName, e.Message); } return null; @@ -97,7 +100,7 @@ public CombatAlarm() } catch (UnauthorizedAccessException) { - return Translator.Tr("CombatAlarm_AccessDenied"); + return Strings.CombatAlarm_AccessDenied; } catch (Exception e) { diff --git a/Plugin/Ui/Components.cs b/Plugin/Ui/Components.cs index 5060353..e29db8b 100644 --- a/Plugin/Ui/Components.cs +++ b/Plugin/Ui/Components.cs @@ -21,6 +21,7 @@ using Dalamud.Interface.Components; using EngageTimer.Attributes; using EngageTimer.Localization; +using EngageTimer.Properties; using ImGuiNET; namespace EngageTimer.Ui; @@ -69,7 +70,7 @@ public static void IconButton(FontAwesomeIcon icon, string id, ApplyCallback app public static void Text(string label, bool sameLine = false) { if (sameLine) ImGui.SameLine(); - ImGui.Text(Translator.Tr("Settings_FWTab_TextColor")); + ImGui.Text(label); } public static void ResettableDraggable(string id, string label, int original, int defaultValue, diff --git a/Plugin/Ui/Modal.cs b/Plugin/Ui/Modal.cs index 2c3503d..57fe5df 100644 --- a/Plugin/Ui/Modal.cs +++ b/Plugin/Ui/Modal.cs @@ -15,7 +15,7 @@ using System; using System.Numerics; -using EngageTimer.Localization; +using EngageTimer.Properties; using ImGuiNET; namespace EngageTimer.Ui; @@ -41,16 +41,16 @@ public void Draw() if (_validate != null) { - if (ImGui.Button(Translator.Tr("Modal_Cancel"), new Vector2(120, 0))) + if (ImGui.Button(Strings.Modal_Cancel, new Vector2(120, 0))) ImGui.CloseCurrentPopup(); ImGui.SameLine(); - if (ImGui.Button(Translator.Tr("Modal_Confirm"), new Vector2(120, 0))) + if (ImGui.Button(Strings.Modal_Confirm, new Vector2(120, 0))) { ImGui.CloseCurrentPopup(); _validate(); } } - else if (ImGui.Button(Translator.Tr("Modal_Ok"), new Vector2(120, 0))) + else if (ImGui.Button(Strings.Modal_Ok, new Vector2(120, 0))) ImGui.CloseCurrentPopup(); ImGui.EndPopup(); diff --git a/Plugin/Ui/Settings.cs b/Plugin/Ui/Settings.cs index 0fcfdd3..f0c98d5 100644 --- a/Plugin/Ui/Settings.cs +++ b/Plugin/Ui/Settings.cs @@ -13,20 +13,11 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -using System; -using System.Diagnostics; -using System.Linq; -using System.Numerics; -using Dalamud.Interface; -using Dalamud.Interface.Colors; -using Dalamud.Interface.Components; using Dalamud.Interface.Windowing; -using EngageTimer.Configuration; using EngageTimer.Localization; -using EngageTimer.Ui.Color; +using EngageTimer.Properties; using EngageTimer.Ui.SettingsTab; using ImGuiNET; -using JetBrains.Annotations; namespace EngageTimer.Ui; @@ -48,7 +39,7 @@ public override void OnClose() private void UpdateWindowName() { - WindowName = Translator.TrId("Settings_Title"); + WindowName = Strings.Settings_Title; } public override void Draw() @@ -89,7 +80,7 @@ public override void Draw() ImGui.EndTabItem(); } - if (ImGui.BeginTabItem("About")) + if (ImGui.BeginTabItem(Translator.TrId("Settings_AboutTab_Title"))) { AboutTab.Draw(); ImGui.EndTabItem(); diff --git a/Plugin/Ui/SettingsTab/AlarmsTab.cs b/Plugin/Ui/SettingsTab/AlarmsTab.cs index 538ef63..8bc5116 100644 --- a/Plugin/Ui/SettingsTab/AlarmsTab.cs +++ b/Plugin/Ui/SettingsTab/AlarmsTab.cs @@ -20,6 +20,7 @@ using Dalamud.Interface.ImGuiFileDialog; using EngageTimer.Configuration; using EngageTimer.Localization; +using EngageTimer.Properties; using EngageTimer.Status; using ImGuiNET; @@ -47,8 +48,8 @@ private static void Header(bool tooltip = false) public static void Draw() { - ImGui.Text(Translator.Tr("Settings_AlarmsTab_Line1")); - ImGui.Text(Translator.Tr("Settings_AlarmsTab_Line2")); + ImGui.Text(Strings.Settings_AlarmsTab_Line1); + ImGui.Text(Strings.Settings_AlarmsTab_Line2); ImGui.Separator(); if (ImGui.BeginTable("alarms", 8, ImGuiTableFlags.Borders)) @@ -88,10 +89,10 @@ public static void Draw() Components.LeftRight("buttons", () => { - if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.FileImport, Translator.Tr("AlarmEdit_Import"))) + if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.FileImport, Strings.AlarmEdit_Import)) { Fdm.OpenFileDialog( - Translator.Tr("AlarmEdit_Import_File"), + Strings.AlarmEdit_Import_File, ".json", (ok, path) => { @@ -110,10 +111,10 @@ public static void Draw() ImGui.SameLine(); - if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.FileExport, Translator.Tr("AlarmEdit_Export"))) + if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.FileExport, Strings.AlarmEdit_Export)) { Fdm.SaveFileDialog( - Translator.Tr("AlarmEdit_Export_File"), + Strings.AlarmEdit_Export_File, ".json", "EngageTimerAlarms.json", "json", @@ -133,18 +134,18 @@ public static void Draw() ); } - Components.TooltipOnItemHovered("AlarmEdit_Export_Tooltip"); + Components.TooltipOnItemHovered(Strings.AlarmEdit_Export_Tooltip); ImGui.SameLine(); // clear all button - if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, Translator.Tr("AlarmEdit_Clear"))) + if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, Strings.AlarmEdit_Clear)) { if (Plugin.Config.CombatAlarms.Alarms.Count == 0) return; _openConfirmClear = true; } }, () => { - if (!ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, Translator.Tr("AlarmEdit_Add"))) return; + if (!ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, Strings.AlarmEdit_Add)) return; Plugin.Config.CombatAlarms.Alarms.Add(new CombatAlarmsConfiguration.Alarm()); Plugin.Config.Save(); }); @@ -152,7 +153,7 @@ public static void Draw() if (_openConfirmClear) { _openConfirmClear = false; - Modal.Confirm(Translator.Tr("AlarmEdit_Clear_Confirm"), () => + Modal.Confirm(Strings.AlarmEdit_Clear_Confirm, () => { Plugin.Config.CombatAlarms.Alarms.Clear(); Plugin.Config.Save(); @@ -194,7 +195,7 @@ private static void AlarmElement(int index, CombatAlarmsConfiguration.Alarm alar ImGui.TableNextColumn(); var color = alarm.Color ?? Plugin.Config.FloatingWindow.TextColor; var newValue = - ImGuiComponents.ColorPickerWithPalette(3111, Translator.Tr("AlarmEdit_Color_Tooltip"), color); + ImGuiComponents.ColorPickerWithPalette(3111, Strings.AlarmEdit_Color_Tooltip, color); if (color != newValue) { alarm.Color = newValue; @@ -232,7 +233,7 @@ private static void AlarmElement(int index, CombatAlarmsConfiguration.Alarm alar ImGui.TableNextColumn(); ImGui.PushItemWidth(80f); var choice = alarm.Sfx ?? 0; - if (ImGui.Combo("###sfx", ref choice, Translator.Tr("AlarmEdit_Sound_None") + + if (ImGui.Combo("###sfx", ref choice, Strings.AlarmEdit_Sound_None + "\0\0\0\0\0" + "\0\0\0\0\0\0\0\0" + "\0\0\0\0")) @@ -249,16 +250,16 @@ private static void AlarmElement(int index, CombatAlarmsConfiguration.Alarm alar { var type = (int) alarm.TextType; ImGui.PushItemWidth(150f); - if (ImGui.Combo("Type", ref type, Translator.Tr("AlarmEdit_Type_ChatLog") + "\0" - + Translator.Tr("AlarmEdit_Type_DalamudNotification") + "\0" - + Translator.Tr("AlarmEdit_Type_GameToast") + "\0")) + if (ImGui.Combo("Type", ref type, Strings.AlarmEdit_Type_ChatLog + "\0" + + Strings.AlarmEdit_Type_DalamudNotification + "\0" + + Strings.AlarmEdit_Type_GameToast + "\0")) { alarm.TextType = (CombatAlarmsConfiguration.TextType) type; Plugin.Config.Save(); } var text = alarm.Text ?? ""; - if (ImGui.InputText(Translator.Tr("AlarmEdit_Text_Text"), ref text, 100)) + if (ImGui.InputText(Strings.AlarmEdit_Text_Text, ref text, 100)) { text = text.Trim(); alarm.Text = text.Length == 0 ? null : text; @@ -267,13 +268,13 @@ private static void AlarmElement(int index, CombatAlarmsConfiguration.Alarm alar ImGui.PopItemWidth(); - if (ImGui.Button(Translator.Tr("AlarmEdit_Text_Test"))) + if (ImGui.Button(Strings.AlarmEdit_Text_Test)) { CombatAlarm.AlarmText(alarm); } ImGui.SameLine(); - if (ImGui.Button(Translator.Tr("AlarmEdit_Text_Clear"))) + if (ImGui.Button(Strings.AlarmEdit_Text_Clear)) { alarm.Text = null; Plugin.Config.Save(); @@ -291,22 +292,22 @@ private static void AlarmElement(int index, CombatAlarmsConfiguration.Alarm alar { if (alarm.Text == null) { - ImGui.Text("No text"); + ImGui.Text(Strings.AlarmEdit_Text_NoText); } else { - ImGui.Text("Type: "); + ImGui.Text(Strings.AlarmEdit_Text_Type_Colon); ImGui.SameLine(); switch (alarm.TextType) { case CombatAlarmsConfiguration.TextType.DalamudNotification: - ImGui.Text("Dalamud notification"); + ImGui.Text(Strings.AlarmEdit_Type_DalamudNotification); break; case CombatAlarmsConfiguration.TextType.GameToast: - ImGui.Text("Toast"); + ImGui.Text(Strings.AlarmEdit_Type_GameToast); break; case CombatAlarmsConfiguration.TextType.ChatLogMessage: - ImGui.Text("Log message"); + ImGui.Text(Strings.AlarmEdit_Type_ChatLog); break; } diff --git a/Plugin/Ui/SettingsTab/DtrTab.cs b/Plugin/Ui/SettingsTab/DtrTab.cs index ccc540f..2188d46 100644 --- a/Plugin/Ui/SettingsTab/DtrTab.cs +++ b/Plugin/Ui/SettingsTab/DtrTab.cs @@ -15,6 +15,7 @@ using EngageTimer.Configuration; using EngageTimer.Localization; +using EngageTimer.Properties; using ImGuiNET; namespace EngageTimer.Ui.SettingsTab; @@ -24,7 +25,7 @@ public static class DtrTab public static void Draw() { ImGui.PushTextWrapPos(); - ImGui.Text(Translator.Tr("Settings_DtrTab_Info")); + ImGui.Text(Strings.Settings_DtrTab_Info); ImGui.PopTextWrapPos(); ImGui.Separator(); diff --git a/Plugin/Ui/SettingsTab/FloatingWindowTab.cs b/Plugin/Ui/SettingsTab/FloatingWindowTab.cs index 6cb54d4..d0aec22 100644 --- a/Plugin/Ui/SettingsTab/FloatingWindowTab.cs +++ b/Plugin/Ui/SettingsTab/FloatingWindowTab.cs @@ -17,6 +17,7 @@ using Dalamud.Interface.Components; using EngageTimer.Configuration; using EngageTimer.Localization; +using EngageTimer.Properties; using ImGuiNET; namespace EngageTimer.Ui.SettingsTab; @@ -26,13 +27,13 @@ public static class FloatingWindowTab public static void Draw() { ImGui.PushTextWrapPos(); - ImGui.Text(Translator.Tr("Settings_FWTab_Help")); + ImGui.Text(Strings.Settings_FWTab_Help); ImGui.PopTextWrapPos(); ImGui.Separator(); Components.AutoField(Plugin.Config.FloatingWindow, "Display"); Components.AutoField(Plugin.Config.FloatingWindow, "Lock"); - ImGuiComponents.HelpMarker(Translator.Tr("Settings_FWTab_Lock_Help")); + ImGuiComponents.HelpMarker(Strings.Settings_FWTab_Lock_Help); Components.AutoField(Plugin.Config.FloatingWindow, "AutoHide"); Components.AutoField(Plugin.Config.FloatingWindow, "AutoHideTimeout", sameLine: true); @@ -50,22 +51,22 @@ public static void Draw() ImGui.Separator(); Components.AutoField(Plugin.Config.FloatingWindow, "AccurateMode"); - ImGuiComponents.HelpMarker(Translator.Tr("Settings_FWTab_AccurateCountdown_Help")); + ImGuiComponents.HelpMarker(Strings.Settings_FWTab_AccurateCountdown_Help); Components.AutoField(Plugin.Config.FloatingWindow, "StopwatchOnlyInDuty"); - ImGuiComponents.HelpMarker(Translator.Tr("Settings_FWTab_DisplayStopwatchOnlyInDuty_Help")); + ImGuiComponents.HelpMarker(Strings.Settings_FWTab_DisplayStopwatchOnlyInDuty_Help); Components.AutoField(Plugin.Config.FloatingWindow, "CountdownNegativeSign"); Components.AutoField(Plugin.Config.FloatingWindow, "StopwatchAsSeconds"); Components.AutoField(Plugin.Config.FloatingWindow, "ShowPrePulling"); - ImGuiComponents.HelpMarker(Translator.Tr("Settings_FWTab_ShowPrePulling_Help")); + ImGuiComponents.HelpMarker(Strings.Settings_FWTab_ShowPrePulling_Help); if (!Plugin.Config.FloatingWindow.ShowPrePulling) return; ImGui.Indent(); ImGui.PushItemWidth(110f); Components.AutoField(Plugin.Config.FloatingWindow, "PrePullOffset"); ImGui.PopItemWidth(); - ImGuiComponents.HelpMarker(Translator.Tr("Settings_FWTab_PrePullOffset_Help")); + ImGuiComponents.HelpMarker(Strings.Settings_FWTab_PrePullOffset_Help); Components.AutoField(Plugin.Config.FloatingWindow, "PrePullColor"); @@ -80,13 +81,13 @@ private static void FwStyling() Components.AutoField(Plugin.Config.FloatingWindow, "Scale"); var configuration = Plugin.Config; - var textAlign = (int)configuration.FloatingWindow.Align; + var textAlign = (int) configuration.FloatingWindow.Align; if (ImGui.Combo(Translator.TrId("Settings_FWTab_TextAlign"), ref textAlign, - Translator.Tr("Settings_FWTab_TextAlign_Left") + "###Left\0" + - Translator.Tr("Settings_FWTab_TextAlign_Center") + "###Center\0" + - Translator.Tr("Settings_FWTab_TextAlign_Right") + "###Right")) + Strings.Settings_FWTab_TextAlign_Left + "###Left\0" + + Strings.Settings_FWTab_TextAlign_Center + "###Center\0" + + Strings.Settings_FWTab_TextAlign_Right + "###Right")) { - configuration.FloatingWindow.Align = (ConfigurationFile.TextAlign)textAlign; + configuration.FloatingWindow.Align = (ConfigurationFile.TextAlign) textAlign; configuration.Save(); } diff --git a/Plugin/Ui/SettingsTab/WebServerTab.cs b/Plugin/Ui/SettingsTab/WebServerTab.cs index d6d3bcb..cdf8ee4 100644 --- a/Plugin/Ui/SettingsTab/WebServerTab.cs +++ b/Plugin/Ui/SettingsTab/WebServerTab.cs @@ -16,6 +16,7 @@ using Dalamud.Interface; using Dalamud.Interface.Components; using EngageTimer.Localization; +using EngageTimer.Properties; using ImGuiNET; namespace EngageTimer.Ui.SettingsTab; @@ -32,7 +33,7 @@ public static void Draw() if (ImGuiComponents.IconButton(FontAwesomeIcon.Copy)) ImGui.SetClipboardText($"http://localhost:{Plugin.Config.WebServer.Port}/"); - ImGui.Text(Translator.Tr("Settings_Web_HelpSize")); + ImGui.Text(Strings.Settings_Web_HelpSize); ImGui.PopTextWrapPos(); ImGui.Separator();