From 949a6072ce5846aa522c2130185dbe669dc96c51 Mon Sep 17 00:00:00 2001 From: Raymond Date: Wed, 22 Sep 2021 19:34:23 -0400 Subject: [PATCH] Allow devIcons to load images from the manifest --- .../Internal/Windows/PluginInstallerWindow.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs index f663cd168..beb5e0253 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs @@ -205,11 +205,11 @@ namespace Dalamud.Interface.Internal.Windows return MainRepoImageUrl.Format(isTesting ? "testing" : "plugins", manifest.InternalName, "icon.png"); } - private static List GetPluginImageUrls(PluginManifest manifest, bool isThirdParty, bool isTesting) + private static List? GetPluginImageUrls(PluginManifest manifest, bool isThirdParty, bool isTesting) { if (isThirdParty) { - if (manifest.ImageUrls.Count > 5) + if (manifest.ImageUrls?.Count > 5) { Log.Warning($"Plugin {manifest.InternalName} has too many images"); return manifest.ImageUrls.Take(5).ToList(); @@ -1802,7 +1802,9 @@ namespace Dalamud.Interface.Internal.Windows Log.Verbose($"Plugin icon for {manifest.InternalName} loaded from disk"); } - return; + // Dev plugins are likely going to look like a main repo plugin, the InstalledFrom field is going to be null. + // So instead, set the value manually so we download from the urls specified. + isThirdParty = true; } var useTesting = pluginManager.UseTesting(manifest); @@ -1885,8 +1887,9 @@ namespace Dalamud.Interface.Internal.Windows } } - // Dev plugins are loaded from disk only - return; + // Dev plugins are likely going to look like a main repo plugin, the InstalledFrom field is going to be null. + // So instead, set the value manually so we download from the urls specified. + isThirdParty = true; } var useTesting = pluginManager.UseTesting(manifest);