diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index 8a22be5bb..987038e73 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -1677,6 +1677,7 @@ internal class PluginInstallerWindow : Window, IDisposable var pluginManager = Service.Get(); var useTesting = pluginManager.UseTesting(manifest); + var activelyTesting = useTesting || manifest.IsTestingExclusive; var wasSeen = this.WasPluginSeen(manifest.InternalName); var isOutdated = manifest.DalamudApiLevel < PluginManager.DalamudApiLevel; @@ -1692,10 +1693,14 @@ internal class PluginInstallerWindow : Window, IDisposable var label = manifest.Name; // Testing - if (useTesting || manifest.IsTestingExclusive) + if (activelyTesting) { label += Locs.PluginTitleMod_TestingVersion; } + else if (configuration.DoPluginTest && PluginManager.HasTestingVersion(manifest)) + { + label += Locs.PluginTitleMod_TestingAvailable; + } ImGui.PushID($"available{index}{manifest.InternalName}"); diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index 2f46ae07e..6299a40a5 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -205,6 +205,25 @@ Thanks and have fun!"; return !manifest.IsHide; } + /// + /// Check if a manifest even has an available testing version. + /// + /// The manifest to test. + /// Whether or not a testing version is available. + public static bool HasTestingVersion(PluginManifest manifest) + { + var av = manifest.AssemblyVersion; + var tv = manifest.TestingAssemblyVersion; + var hasTv = tv != null; + + if (hasTv) + { + return tv > av; + } + + return false; + } + /// /// Print to chat any plugin updates and whether they were successful. /// @@ -249,6 +268,16 @@ Thanks and have fun!"; } } + /// + /// For a given manifest, determine if the user opted into testing this plugin. + /// + /// Manifest to check. + /// A value indicating whether testing should be used. + public bool HasTestingOptIn(PluginManifest manifest) + { + return this.configuration.PluginTestingOptIns!.Any(x => x.InternalName == manifest.InternalName); + } + /// /// For a given manifest, determine if the testing version should be used over the normal version. /// The higher of the two versions is calculated after checking other settings. @@ -260,22 +289,13 @@ Thanks and have fun!"; if (!this.configuration.DoPluginTest) return false; - if (this.configuration.PluginTestingOptIns!.All(x => x.InternalName != manifest.InternalName)) + if (!this.HasTestingOptIn(manifest)) return false; if (manifest.IsTestingExclusive) return true; - var av = manifest.AssemblyVersion; - var tv = manifest.TestingAssemblyVersion; - var hasTv = tv != null; - - if (hasTv) - { - return tv > av; - } - - return false; + return HasTestingVersion(manifest); } ///