mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 05:13:40 +01:00
fix: label plugins that aren't actively being tested "available" in the installer
This commit is contained in:
parent
53211c0a7b
commit
46cb6a3b74
2 changed files with 37 additions and 12 deletions
|
|
@ -1677,6 +1677,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
var pluginManager = Service<PluginManager>.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}");
|
||||
|
||||
|
|
|
|||
|
|
@ -205,6 +205,25 @@ Thanks and have fun!";
|
|||
return !manifest.IsHide;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if a manifest even has an available testing version.
|
||||
/// </summary>
|
||||
/// <param name="manifest">The manifest to test.</param>
|
||||
/// <returns>Whether or not a testing version is available.</returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print to chat any plugin updates and whether they were successful.
|
||||
/// </summary>
|
||||
|
|
@ -249,6 +268,16 @@ Thanks and have fun!";
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For a given manifest, determine if the user opted into testing this plugin.
|
||||
/// </summary>
|
||||
/// <param name="manifest">Manifest to check.</param>
|
||||
/// <returns>A value indicating whether testing should be used.</returns>
|
||||
public bool HasTestingOptIn(PluginManifest manifest)
|
||||
{
|
||||
return this.configuration.PluginTestingOptIns!.Any(x => x.InternalName == manifest.InternalName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue