More expressive code

This commit is contained in:
Haselnussbomber 2025-09-28 16:00:09 +02:00
parent 8edbc0ee78
commit 87adb2dfb7
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
2 changed files with 4 additions and 3 deletions

View file

@ -2454,10 +2454,11 @@ internal class PluginInstallerWindow : Window, IDisposable
var configuration = Service<DalamudConfiguration>.Get();
var pluginManager = Service<PluginManager>.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;
}

View file

@ -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?