From 6cc5b8c50325e2b863a71f53f811570aad0e9d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Wed, 5 Apr 2023 20:55:26 +0800 Subject: [PATCH] fix: fixed combo config ui. --- RotationSolver/Localization/Localization.json | 2 +- RotationSolver/Localization/Strings.cs | 2 +- RotationSolver/UI/ImGuiHelper.cs | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/RotationSolver/Localization/Localization.json b/RotationSolver/Localization/Localization.json index 696c291e6..1db52fb58 100644 --- a/RotationSolver/Localization/Localization.json +++ b/RotationSolver/Localization/Localization.json @@ -198,7 +198,7 @@ "ConfigWindow_Control_NeedToEnable": " (Need to enable)", "ConfigWindow_Control_ClickToUse": "Click to use it!", "ConfigWindow_Rotation_BetaRotation": "Beta Rotation!", - "ConfigWindow_Rotation_ResetToDefault": "Click to reset value!", + "ConfigWindow_Rotation_ResetToDefault": "Click to reset the rotation configuration to default!", "Timeline_DragdropDescription": "Drag&drop to move,Ctrl+Alt+RightClick to delete.", "Timeline_SearchBar": "Search Bar", "Timeline_MustUse": "MustUse", diff --git a/RotationSolver/Localization/Strings.cs b/RotationSolver/Localization/Strings.cs index 282c464dd..2092649d5 100644 --- a/RotationSolver/Localization/Strings.cs +++ b/RotationSolver/Localization/Strings.cs @@ -266,7 +266,7 @@ internal partial class Strings public string ConfigWindow_Control_NeedToEnable { get; set; } = " (Need to enable)"; public string ConfigWindow_Control_ClickToUse { get; set; } = "Click to use it!"; public string ConfigWindow_Rotation_BetaRotation { get; set; } = "Beta Rotation!"; - public string ConfigWindow_Rotation_ResetToDefault { get; set; } = "Click to reset value!"; + public string ConfigWindow_Rotation_ResetToDefault { get; set; } = "Click to reset the rotation configuration to default!"; #endregion #region ScriptWindow diff --git a/RotationSolver/UI/ImGuiHelper.cs b/RotationSolver/UI/ImGuiHelper.cs index 6d2b7abda..33b037be8 100644 --- a/RotationSolver/UI/ImGuiHelper.cs +++ b/RotationSolver/UI/ImGuiHelper.cs @@ -465,7 +465,7 @@ public unsafe static void Display(this ICustomRotation rotation, ICustomRotation ImGui.PopStyleColor(); ImGui.SameLine(); - ImGui.TextDisabled(" - " + LocalizationManager.RightLang.ConfigWindow_Helper_GameVersion + ": "); + ImGui.TextDisabled(" - " + LocalizationManager.RightLang.ConfigWindow_Helper_GameVersion + ": "); ImGui.SameLine(); ImGui.Text(rotation.GameVersion); @@ -504,10 +504,15 @@ public unsafe static void Display(this ICustomRotation rotation, ICustomRotation { var display = ImGui.GetIO().DisplaySize * 0.7f; + bool isFirst = true; foreach (var texture in attrs) { ImGui.SameLine(); - Spacing(); + if(isFirst) + { + isFirst = false; + Spacing(); + } var hasTexture = texture.Texture != null; if (IconButton(hasTexture ? FontAwesomeIcon.Image : FontAwesomeIcon.QuestionCircle, @@ -672,7 +677,7 @@ static void Draw(this IRotationConfigSet set, bool canAddButton) static void Draw(this RotationConfigCombo config, IRotationConfigSet set, bool canAddButton) { var val = set.GetCombo(config.Name); - ImGui.SetNextItemWidth(ImGui.CalcTextSize(config.DisplayName).X ); + ImGui.SetNextItemWidth(ImGui.CalcTextSize(config.Items[val]).X + 50); if (ImGui.BeginCombo($"{config.DisplayName}##{config.GetHashCode()}_{config.Name}", config.Items[val])) { for (int comboIndex = 0; comboIndex < config.Items.Length; comboIndex++)