feat: add imgui color helper

This commit is contained in:
kalilistic 2021-04-10 23:26:13 -04:00
parent f5054f5274
commit bb3006d0c8
6 changed files with 166 additions and 17 deletions

View file

@ -7,6 +7,7 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using CheapLoc;
using Dalamud.Interface.Colors;
using Dalamud.Interface.Components;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin;
@ -31,6 +32,7 @@ namespace Dalamud.Interface
private readonly DalamudPluginStatWindow pluginStatWindow;
private readonly DalamudChangelogWindow changelogWindow;
private readonly ComponentDemoWindow componentDemoWindow;
private readonly ColorDemoWindow colorDemoWindow;
private readonly WindowSystem windowSystem = new WindowSystem("DalamudCore");
@ -100,6 +102,12 @@ namespace Dalamud.Interface
};
this.windowSystem.AddWindow(this.componentDemoWindow);
this.colorDemoWindow = new ColorDemoWindow()
{
IsOpen = false,
};
this.windowSystem.AddWindow(this.colorDemoWindow);
Log.Information("[DUI] Windows added");
if (dalamud.Configuration.LogOpenAtStartup)
@ -208,6 +216,11 @@ namespace Dalamud.Interface
this.OpenComponentDemo();
}
if (ImGui.MenuItem("Open Colors Demo"))
{
this.OpenColorsDemo();
}
ImGui.MenuItem("Draw ImGui demo", string.Empty, ref this.isImguiDrawDemoWindow);
ImGui.Separator();
@ -420,6 +433,14 @@ namespace Dalamud.Interface
this.componentDemoWindow.IsOpen = true;
}
/// <summary>
/// Open the colors test window.
/// </summary>
internal void OpenColorsDemo()
{
this.colorDemoWindow.IsOpen = true;
}
/// <summary>
/// Toggle the Plugin Installer window.
/// </summary>