feat(PluginInstaller): add special icon for third + installed

This commit is contained in:
goaaats 2022-01-18 04:12:23 +01:00
parent 641dc83bd1
commit f9da69b47c
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 16 additions and 1 deletions

View file

@ -63,6 +63,7 @@ namespace Dalamud.Interface.Internal.Windows
this.UpdateIcon = interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "updateIcon.png"))!;
this.InstalledIcon = interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "installedIcon.png"))!;
this.ThirdIcon = interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "thirdIcon.png"))!;
this.ThirdInstalledIcon = interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "thirdInstalledIcon.png"))!;
this.downloadThread = new Thread(this.DownloadTask);
this.downloadThread.Start();
@ -93,6 +94,11 @@ namespace Dalamud.Interface.Internal.Windows
/// </summary>
public TextureWrap ThirdIcon { get; }
/// <summary>
/// Gets the installed third party plugin icon overlay.
/// </summary>
public TextureWrap ThirdInstalledIcon { get; }
/// <inheritdoc/>
public void Dispose()
{
@ -101,6 +107,7 @@ namespace Dalamud.Interface.Internal.Windows
this.UpdateIcon?.Dispose();
this.InstalledIcon?.Dispose();
this.ThirdIcon?.Dispose();
this.ThirdInstalledIcon?.Dispose();
this.downloadToken?.Cancel();

View file

@ -1062,6 +1062,8 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.Image(iconTex.ImGuiHandle, iconSize);
ImGui.SameLine();
var isLoaded = plugin is { IsLoaded: true };
if (updateAvailable)
{
ImGui.SetCursorPos(cursorBeforeImage);
@ -1074,13 +1076,19 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.Image(this.imageCache.TroubleIcon.ImGuiHandle, iconSize);
ImGui.SameLine();
}
else if (isLoaded && isThirdParty)
{
ImGui.SetCursorPos(cursorBeforeImage);
ImGui.Image(this.imageCache.ThirdInstalledIcon.ImGuiHandle, iconSize);
ImGui.SameLine();
}
else if (isThirdParty)
{
ImGui.SetCursorPos(cursorBeforeImage);
ImGui.Image(this.imageCache.ThirdIcon.ImGuiHandle, iconSize);
ImGui.SameLine();
}
else if (plugin is { IsLoaded: true })
else if (isLoaded)
{
ImGui.SetCursorPos(cursorBeforeImage);
ImGui.Image(this.imageCache.InstalledIcon.ImGuiHandle, iconSize);