- Improve DBViewer behaviour and UI

(cherry picked from commit cb41787f5525aa73175ad06299d0a799ebf731e2)
This commit is contained in:
Infi
2026-05-01 20:14:13 +02:00
committed by JonKazama-Hellion
parent 135f7a9bf7
commit e219b3e1fe
19 changed files with 652 additions and 12 deletions
+12 -3
View File
@@ -391,7 +391,7 @@ internal static class ImGuiUtil
}
}
public static void DrawArrows(ref int selected, int min, int max, float spacing, int id = 0)
public static void DrawArrows(ref int selected, int min, int max, float spacing, int id = 0, string? tooltipLeft = null, string? tooltipRight = null)
{
// Prevents changing values from triggering EndDisable
var isMin = selected == min;
@@ -404,12 +404,19 @@ internal static class ImGuiUtil
selected--;
}
if (tooltipLeft != null && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
ImGui.SetTooltip(tooltipLeft);
ImGui.SameLine(0, spacing);
using (ImRaii.Disabled(isMax))
{
if (IconButton(FontAwesomeIcon.ArrowRight, id+1.ToString()))
selected++;
}
if (tooltipRight != null && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
ImGui.SetTooltip(tooltipRight);
}
public static void WrappedTextWithColor(Vector4 color, string text)
@@ -544,6 +551,8 @@ internal static class ImGuiUtil
public static void ChannelSelector(string headerText, Dictionary<ChatType, (ChatSource Source, ChatSource Target)> chatCodes)
{
var spacing = 3.0f * ImGuiHelpers.GlobalScale;
using var channelNode = ImRaii.TreeNode(headerText);
if (!channelNode.Success)
return;
@@ -561,7 +570,7 @@ internal static class ImGuiUtil
if (ImGui.IsItemHovered())
ImGui.SetTooltip(Language.ChannelSelector_Select);
ImGui.SameLine();
ImGui.SameLine(0, spacing);
if (ImGuiComponents.IconButton(FontAwesomeIcon.Times))
{
@@ -572,7 +581,7 @@ internal static class ImGuiUtil
if (ImGui.IsItemHovered())
ImGui.SetTooltip(Language.ChannelSelector_Unselect);
ImGui.SameLine();
ImGui.SameLine(0, spacing);
using var headerNode = ImRaii.TreeNode(header);
if (!headerNode.Success)