feat: still show outdated plugins with a warning

This commit is contained in:
goat 2021-07-15 03:08:02 +02:00
parent dd41c77148
commit 83edcc583f
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 24 additions and 0 deletions

View file

@ -614,6 +614,12 @@ namespace Dalamud.Interface.Internal.Windows
}
}
// Outdated API level
if (plugin.Manifest.DalamudApiLevel < PluginManager.DalamudApiLevel)
{
label += Locs.PluginTitleMod_OutdatedError;
}
if (ImGui.CollapsingHeader($"{label}###Header{index}{plugin.Manifest.InternalName}"))
{
var manifest = plugin.Manifest;
@ -644,6 +650,13 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.TextWrapped(manifest.Description);
}
if (plugin.Manifest.DalamudApiLevel < PluginManager.DalamudApiLevel)
{
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
ImGui.TextWrapped(Locs.PluginBody_Outdated);
ImGui.PopStyleColor();
}
// Available commands (if loaded)
if (plugin.IsLoaded)
{
@ -681,6 +694,9 @@ namespace Dalamud.Interface.Internal.Windows
// Disable everything if the updater is running or another plugin is operating
var disabled = this.updateStatus == OperationStatus.InProgress || this.installStatus == OperationStatus.InProgress;
// Disable everything if the plugin is outdated
disabled = disabled || plugin.Manifest.DalamudApiLevel < PluginManager.DalamudApiLevel;
if (plugin.State == PluginState.InProgress)
{
ImGuiComponents.DisabledButton(Locs.PluginButton_Working);
@ -1062,6 +1078,8 @@ namespace Dalamud.Interface.Internal.Windows
public static string PluginTitleMod_UnloadError => Loc.Localize("InstallerUnloadError", " (unload error)");
public static string PluginTitleMod_OutdatedError => Loc.Localize("InstallerOutdatedError", " (outdated)");
#endregion
#region Plugin context menu
@ -1082,6 +1100,8 @@ namespace Dalamud.Interface.Internal.Windows
public static string PluginBody_DeleteDevPlugin => Loc.Localize("InstallerDeleteDevPlugin ", " To delete this plugin, please remove it from the devPlugins folder.");
public static string PluginBody_Outdated => Loc.Localize("InstallerOutdatedPluginBody ", "This plugin is outdated and incompatible at the moment. Please wait for it to be updated by its author.");
#endregion
#region Plugin buttons

View file

@ -469,6 +469,10 @@ namespace Dalamud.Plugin.Internal
{
Log.Information(ex, $"Dev plugin failed to load, adding anyways: {dllFile.Name}");
}
else if (plugin.Manifest.DalamudApiLevel < DalamudApiLevel)
{
Log.Information(ex, $"Plugin was outdated, adding anyways: {dllFile.Name}");
}
else
{
PluginLocations.Remove(plugin.AssemblyName.FullName);