From 160dcc37ef40f026183a8d31de9f3ec1ed54ce86 Mon Sep 17 00:00:00 2001 From: ms2mml <> Date: Sat, 12 Sep 2020 02:11:57 -0700 Subject: [PATCH 1/2] Add toggle option for /xlplugins command --- Dalamud/Dalamud.cs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Dalamud/Dalamud.cs b/Dalamud/Dalamud.cs index 8e46bf3b4..27b74f044 100644 --- a/Dalamud/Dalamud.cs +++ b/Dalamud/Dalamud.cs @@ -469,9 +469,20 @@ namespace Dalamud { this.isImguiDrawChangelogWindow = this.changelogWindow != null && this.changelogWindow.Draw(); } } - internal void OpenPluginInstaller() { - this.pluginWindow = new PluginInstallerWindow(this, this.StartInfo.GameVersion); - this.isImguiDrawPluginWindow = true; + internal void OpenPluginInstaller(bool toggle = false) { + if (!toggle) + { + this.pluginWindow = new PluginInstallerWindow(this, this.StartInfo.GameVersion); + this.isImguiDrawPluginWindow = true; + } + else + { + if (this.pluginWindow == null) + { + this.pluginWindow = new PluginInstallerWindow(this, this.StartInfo.GameVersion); + } + this.isImguiDrawPluginWindow ^= true; + } } internal void OpenChangelog() { @@ -718,7 +729,14 @@ namespace Dalamud { } private void OnOpenInstallerCommand(string command, string arguments) { - OpenPluginInstaller(); + if (arguments == "toggle" || arguments == "t") + { + OpenPluginInstaller(toggle: true); + } + else + { + OpenPluginInstaller(); + } } private void OnOpenCreditsCommand(string command, string arguments) From 6610d55f17212c27fb88160566e8ef5539783644 Mon Sep 17 00:00:00 2001 From: ms2mml <> Date: Sat, 12 Sep 2020 15:10:32 -0700 Subject: [PATCH 2/2] Switch default behavior for /xlplugins to toggle --- Dalamud/Dalamud.cs | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/Dalamud/Dalamud.cs b/Dalamud/Dalamud.cs index 27b74f044..108304013 100644 --- a/Dalamud/Dalamud.cs +++ b/Dalamud/Dalamud.cs @@ -469,20 +469,13 @@ namespace Dalamud { this.isImguiDrawChangelogWindow = this.changelogWindow != null && this.changelogWindow.Draw(); } } - internal void OpenPluginInstaller(bool toggle = false) { - if (!toggle) + internal void OpenPluginInstaller() + { + if (this.pluginWindow == null) { this.pluginWindow = new PluginInstallerWindow(this, this.StartInfo.GameVersion); - this.isImguiDrawPluginWindow = true; - } - else - { - if (this.pluginWindow == null) - { - this.pluginWindow = new PluginInstallerWindow(this, this.StartInfo.GameVersion); - } - this.isImguiDrawPluginWindow ^= true; } + this.isImguiDrawPluginWindow ^= true; } internal void OpenChangelog() { @@ -728,15 +721,9 @@ namespace Dalamud { Log.Information(info); } - private void OnOpenInstallerCommand(string command, string arguments) { - if (arguments == "toggle" || arguments == "t") - { - OpenPluginInstaller(toggle: true); - } - else - { - OpenPluginInstaller(); - } + private void OnOpenInstallerCommand(string command, string arguments) + { + OpenPluginInstaller(); } private void OnOpenCreditsCommand(string command, string arguments)