mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-29 11:59:21 +01:00
feat: add component library
This commit is contained in:
parent
7d5680badd
commit
841e452aa2
4 changed files with 100 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ using System.Runtime.CompilerServices;
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
using CheapLoc;
|
||||
using Dalamud.Interface.Components;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Plugin;
|
||||
using ImGuiNET;
|
||||
|
|
@ -39,6 +40,7 @@ namespace Dalamud.Interface
|
|||
private readonly PluginInstallerWindow pluginWindow;
|
||||
private readonly DalamudPluginStatWindow pluginStatWindow;
|
||||
private readonly DalamudChangelogWindow changelogWindow;
|
||||
private readonly ComponentDemoWindow componentDemoWindow;
|
||||
|
||||
private readonly WindowSystem windowSystem = new WindowSystem("DalamudCore");
|
||||
|
||||
|
|
@ -92,6 +94,12 @@ namespace Dalamud.Interface
|
|||
};
|
||||
this.windowSystem.AddWindow(this.changelogWindow);
|
||||
|
||||
this.componentDemoWindow = new ComponentDemoWindow()
|
||||
{
|
||||
IsOpen = false,
|
||||
};
|
||||
this.windowSystem.AddWindow(this.componentDemoWindow);
|
||||
|
||||
Log.Information("[DUI] Windows added");
|
||||
|
||||
if (dalamud.Configuration.LogOpenAtStartup)
|
||||
|
|
@ -195,6 +203,11 @@ namespace Dalamud.Interface
|
|||
this.OpenChangelog();
|
||||
}
|
||||
|
||||
if (ImGui.MenuItem("Open Components Demo"))
|
||||
{
|
||||
this.OpenComponentDemo();
|
||||
}
|
||||
|
||||
ImGui.MenuItem("Draw ImGui demo", string.Empty, ref this.isImguiDrawDemoWindow);
|
||||
|
||||
ImGui.Separator();
|
||||
|
|
@ -387,6 +400,14 @@ namespace Dalamud.Interface
|
|||
this.pluginStatWindow.IsOpen ^= true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open the component test window.
|
||||
/// </summary>
|
||||
internal void OpenComponentDemo()
|
||||
{
|
||||
this.componentDemoWindow.IsOpen ^= true;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
this.windowSystem.RemoveAllWindows();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue