mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
feat(PluginManager): add switch to allow for loading plugins of all API levels
This commit is contained in:
parent
3274bd047d
commit
1e33b7deb5
4 changed files with 15 additions and 2 deletions
|
|
@ -164,6 +164,11 @@ namespace Dalamud.Configuration.Internal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DalamudBetaKind { get; set; }
|
public string DalamudBetaKind { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether or not all plugins, regardless of API level, should be loaded.
|
||||||
|
/// </summary>
|
||||||
|
public bool LoadAllApiLevels { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load a configuration from the provided path.
|
/// Load a configuration from the provided path.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -464,6 +464,14 @@ namespace Dalamud.Interface.Internal
|
||||||
this.dalamud.PluginManager.ScanDevPlugins();
|
this.dalamud.PluginManager.ScanDevPlugins();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.Separator();
|
||||||
|
|
||||||
|
if (ImGui.MenuItem("Load all API levels", null, this.dalamud.Configuration.LoadAllApiLevels))
|
||||||
|
{
|
||||||
|
this.dalamud.Configuration.LoadAllApiLevels = !this.dalamud.Configuration.LoadAllApiLevels;
|
||||||
|
this.dalamud.Configuration.Save();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
ImGui.MenuItem("API Level:" + PluginManager.DalamudApiLevel, false);
|
ImGui.MenuItem("API Level:" + PluginManager.DalamudApiLevel, false);
|
||||||
ImGui.MenuItem("Loaded plugins:" + this.dalamud.PluginManager?.InstalledPlugins.Count, false);
|
ImGui.MenuItem("Loaded plugins:" + this.dalamud.PluginManager?.InstalledPlugins.Count, false);
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ namespace Dalamud.Plugin.Internal
|
||||||
if (this.Manifest.ApplicableVersion < this.dalamud.StartInfo.GameVersion)
|
if (this.Manifest.ApplicableVersion < this.dalamud.StartInfo.GameVersion)
|
||||||
throw new InvalidPluginOperationException($"Unable to load {this.Name}, no applicable version");
|
throw new InvalidPluginOperationException($"Unable to load {this.Name}, no applicable version");
|
||||||
|
|
||||||
if (this.Manifest.DalamudApiLevel < PluginManager.DalamudApiLevel)
|
if (this.Manifest.DalamudApiLevel < PluginManager.DalamudApiLevel && !this.dalamud.Configuration.LoadAllApiLevels)
|
||||||
throw new InvalidPluginOperationException($"Unable to load {this.Name}, incompatible API level");
|
throw new InvalidPluginOperationException($"Unable to load {this.Name}, incompatible API level");
|
||||||
|
|
||||||
if (this.Manifest.Disabled)
|
if (this.Manifest.Disabled)
|
||||||
|
|
|
||||||
|
|
@ -765,7 +765,7 @@ namespace Dalamud.Plugin.Internal
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// API level
|
// API level
|
||||||
if (manifest.DalamudApiLevel < DalamudApiLevel)
|
if (manifest.DalamudApiLevel < DalamudApiLevel && !this.dalamud.Configuration.LoadAllApiLevels)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Banned
|
// Banned
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue