Merge pull request #2416 from Haselnussbomber/fix-testing-api-level

Fix for testing plugins with older stable releases
This commit is contained in:
goat 2025-11-04 20:36:49 +01:00 committed by GitHub
commit 32e04458c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 48 additions and 57 deletions

View file

@ -294,7 +294,7 @@ internal class PluginCategoryManager
}
}
if (PluginManager.HasTestingVersion(manifest) || manifest.IsTestingExclusive)
if (manifest.IsTestingExclusive || manifest.IsAvailableForTesting)
categoryList.Add(CategoryKind.AvailableForTesting);
// always add, even if empty

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;
}
@ -2593,8 +2594,7 @@ internal class PluginInstallerWindow : Window, IDisposable
var configuration = Service<DalamudConfiguration>.Get();
var pluginManager = Service<PluginManager>.Get();
var hasTestingVersionAvailable = configuration.DoPluginTest &&
PluginManager.HasTestingVersion(manifest);
var hasTestingVersionAvailable = configuration.DoPluginTest && manifest.IsAvailableForTesting;
if (ImGui.BeginPopupContextItem("ItemContextMenu"u8))
{
@ -2689,8 +2689,7 @@ internal class PluginInstallerWindow : Window, IDisposable
label += Locs.PluginTitleMod_TestingVersion;
}
var hasTestingAvailable = this.pluginListAvailable.Any(x => x.InternalName == plugin.InternalName &&
x.IsAvailableForTesting);
var hasTestingAvailable = this.pluginListAvailable.Any(x => x.InternalName == plugin.InternalName && x.IsAvailableForTesting);
if (hasTestingAvailable && configuration.DoPluginTest && testingOptIn == null)
{
label += Locs.PluginTitleMod_TestingAvailable;
@ -3784,16 +3783,7 @@ internal class PluginInstallerWindow : Window, IDisposable
private bool IsManifestFiltered(IPluginManifest manifest)
{
var hasSearchString = !string.IsNullOrWhiteSpace(this.searchText);
var oldApi = (manifest.TestingDalamudApiLevel == null
|| manifest.TestingDalamudApiLevel < PluginManager.DalamudApiLevel)
&& manifest.DalamudApiLevel < PluginManager.DalamudApiLevel;
var installed = this.IsManifestInstalled(manifest).IsInstalled;
if (oldApi && !hasSearchString && !installed)
return true;
if (!hasSearchString)
if (string.IsNullOrWhiteSpace(this.searchText))
return false;
return this.GetManifestSearchScore(manifest) < 1;