From 87adb2dfb7933b3332870ea7314b88f4ec76cb7c Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Sun, 28 Sep 2025 16:00:09 +0200 Subject: [PATCH] More expressive code --- .../Windows/PluginInstaller/PluginInstallerWindow.cs | 5 +++-- Dalamud/Plugin/Internal/Types/LocalPlugin.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index 3e56b65c9..b203b3894 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -2454,10 +2454,11 @@ internal class PluginInstallerWindow : Window, IDisposable var configuration = Service.Get(); var pluginManager = Service.Get(); + var canUseTesting = pluginManager.CanUseTesting(manifest); var useTesting = pluginManager.UseTesting(manifest); var wasSeen = this.WasPluginSeen(manifest.InternalName); - var effectiveApiLevel = useTesting && manifest.TestingDalamudApiLevel != null ? manifest.TestingDalamudApiLevel.Value : manifest.DalamudApiLevel; + var effectiveApiLevel = useTesting ? manifest.TestingDalamudApiLevel.Value : manifest.DalamudApiLevel; var isOutdated = effectiveApiLevel < PluginManager.DalamudApiLevel; var isIncompatible = manifest.MinimumDalamudVersion != null && @@ -2487,7 +2488,7 @@ internal class PluginInstallerWindow : Window, IDisposable { label += Locs.PluginTitleMod_TestingExclusive; } - else if (configuration.DoPluginTest && PluginManager.HasTestingVersion(manifest)) + else if (canUseTesting) { label += Locs.PluginTitleMod_TestingAvailable; } diff --git a/Dalamud/Plugin/Internal/Types/LocalPlugin.cs b/Dalamud/Plugin/Internal/Types/LocalPlugin.cs index 70b1db872..da8ec8ff9 100644 --- a/Dalamud/Plugin/Internal/Types/LocalPlugin.cs +++ b/Dalamud/Plugin/Internal/Types/LocalPlugin.cs @@ -301,7 +301,7 @@ internal class LocalPlugin : IAsyncDisposable throw new PluginPreconditionFailedException($"Unable to load {this.Name}, game is newer than applicable version {this.manifest.ApplicableVersion}"); // We want to allow loading dev plugins with a lower API level than the current Dalamud API level, for ease of development - if (this.manifest.EffectiveApiLevel < PluginManager.DalamudApiLevel && !pluginManager.LoadAllApiLevels && !this.IsDev) + if (!pluginManager.LoadAllApiLevels && !this.IsDev && this.manifest.EffectiveApiLevel < PluginManager.DalamudApiLevel) throw new PluginPreconditionFailedException($"Unable to load {this.Name}, incompatible API level {this.manifest.EffectiveApiLevel}"); // We might want to throw here?