From 4e7fefc836214001e2495ff909e3794541dd5849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Sun, 22 Jan 2023 19:06:43 +0800 Subject: [PATCH] fix: changed the param tab layout. --- RotationSolver/Localization/Localization.json | 12 +-- RotationSolver/Localization/Strings.cs | 12 +-- .../Windows/RotationConfigWindow_Param.cs | 92 ++++++++----------- .../Windows/RotationConfigWindow_Rotation.cs | 4 +- 4 files changed, 50 insertions(+), 70 deletions(-) diff --git a/RotationSolver/Localization/Localization.json b/RotationSolver/Localization/Localization.json index 7fd1c6249..8230dc643 100644 --- a/RotationSolver/Localization/Localization.json +++ b/RotationSolver/Localization/Localization.json @@ -49,7 +49,7 @@ "Configwindow_Param_NeverReplaceIconDesc": "Icon replacement: Repose is automatically displayed as the next skill to be used", "Configwindow_Param_UseOverlayWindow": "Display top overlay", "Configwindow_Param_UseOverlayWindowDesc": "This window is currently used to cue the body position in advance.", - "Configwindow_Param_BasicSettings": "Basic settings", + "Configwindow_Param_Basic": "Basic", "Configwindow_Param_WeaponDelay": "Set the random interval between GCD (seconds)", "Configwindow_Param_WeaponFaster": "Set the time advance of use actions", "Configwindow_Param_WeaponInterval": "Set the interval between abilities using", @@ -57,7 +57,7 @@ "Configwindow_Param_SpecialDuration": "Set the duration of special windows set by commands", "Configwindow_Param_AddDotGCDCount": "Set GCD advance of DOT refresh", "Configwindow_Param_AutoOffBetweenArea": "Turn off when player is between area.", - "Configwindow_Param_DisplayEnhancement": "Display enhancement", + "Configwindow_Param_Display": "Display", "Configwindow_Param_PoslockCasting": "Lock the movement when casting", "Configwindow_Param_PoslockModifier": "Set the modifier key to unlock the movement temporary", "Configwindow_Param_PoslockDescription": "LT is for gamepad player", @@ -80,7 +80,7 @@ "Configwindow_Param_SayOutStateChanged": "Saying the state changes out", "Configwindow_Param_ShowInfoOnDtr": "Display plugin state on dtrbar", "Configwindow_Param_ShowInfoOnToast": "Display plugin state changed on toast", - "Configwindow_Param_Action": "Use of actions", + "Configwindow_Param_Action": "Action", "Configwindow_Param_UseAOEWhenManual": "Use AOE actions in manual mode", "Configwindow_Param_AutoBreak": "Automatic breaking", "Configwindow_Param_UseAbility": "Auto-use abilities", @@ -99,7 +99,7 @@ "Configwindow_Param_LessMPNoRaise": "Nerver raise player if MP is less than the set value", "Configwindow_Param_UseItem": "Use items", "Configwindow_Param_UseItemDesc": "Use poison, WIP", - "Configwindow_Param_Conditon": "Trigger conditions", + "Configwindow_Param_Conditon": "Condition", "Configwindow_Param_StartOnCountdown": "Turn on auto-rotation on countdown", "Configwindow_Param_HealthDifference": "Set the HP standard deviation threshold for using AOE heal (ability & spell)", "Configwindow_Param_HealthAreaAbility": "Set the HP threshold for using AOE healing ability", @@ -109,7 +109,7 @@ "Configwindow_Param_HealthSingleSpell": "Set the HP threshold for using single healing spell", "Configwindow_Param_HealingOfTimeSubtractSingle": "Set the HP threshold reduce with hot effect(single)", "Configwindow_Param_HealthForDyingTank": "Set the HP threshold for tank to use invincibility", - "Configwindow_Param_Target": "Target selection", + "Configwindow_Param_Target": "Target", "Configwindow_Param_RightNowTargetToHostileType": "Hostile target filtering condition", "Configwindow_Param_TargetToHostileType1": "All targets can attack", "Configwindow_Param_TargetToHostileType2": "Targets have a target or all targets can attack", @@ -128,7 +128,7 @@ "Configwindow_Param_MoveTowardsScreenDesc": "Using movement actions towards the object in the center of the screen, otherwise toward the facing object.", "Configwindow_Param_RaiseAll": "Raise all (include passerby)", "Configwindow_Param_RaiseBrinkofDeath": "Raise player even has Brink of Death", - "Configwindow_Param_Hostile": "Hostile target filtering options", + "Configwindow_Param_Hostile": "Hostile", "Configwindow_Param_HostileDesc": "You can set the logic of hostile target selection to allow flexibility in switching the logic of selecting hostile in battle.", "Configwindow_Param_AddHostileCondition": "Add selection condition", "Configwindow_Param_HostileCondition": "Hostile target selection condition", diff --git a/RotationSolver/Localization/Strings.cs b/RotationSolver/Localization/Strings.cs index c9e6822f3..c2bbd42f1 100644 --- a/RotationSolver/Localization/Strings.cs +++ b/RotationSolver/Localization/Strings.cs @@ -96,7 +96,7 @@ internal class Strings public string Configwindow_Param_NeverReplaceIconDesc { get; set; } = "Icon replacement: Repose is automatically displayed as the next skill to be used"; public string Configwindow_Param_UseOverlayWindow { get; set; } = "Display top overlay"; public string Configwindow_Param_UseOverlayWindowDesc { get; set; } = "This window is currently used to cue the body position in advance."; - public string Configwindow_Param_BasicSettings { get; set; } = "Basic settings"; + public string Configwindow_Param_Basic { get; set; } = "Basic"; public string Configwindow_Param_WeaponDelay { get; set; } = "Set the random interval between GCD (seconds)"; public string Configwindow_Param_WeaponFaster { get; set; } = "Set the time advance of use actions"; public string Configwindow_Param_WeaponInterval { get; set; } = "Set the interval between abilities using"; @@ -104,7 +104,7 @@ internal class Strings public string Configwindow_Param_SpecialDuration { get; set; } = "Set the duration of special windows set by commands"; public string Configwindow_Param_AddDotGCDCount { get; set; } = "Set GCD advance of DOT refresh"; public string Configwindow_Param_AutoOffBetweenArea { get; set; } = "Turn off when player is between area."; - public string Configwindow_Param_DisplayEnhancement { get; set; } = "Display enhancement"; + public string Configwindow_Param_Display { get; set; } = "Display"; public string Configwindow_Param_PoslockCasting { get; set; } = "Lock the movement when casting"; public string Configwindow_Param_PoslockModifier { get; set; } = "Set the modifier key to unlock the movement temporary"; public string Configwindow_Param_PoslockDescription { get; set; } = "LT is for gamepad player"; @@ -127,7 +127,7 @@ internal class Strings public string Configwindow_Param_SayOutStateChanged { get; set; } = "Saying the state changes out"; public string Configwindow_Param_ShowInfoOnDtr { get; set; } = "Display plugin state on dtrbar"; public string Configwindow_Param_ShowInfoOnToast { get; set; } = "Display plugin state changed on toast"; - public string Configwindow_Param_Action { get; set; } = "Use of actions"; + public string Configwindow_Param_Action { get; set; } = "Action"; public string Configwindow_Param_UseAOEWhenManual { get; set; } = "Use AOE actions in manual mode"; public string Configwindow_Param_AutoBreak { get; set; } = "Automatic breaking"; public string Configwindow_Param_UseAbility { get; set; } = "Auto-use abilities"; @@ -146,7 +146,7 @@ internal class Strings public string Configwindow_Param_LessMPNoRaise { get; set; } = "Nerver raise player if MP is less than the set value"; public string Configwindow_Param_UseItem { get; set; } = "Use items"; public string Configwindow_Param_UseItemDesc { get; set; } = "Use poison, WIP"; - public string Configwindow_Param_Conditon { get; set; } = "Trigger conditions"; + public string Configwindow_Param_Conditon { get; set; } = "Condition"; public string Configwindow_Param_StartOnCountdown { get; set; } = "Turn on auto-rotation on countdown"; public string Configwindow_Param_HealthDifference { get; set; } = "Set the HP standard deviation threshold for using AOE heal (ability & spell)"; public string Configwindow_Param_HealthAreaAbility { get; set; } = "Set the HP threshold for using AOE healing ability"; @@ -156,7 +156,7 @@ internal class Strings public string Configwindow_Param_HealthSingleSpell { get; set; } = "Set the HP threshold for using single healing spell"; public string Configwindow_Param_HealingOfTimeSubtractSingle { get; set; } = "Set the HP threshold reduce with hot effect(single)"; public string Configwindow_Param_HealthForDyingTank { get; set; } = "Set the HP threshold for tank to use invincibility"; - public string Configwindow_Param_Target { get; set; } = "Target selection"; + public string Configwindow_Param_Target { get; set; } = "Target"; public string Configwindow_Param_RightNowTargetToHostileType { get; set; } = "Hostile target filtering condition"; public string Configwindow_Param_TargetToHostileType1 { get; set; } = "All targets can attack"; public string Configwindow_Param_TargetToHostileType2 { get; set; } = "Targets have a target or all targets can attack"; @@ -175,7 +175,7 @@ internal class Strings public string Configwindow_Param_MoveTowardsScreenDesc { get; set; } = "Using movement actions towards the object in the center of the screen, otherwise toward the facing object."; public string Configwindow_Param_RaiseAll { get; set; } = "Raise all (include passerby)"; public string Configwindow_Param_RaiseBrinkofDeath { get; set; } = "Raise player even has Brink of Death"; - public string Configwindow_Param_Hostile { get; set; } = "Hostile target filtering options"; + public string Configwindow_Param_Hostile { get; set; } = "Hostile"; public string Configwindow_Param_HostileDesc { get; set; } = "You can set the logic of hostile target selection to allow flexibility in switching the logic of selecting hostile in battle."; public string Configwindow_Param_AddHostileCondition { get; set; } = "Add selection condition"; public string Configwindow_Param_HostileCondition { get; set; } = "Hostile target selection condition"; diff --git a/RotationSolver/Windows/RotationConfigWindow_Param.cs b/RotationSolver/Windows/RotationConfigWindow_Param.cs index ac79651ab..f741bf518 100644 --- a/RotationSolver/Windows/RotationConfigWindow_Param.cs +++ b/RotationSolver/Windows/RotationConfigWindow_Param.cs @@ -10,71 +10,52 @@ namespace RotationSolver.Windows.RotationConfigWindow; internal partial class RotationConfigWindow { - private void DrawParamTab() + private static void DrawParamTabItem(string name, Action act) { - ImGui.TextWrapped(LocalizationManager.RightLang.Configwindow_Params_Description); - - ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0f, 5f)); - - if (ImGui.BeginChild("Param", new Vector2(0f, -1f), true)) + if (act == null) return; + if (ImGui.BeginTabItem(name)) { - //Never Repalce Icon - DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_NeverReplaceIcon, - ref Service.Configuration.NeverReplaceIcon, - LocalizationManager.RightLang.Configwindow_Param_NeverReplaceIconDesc); - - //Use Overlay Window - DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_UseOverlayWindow, - ref Service.Configuration.UseOverlayWindow, - LocalizationManager.RightLang.Configwindow_Param_UseOverlayWindowDesc); - - if (ImGui.CollapsingHeader(LocalizationManager.RightLang.Configwindow_Param_BasicSettings)) - { - DrawParamBasic(); - } - - ImGui.Separator(); - - if (ImGui.CollapsingHeader(LocalizationManager.RightLang.Configwindow_Param_DisplayEnhancement)) - { - DrawParamDisplay(); - } - - ImGui.Separator(); - - if (ImGui.CollapsingHeader(LocalizationManager.RightLang.Configwindow_Param_Action)) - { - DrawParamAction(); - } - - ImGui.Separator(); - - if (ImGui.CollapsingHeader(LocalizationManager.RightLang.Configwindow_Param_Conditon)) - { - DrawParamCondition(); - } - - ImGui.Separator(); - - if (ImGui.CollapsingHeader(LocalizationManager.RightLang.Configwindow_Param_Target)) + if (ImGui.BeginChild("Param", new Vector2(0f, -1f), true)) { - DrawParamTarget(); + act(); + ImGui.EndChild(); } + ImGui.EndTabItem(); + } + } - ImGui.Separator(); + private void DrawParamTab() + { + ImGui.TextWrapped(LocalizationManager.RightLang.Configwindow_Params_Description); - if (ImGui.CollapsingHeader(LocalizationManager.RightLang.Configwindow_Param_Hostile)) - { - DrawParamHostile(); - } + ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0f, 5f)); - ImGui.EndChild(); + if (ImGui.BeginTabBar("Param Items")) + { + DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Basic, DrawParamBasic); + DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Display, DrawParamDisplay); + DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Action, DrawParamAction); + DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Conditon, DrawParamCondition); + DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Target, DrawParamTarget); + DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Hostile, DrawParamHostile); + + ImGui.EndTabBar(); } ImGui.PopStyleVar(); } private void DrawParamBasic() { + //Never Repalce Icon + DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_NeverReplaceIcon, + ref Service.Configuration.NeverReplaceIcon, + LocalizationManager.RightLang.Configwindow_Param_NeverReplaceIconDesc); + + //Use Overlay Window + DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_UseOverlayWindow, + ref Service.Configuration.UseOverlayWindow, + LocalizationManager.RightLang.Configwindow_Param_UseOverlayWindowDesc); + DrawRangedFloat(LocalizationManager.RightLang.Configwindow_Param_WeaponDelay, ref Service.Configuration.WeaponDelayMin, ref Service.Configuration.WeaponDelayMax); @@ -154,12 +135,11 @@ private void DrawParamDisplay() DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_PoslockCasting, ref Service.Configuration.PoslockCasting); - - ImGui.SameLine(); - ImGuiHelper.Spacing(); - if (Service.Configuration.PoslockCasting) { + ImGui.SameLine(); + ImGuiHelper.Spacing(); + DrawCombo(LocalizationManager.RightLang.Configwindow_Param_PoslockModifier, ref Service.Configuration.PoslockModifier, EnumTranslations.ToName, ConfigurationHelper.Keys, diff --git a/RotationSolver/Windows/RotationConfigWindow_Rotation.cs b/RotationSolver/Windows/RotationConfigWindow_Rotation.cs index 16be7bf20..d63243257 100644 --- a/RotationSolver/Windows/RotationConfigWindow_Rotation.cs +++ b/RotationSolver/Windows/RotationConfigWindow_Rotation.cs @@ -24,9 +24,9 @@ private void DrawRotationTab() ImGui.TextWrapped(LocalizationManager.RightLang.Configwindow_AttackItem_Description); ImGui.SameLine(); - if (ImGui.Button("Wiki")) + if (ImGui.Button("Dev Wiki")) { - Util.OpenLink("https://archidog1998.github.io/RotationSolver/RotationDev"); + Util.OpenLink("https://archidog1998.github.io/RotationSolver/#/RotationDev/"); } ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0f, 5f));