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

Commit

Permalink
fix: some tooltips about sidebar.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 15, 2023
1 parent 930a42c commit a12b2c4
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Resources/NoHostileNames.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"0": [
""
],
"641": [
""
],
"837": [
""
]
}
15 changes: 15 additions & 0 deletions RotationSolver/Localization/ConfigTranslation.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
using RotationSolver.Basic.Configuration;
using RotationSolver.UI;

namespace RotationSolver.Localization;

internal static class ConfigTranslation
{
public static string ToDescription(this RotationConfigWindowTab tab) => tab switch
{
RotationConfigWindowTab.Actions => LocalizationManager.RightLang.ConfigWindow_Tab_Actions,
RotationConfigWindowTab.Rotations => LocalizationManager.RightLang.ConfigWindow_Tab_Rotations,
RotationConfigWindowTab.List => LocalizationManager.RightLang.ConfigWindow_Tab_List,
RotationConfigWindowTab.Basic => LocalizationManager.RightLang.ConfigWindow_Tab_Basic,
RotationConfigWindowTab.UI => LocalizationManager.RightLang.ConfigWindow_Tab_UI,
RotationConfigWindowTab.Auto => LocalizationManager.RightLang.ConfigWindow_Tab_Auto,
RotationConfigWindowTab.Target => LocalizationManager.RightLang.ConfigWindow_Tab_Target,
RotationConfigWindowTab.Extra => LocalizationManager.RightLang.ConfigWindow_Tab_Extra,
_ => string.Empty,
};


public static string ToName(this JobConfigInt config) => config switch
{
JobConfigInt.AddDotGCDCount => LocalizationManager.RightLang.ConfigWindow_Param_AddDotGCDCount,
Expand Down
10 changes: 9 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,5 +453,13 @@
"ConfigWindow_Search_Result": "Searching Result",
"ConfigWindow_UI_DrawIconAnimation": "Show animation about Icon",
"ConfigWindow_UI_ShowBeneficialPosition": "Show beneficial positions.",
"ConfigWindow_UI_BeneficialPositionColor": "The colors of beneficial positions"
"ConfigWindow_UI_BeneficialPositionColor": "The colors of beneficial positions",
"ConfigWindow_Tab_Actions": "The actions' conditions about your job.",
"ConfigWindow_Tab_Rotations": "All rotations that RS loaded.",
"ConfigWindow_Tab_List": "Something that has to be a list.",
"ConfigWindow_Tab_Basic": "Basic settings.",
"ConfigWindow_Tab_UI": "Settings about user interface.",
"ConfigWindow_Tab_Auto": "About some general actions' usage and conditions.",
"ConfigWindow_Tab_Target": "The way to find the targets, hostiles or friends.",
"ConfigWindow_Tab_Extra": "Some features shouldn't be included by RS."
}
9 changes: 9 additions & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -664,4 +664,13 @@ internal partial class Strings

public string ConfigWindow_UI_ShowBeneficialPosition { get; set; } = "Show beneficial positions.";
public string ConfigWindow_UI_BeneficialPositionColor { get; set; } = "The colors of beneficial positions";

public string ConfigWindow_Tab_Actions { get; set; } = "The actions' conditions about your job.";
public string ConfigWindow_Tab_Rotations { get; set; } = "All rotations that RS loaded.";
public string ConfigWindow_Tab_List { get; set; } = "Something that has to be a list.";
public string ConfigWindow_Tab_Basic { get; set; } = "Basic settings.";
public string ConfigWindow_Tab_UI { get; set; } = "Settings about user interface.";
public string ConfigWindow_Tab_Auto { get; set; } = "About some general actions' usage and conditions.";
public string ConfigWindow_Tab_Target { get; set; } = "The way to find the targets, hostiles or friends.";
public string ConfigWindow_Tab_Extra { get; set; } = "Some features shouldn't be included by RS.";
}
8 changes: 7 additions & 1 deletion RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ private void DrawSideBar()
}
DrawActionOverlay(cursor, iconSize, _activeTab == item ? 1 : 0);
}, Math.Max(_scale * MIN_COLUMN_WIDTH, wholeWidth), iconSize);
ImguiTooltips.HoveredTooltip(item.ToString());

var desc = item.ToString();
var addition = item.ToDescription();
if (!string.IsNullOrEmpty(addition)) desc += "\n \n" + addition;
ImguiTooltips.HoveredTooltip(desc);
}
else
{
Expand All @@ -164,6 +168,8 @@ private void DrawSideBar()
if (ImGui.IsItemHovered())
{
ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
var desc = item.ToDescription();
if (!string.IsNullOrEmpty(desc)) ImguiTooltips.ShowTooltip(desc);
}
}
}
Expand Down

0 comments on commit a12b2c4

Please sign in to comment.