From c823d50d377819a6ad57abd6a7377483c05bead7 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Mon, 5 Apr 2021 23:58:12 +0200 Subject: [PATCH] refactor: fix style in DalamudInterface.cs --- Dalamud/Interface/DalamudInterface.cs | 43 ++++++++++++++------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/Dalamud/Interface/DalamudInterface.cs b/Dalamud/Interface/DalamudInterface.cs index fe7e6c5c2..45a9a6daa 100644 --- a/Dalamud/Interface/DalamudInterface.cs +++ b/Dalamud/Interface/DalamudInterface.cs @@ -23,16 +23,6 @@ namespace Dalamud.Interface { private readonly Dalamud dalamud; - private ulong frameCount = 0; - - private bool isImguiDrawDemoWindow = false; - -#if DEBUG - private bool isImguiDrawDevMenu = true; -#else - private bool isImguiDrawDevMenu = false; -#endif - private readonly DalamudLogWindow logWindow; private readonly DalamudDataWindow dataWindow; private readonly DalamudCreditsWindow creditsWindow; @@ -44,6 +34,16 @@ namespace Dalamud.Interface private readonly WindowSystem windowSystem = new WindowSystem("DalamudCore"); + private ulong frameCount = 0; + + private bool isImguiDrawDemoWindow = false; + +#if DEBUG + private bool isImguiDrawDevMenu = true; +#else + private bool isImguiDrawDevMenu = false; +#endif + /// /// Initializes a new instance of the class. /// @@ -261,7 +261,7 @@ namespace Dalamud.Interface if (ImGui.MenuItem("Open Plugin Stats")) { - OpenPluginStats(); + this.OpenPluginStats(); } if (ImGui.MenuItem("Print plugin info")) @@ -344,6 +344,18 @@ namespace Dalamud.Interface ImGui.ShowDemoWindow(); } + /// + /// Dispose the window system and all windows that require it. + /// + public void Dispose() + { + this.windowSystem.RemoveAllWindows(); + + this.dalamud?.Dispose(); + this.logWindow?.Dispose(); + this.creditsWindow?.Dispose(); + } + /// /// Open the Plugin Installer window. /// @@ -407,14 +419,5 @@ namespace Dalamud.Interface { this.componentDemoWindow.IsOpen ^= true; } - - public void Dispose() - { - this.windowSystem.RemoveAllWindows(); - - this.dalamud?.Dispose(); - this.logWindow?.Dispose(); - this.creditsWindow?.Dispose(); - } } }