Update UIDebug2, ImGuiComponents, ImGuiHelpers (#2081)

* Update ImGuiComponents & ImGuiHelpers
Took some helper functions created for `UiDebug2`, and incorporated them into `ImGuiComponents` / `ImGuiHelpers` instead

- `IconButton()` (and its various overloads) now includes an optional size parameter
- `IconButtonSelect()` has been added, allowing a row or grid of IconButtons to serve as a radio-like input
- `HelpMarker()` now includes an optional color parameter
- `ClickToCopyText()` now includes an optional color parameter, and includes the `FontAwesome.Copy` icon in the tooltip.
- Implemented ImRaii in these files

These changes are intended not to break any existing calls in plugins or within Dalamud itself.

* Fix ambiguous overloads

* UiDebug2 Updates
- Fixed XY coordinate display
- Added AtkValue table to AddonTree display
- Restored old behaviour wherein the Addon display initially only shows the Root node and a collapsed node list
- The above should also fix the Element Selector / Search behaviour, allowing it to scroll correctly to the searched node
- Now displays field offsets for any node/component whose pointer exists in the addon struct
- Tidied up node tree headers by removing memory addresses (they're still readable in the opened tree, of course)
This commit is contained in:
ItsBexy 2024-11-14 16:36:27 -07:00 committed by GitHub
parent 94f16ac16e
commit ee63f60877
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 649 additions and 278 deletions

View file

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Numerics;
using Dalamud.Interface.Components;
using Dalamud.Interface.Internal.UiDebug2.Utility;
using Dalamud.Interface.Utility.Raii;
@ -370,8 +371,8 @@ internal unsafe partial class TextNodeTree
var hAlign = (int)alignment % 3;
var vAlign = ((int)alignment - hAlign) / 3;
var hAlignInput = IconButtonSelect($"{label}H", ref hAlign, [0, 1, 2], [AlignLeft, AlignCenter, AlignRight]);
var vAlignInput = IconButtonSelect($"{label}V", ref vAlign, [0, 1, 2], [ArrowsUpToLine, GripLines, ArrowsDownToLine]);
var hAlignInput = ImGuiComponents.IconButtonSelect($"{label}H", ref hAlign, [AlignLeft, AlignCenter, AlignRight], [0, 1, 2], 3u, new(25, 0));
var vAlignInput = ImGuiComponents.IconButtonSelect($"{label}V", ref vAlign, [ArrowsUpToLine, GripLines, ArrowsDownToLine], [0, 1, 2], 3u, new(25, 0));
if (hAlignInput || vAlignInput)
{