Add toggle option for /xlplugins command

This commit is contained in:
ms2mml 2020-09-12 02:11:57 -07:00
parent 3c3fd538c6
commit 160dcc37ef

View file

@ -469,10 +469,21 @@ namespace Dalamud {
this.isImguiDrawChangelogWindow = this.changelogWindow != null && this.changelogWindow.Draw(); this.isImguiDrawChangelogWindow = this.changelogWindow != null && this.changelogWindow.Draw();
} }
} }
internal void OpenPluginInstaller() { internal void OpenPluginInstaller(bool toggle = false) {
if (!toggle)
{
this.pluginWindow = new PluginInstallerWindow(this, this.StartInfo.GameVersion); this.pluginWindow = new PluginInstallerWindow(this, this.StartInfo.GameVersion);
this.isImguiDrawPluginWindow = true; this.isImguiDrawPluginWindow = true;
} }
else
{
if (this.pluginWindow == null)
{
this.pluginWindow = new PluginInstallerWindow(this, this.StartInfo.GameVersion);
}
this.isImguiDrawPluginWindow ^= true;
}
}
internal void OpenChangelog() { internal void OpenChangelog() {
this.changelogWindow = new DalamudChangelogWindow(this); this.changelogWindow = new DalamudChangelogWindow(this);
@ -718,8 +729,15 @@ namespace Dalamud {
} }
private void OnOpenInstallerCommand(string command, string arguments) { private void OnOpenInstallerCommand(string command, string arguments) {
if (arguments == "toggle" || arguments == "t")
{
OpenPluginInstaller(toggle: true);
}
else
{
OpenPluginInstaller(); OpenPluginInstaller();
} }
}
private void OnOpenCreditsCommand(string command, string arguments) private void OnOpenCreditsCommand(string command, string arguments)
{ {