From 13bf83b2b7798b7e2fe2ef70b0d5075793addba1 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Tue, 16 Jan 2024 21:32:23 +0100 Subject: [PATCH] Add design color to preview in combos. --- Glamourer/Gui/DesignCombo.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Glamourer/Gui/DesignCombo.cs b/Glamourer/Gui/DesignCombo.cs index c63fa3c..e255c17 100644 --- a/Glamourer/Gui/DesignCombo.cs +++ b/Glamourer/Gui/DesignCombo.cs @@ -81,9 +81,13 @@ public abstract class DesignComboBase : FilterComboCache>, { _currentDesign = currentDesign; InnerWidth = 400 * ImGuiHelpers.GlobalScale; - var name = label ?? "Select Design Here..."; - var ret = Draw("##design", name, string.Empty, width, ImGui.GetTextLineHeightWithSpacing()) - && CurrentSelection != null; + var name = label ?? "Select Design Here..."; + bool ret; + using (_ = currentDesign != null ? ImRaii.PushColor(ImGuiCol.Text, _designColors.GetColor(currentDesign)) : null) + { + ret = Draw("##design", name, string.Empty, width, ImGui.GetTextLineHeightWithSpacing()) + && CurrentSelection != null; + } if (currentDesign != null) { @@ -195,7 +199,6 @@ public sealed class RevertDesignCombo : DesignComboBase, IDisposable _autoDesignManager = autoDesignManager; } - public void Draw(AutoDesignSet set, AutoDesign? design, int autoDesignIndex) { if (!Draw(design?.Design, design?.Name(Incognito), ImGui.GetContentRegionAvail().X))