Everything's a service.

This commit is contained in:
Ottermandias 2023-03-17 17:51:05 +01:00
parent 2670ba52c1
commit dd8c910597
45 changed files with 2155 additions and 2212 deletions

View file

@ -0,0 +1,40 @@
using System;
using Dalamud.Interface;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin;
using Penumbra.UI;
using Penumbra.UI.Classes;
namespace Penumbra;
public class PenumbraWindowSystem : IDisposable
{
private readonly UiBuilder _uiBuilder;
private readonly WindowSystem _windowSystem;
public readonly ConfigWindow Window;
public readonly PenumbraChangelog Changelog;
public PenumbraWindowSystem(DalamudPluginInterface pi, PenumbraChangelog changelog, ConfigWindow window, LaunchButton _,
ModEditWindow editWindow)
{
_uiBuilder = pi.UiBuilder;
Changelog = changelog;
Window = window;
_windowSystem = new WindowSystem("Penumbra");
_windowSystem.AddWindow(changelog.Changelog);
_windowSystem.AddWindow(window);
_windowSystem.AddWindow(editWindow);
_uiBuilder.OpenConfigUi += Window.Toggle;
_uiBuilder.Draw += _windowSystem.Draw;
}
public void ForceChangelogOpen()
=> Changelog.Changelog.ForceOpen = true;
public void Dispose()
{
_uiBuilder.OpenConfigUi -= Window.Toggle;
_uiBuilder.Draw -= _windowSystem.Draw;
}
}