Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: fixed combo config ui.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 5, 2023
1 parent 6572954 commit 6cc5b8c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions RotationSolver/UI/ImGuiHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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++)
Expand Down

0 comments on commit 6cc5b8c

Please sign in to comment.