From b0c91fe1bdc752c8a8cc5916c2ce20ac903c612f Mon Sep 17 00:00:00 2001 From: MidoriKami <9083275+MidoriKami@users.noreply.github.com> Date: Sat, 28 Jan 2023 18:24:17 -0800 Subject: [PATCH 1/2] add UIColor to Dalamud Data window --- .../Interface/Internal/Windows/DataWindow.cs | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Dalamud/Interface/Internal/Windows/DataWindow.cs b/Dalamud/Interface/Internal/Windows/DataWindow.cs index be17baac4..c88646ff4 100644 --- a/Dalamud/Interface/Internal/Windows/DataWindow.cs +++ b/Dalamud/Interface/Internal/Windows/DataWindow.cs @@ -40,9 +40,11 @@ using Dalamud.Plugin.Ipc.Internal; using Dalamud.Utility; using ImGuiNET; using ImGuiScene; +using Lumina.Excel.GeneratedSheets; using Newtonsoft.Json; using PInvoke; using Serilog; +using Condition = Dalamud.Game.ClientState.Conditions.Condition; namespace Dalamud.Interface.Internal.Windows; @@ -169,6 +171,7 @@ internal class DataWindow : Window Hook, Aetherytes, Dtr_Bar, + UIColor, } /// @@ -195,6 +198,7 @@ internal class DataWindow : Window "ai" => "Addon Inspector", "at" => "Object Table", // Actor Table "ot" => "Object Table", + "uic" => "UIColor", _ => dataKind, }; @@ -356,6 +360,10 @@ internal class DataWindow : Window case DataKind.Dtr_Bar: this.DrawDtr(); break; + + case DataKind.UIColor: + this.DrawUIColor(); + break; } } else @@ -1713,6 +1721,40 @@ internal class DataWindow : Window } } + private void DrawUIColor() + { + var colorSheet = Service.Get().GetExcelSheet(); + if (colorSheet is null) return; + + foreach (var color in colorSheet) + { + this.DrawUIColor(color); + } + } + + private void DrawUIColor(UIColor color) + { + ImGui.Text($"[{color.RowId:D3}]"); + ImGui.SameLine(); + ImGui.TextColored(this.ConvertToVector4(color.Unknown2), $"Unknown2"); + ImGui.SameLine(); + ImGui.TextColored(this.ConvertToVector4(color.UIForeground), "UIForeground"); + ImGui.SameLine(); + ImGui.TextColored(this.ConvertToVector4(color.Unknown3), "Unknown3"); + ImGui.SameLine(); + ImGui.TextColored(this.ConvertToVector4(color.UIGlow), "UIGlow"); + } + + private Vector4 ConvertToVector4(uint color) + { + var r = (byte)(color >> 24); + var g = (byte)(color >> 16); + var b = (byte)(color >> 8); + var a = (byte)(color); + + return new Vector4(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f); + } + private async Task TestTaskInTaskDelay(CancellationToken token) { await Task.Delay(5000, token); From 4cf5db6994df61f18eb2f16423891dee18d02cb4 Mon Sep 17 00:00:00 2001 From: MidoriKami <9083275+MidoriKami@users.noreply.github.com> Date: Sat, 28 Jan 2023 18:26:13 -0800 Subject: [PATCH 2/2] Add Spaces between elements --- Dalamud/Interface/Internal/Windows/DataWindow.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/DataWindow.cs b/Dalamud/Interface/Internal/Windows/DataWindow.cs index c88646ff4..7e756b057 100644 --- a/Dalamud/Interface/Internal/Windows/DataWindow.cs +++ b/Dalamud/Interface/Internal/Windows/DataWindow.cs @@ -1734,13 +1734,13 @@ internal class DataWindow : Window private void DrawUIColor(UIColor color) { - ImGui.Text($"[{color.RowId:D3}]"); + ImGui.Text($"[{color.RowId:D3}] "); ImGui.SameLine(); - ImGui.TextColored(this.ConvertToVector4(color.Unknown2), $"Unknown2"); + ImGui.TextColored(this.ConvertToVector4(color.Unknown2), $"Unknown2 "); ImGui.SameLine(); - ImGui.TextColored(this.ConvertToVector4(color.UIForeground), "UIForeground"); + ImGui.TextColored(this.ConvertToVector4(color.UIForeground), "UIForeground "); ImGui.SameLine(); - ImGui.TextColored(this.ConvertToVector4(color.Unknown3), "Unknown3"); + ImGui.TextColored(this.ConvertToVector4(color.Unknown3), "Unknown3 "); ImGui.SameLine(); ImGui.TextColored(this.ConvertToVector4(color.UIGlow), "UIGlow"); }