pi: don't show the "frown" button for outdated plugins

This commit is contained in:
goat 2024-07-03 18:55:36 +02:00
parent 25b10c1c62
commit 4df929ec9f

View file

@ -2922,12 +2922,12 @@ internal class PluginInstallerWindow : Window, IDisposable
var inSingleNonDefaultProfileWhichIsDisabled =
isInSingleProfile && !profilesThatWantThisPlugin.First().IsEnabled;
if (plugin.State is PluginState.UnloadError or PluginState.LoadError or PluginState.DependencyResolutionFailed && !plugin.IsDev)
if (plugin.State is PluginState.UnloadError or PluginState.LoadError or PluginState.DependencyResolutionFailed && !plugin.IsDev && !plugin.IsOutdated)
{
ImGuiComponents.DisabledButton(FontAwesomeIcon.Frown);
ImGuiComponents.DisabledToggleButton(toggleId, false);
if (ImGui.IsItemHovered())
ImGui.SetTooltip(Locs.PluginButtonToolTip_UnloadFailed);
ImGui.SetTooltip(Locs.PluginButtonToolTip_LoadUnloadFailed);
}
else if (this.enableDisableStatus == OperationStatus.InProgress && this.enableDisableWorkingPluginId == plugin.EffectiveWorkingPluginId)
{
@ -4000,7 +4000,7 @@ internal class PluginInstallerWindow : Window, IDisposable
public static string PluginButtonToolTip_UpdateSingle(string version) => Loc.Localize("InstallerUpdateSingle", "Update to {0}").Format(version);
public static string PluginButtonToolTip_UnloadFailed => Loc.Localize("InstallerLoadUnloadFailedTooltip", "Plugin load/unload failed, please restart your game and try again.");
public static string PluginButtonToolTip_LoadUnloadFailed => Loc.Localize("InstallerLoadUnloadFailedTooltip", "Plugin load/unload failed, please restart your game and try again.");
public static string PluginButtonToolTip_NeedsToBeInDefault => Loc.Localize("InstallerUnloadNeedsToBeInDefault", "This plugin is in one or more collections. If you want to enable or disable it, please do so by enabling or disabling the collections it is in.\nIf you want to manage it manually, remove it from all collections.");