From 4675d77a2de94ccd055475e39656f4812219a56d Mon Sep 17 00:00:00 2001 From: goat Date: Sun, 6 Nov 2022 15:28:22 +0100 Subject: [PATCH] fix(pi): only show testing context menu if testing is on --- .../PluginInstaller/PluginInstallerWindow.cs | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index be6f96cd9..4fcdf83ac 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -2128,32 +2128,35 @@ internal class PluginInstallerWindow : Window, IDisposable if (ImGui.BeginPopupContextItem("InstalledItemContextMenu")) { - var repoManifest = this.pluginListAvailable.FirstOrDefault(x => x.InternalName == plugin.Manifest.InternalName); - if (repoManifest?.IsTestingExclusive == true) - ImGui.BeginDisabled(); - - if (ImGui.MenuItem(Locs.PluginContext_TestingOptIn, string.Empty, optIn != null)) + if (configuration.DoPluginTest) { - if (optIn != null) - { - configuration.PluginTestingOptIns!.Remove(optIn); + var repoManifest = this.pluginListAvailable.FirstOrDefault(x => x.InternalName == plugin.Manifest.InternalName); + if (repoManifest?.IsTestingExclusive == true) + ImGui.BeginDisabled(); - if (plugin.Manifest.TestingAssemblyVersion > repoManifest?.AssemblyVersion) + if (ImGui.MenuItem(Locs.PluginContext_TestingOptIn, string.Empty, optIn != null)) + { + if (optIn != null) { - this.testingWarningModalOnNextFrame = true; + configuration.PluginTestingOptIns!.Remove(optIn); + + if (plugin.Manifest.TestingAssemblyVersion > repoManifest?.AssemblyVersion) + { + this.testingWarningModalOnNextFrame = true; + } } - } - else - { - configuration.PluginTestingOptIns!.Add(new PluginTestingOptIn(plugin.Manifest.InternalName)); + else + { + configuration.PluginTestingOptIns!.Add(new PluginTestingOptIn(plugin.Manifest.InternalName)); + } + + configuration.QueueSave(); } - configuration.QueueSave(); + if (repoManifest?.IsTestingExclusive == true) + ImGui.EndDisabled(); } - if (repoManifest?.IsTestingExclusive == true) - ImGui.EndDisabled(); - if (ImGui.MenuItem(Locs.PluginContext_DeletePluginConfigReload)) { Log.Debug($"Deleting config for {plugin.Manifest.InternalName}");