feat: add orphaned plugins regardless, inform users in installer

This commit is contained in:
goat 2022-07-03 18:02:46 +02:00
parent 12722c776d
commit ce8e088044
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5
2 changed files with 29 additions and 7 deletions

View file

@ -1180,6 +1180,12 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
ImGui.PopStyleColor(); ImGui.PopStyleColor();
} }
else if (plugin is { IsOrphaned: true })
{
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
ImGui.TextWrapped(Locs.PluginBody_Orphaned);
ImGui.PopStyleColor();
}
else if (plugin is { State: PluginState.LoadError or PluginState.DependencyResolutionFailed }) // Load failed warning else if (plugin is { State: PluginState.LoadError or PluginState.DependencyResolutionFailed }) // Load failed warning
{ {
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed); ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
@ -1517,6 +1523,13 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
trouble = true; trouble = true;
} }
// Orphaned
if (plugin.IsOrphaned)
{
label += Locs.PluginTitleMod_OrphanedError;
trouble = true;
}
ImGui.PushID($"installed{index}{plugin.Manifest.InternalName}"); ImGui.PushID($"installed{index}{plugin.Manifest.InternalName}");
var hasChangelog = !plugin.Manifest.Changelog.IsNullOrEmpty(); var hasChangelog = !plugin.Manifest.Changelog.IsNullOrEmpty();
@ -1691,6 +1704,9 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
// Disable everything if the plugin is outdated // Disable everything if the plugin is outdated
disabled = disabled || (plugin.IsOutdated && !configuration.LoadAllApiLevels) || plugin.IsBanned; disabled = disabled || (plugin.IsOutdated && !configuration.LoadAllApiLevels) || plugin.IsBanned;
// Disable everything if the plugin is orphaned
disabled = disabled || plugin.IsOrphaned;
// Disable everything if the plugin failed to load // Disable everything if the plugin failed to load
disabled = disabled || plugin.State == PluginState.LoadError || plugin.State == PluginState.DependencyResolutionFailed; disabled = disabled || plugin.State == PluginState.LoadError || plugin.State == PluginState.DependencyResolutionFailed;
@ -1904,7 +1920,7 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
private void DrawDeletePluginButton(LocalPlugin plugin) private void DrawDeletePluginButton(LocalPlugin plugin)
{ {
var unloaded = plugin.State == PluginState.Unloaded; var unloaded = plugin.State == PluginState.Unloaded;
var showButton = unloaded && (plugin.IsDev || plugin.IsOutdated || plugin.IsBanned); var showButton = unloaded && (plugin.IsDev || plugin.IsOutdated || plugin.IsBanned || plugin.IsOrphaned);
if (!showButton) if (!showButton)
return; return;
@ -2265,6 +2281,8 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
public static string PluginTitleMod_BannedError => Loc.Localize("InstallerBannedError", " (automatically disabled)"); public static string PluginTitleMod_BannedError => Loc.Localize("InstallerBannedError", " (automatically disabled)");
public static string PluginTitleMod_OrphanedError => Loc.Localize("InstallerOrphanedError", " (unknown repository)");
public static string PluginTitleMod_New => Loc.Localize("InstallerNewPlugin ", " New!"); public static string PluginTitleMod_New => Loc.Localize("InstallerNewPlugin ", " New!");
#endregion #endregion
@ -2299,6 +2317,8 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
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."); 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.");
public static string PluginBody_Orphaned => Loc.Localize("InstallerOrphanedPluginBody ", "This plugin's source repository is no longer available. You may need to reinstall it from its repository, or re-add the repository.");
public static string PluginBody_LoadFailed => Loc.Localize("InstallerLoadFailedPluginBody ", "This plugin failed to load. Please contact the author for more information."); public static string PluginBody_LoadFailed => Loc.Localize("InstallerLoadFailedPluginBody ", "This plugin failed to load. Please contact the author for more information.");
public static string PluginBody_Banned => Loc.Localize("InstallerBannedPluginBody ", "This plugin was automatically disabled due to incompatibilities and is not available at the moment. Please wait for it to be updated by its author."); public static string PluginBody_Banned => Loc.Localize("InstallerBannedPluginBody ", "This plugin was automatically disabled due to incompatibilities and is not available at the moment. Please wait for it to be updated by its author.");

View file

@ -658,11 +658,8 @@ internal partial class PluginManager : IDisposable, IServiceType
manifest.Testing = true; manifest.Testing = true;
} }
if (repoManifest.SourceRepo.IsThirdParty) // Document the url the plugin was installed from
{ manifest.InstalledFromUrl = repoManifest.SourceRepo.PluginMasterUrl;
// Only document the url if it came from a third party repo.
manifest.InstalledFromUrl = repoManifest.SourceRepo.PluginMasterUrl;
}
manifest.Save(manifestFile); manifest.Save(manifestFile);
@ -740,9 +737,14 @@ internal partial class PluginManager : IDisposable, IServiceType
} }
else if (plugin.IsOutdated) else if (plugin.IsOutdated)
{ {
// Out of date plugins get added so they can be updated. // Out of date plugins get added, so they can be updated.
Log.Information(ex, $"Plugin was outdated, adding anyways: {dllFile.Name}"); Log.Information(ex, $"Plugin was outdated, adding anyways: {dllFile.Name}");
} }
else if (plugin.IsOrphaned)
{
// Orphaned plugins get added, so that users aren't confused.
Log.Information(ex, $"Plugin was orphaned, adding anyways: {dllFile.Name}");
}
else if (isBoot) else if (isBoot)
{ {
// During boot load, plugins always get added to the list so they can be fiddled with in the UI // During boot load, plugins always get added to the list so they can be fiddled with in the UI