Draw tree items with the tag text color

This commit is contained in:
r00telement
2021-12-08 20:14:30 +00:00
parent a736585228
commit a87085e4c6

View File

@@ -247,7 +247,15 @@ namespace PlayerTags
var beforeItemPos = ImGui.GetCursorScreenPos();
ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, new Vector2(0, 3));
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0, 0));
if (tag.TextColor.InheritedValue != null)
{
ImGui.PushStyleColor(ImGuiCol.Text, UIColorHelper.ToColor(tag.TextColor.InheritedValue.Value));
}
bool isOpened = ImGui.TreeNodeEx($"{GetTreeItemName(tag)}###{tag.GetHashCode()}", flags);
if (tag.TextColor.InheritedValue != null)
{
ImGui.PopStyleColor();
}
ImGui.PopStyleVar();
ImGui.PopStyleVar();
var afterItemPos = ImGui.GetCursorScreenPos();