OrangeGuidanceTomestone/client/PluginUi.cs

31 lines
793 B
C#
Raw Normal View History

2022-09-04 05:03:59 +00:00
using OrangeGuidanceTomestone.Ui;
2022-09-03 02:59:45 +00:00
namespace OrangeGuidanceTomestone;
public class PluginUi : IDisposable {
private Plugin Plugin { get; }
2022-09-04 05:03:59 +00:00
internal MainWindow MainWindow { get; }
internal Viewer Viewer { get; }
internal ViewerButton ViewerButton { get; }
2022-09-03 02:59:45 +00:00
internal PluginUi(Plugin plugin) {
this.Plugin = plugin;
2022-09-04 05:03:59 +00:00
this.MainWindow = new MainWindow(this.Plugin);
this.Viewer = new Viewer(this.Plugin);
this.ViewerButton = new ViewerButton(this.Plugin);
2022-09-03 02:59:45 +00:00
this.Plugin.Interface.UiBuilder.Draw += this.Draw;
}
public void Dispose() {
this.Plugin.Interface.UiBuilder.Draw -= this.Draw;
}
private void Draw() {
2022-09-04 05:03:59 +00:00
this.MainWindow.Draw();
this.ViewerButton.Draw();
this.Viewer.Draw();
2022-09-04 02:52:18 +00:00
}
2022-09-03 02:59:45 +00:00
}