feat: add special icon for installed plugins, makes it easier to spot them in the list

This commit is contained in:
goaaats 2022-01-12 18:58:24 +01:00
parent dd2313f7af
commit 0c9f331872
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 16 additions and 3 deletions

View file

@ -58,9 +58,10 @@ namespace Dalamud.Interface.Internal.Windows
var dalamud = Service<Dalamud>.Get();
var interfaceManager = Service<InterfaceManager>.Get();
this.DefaultIcon = interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "defaultIcon.png"));
this.TroubleIcon = interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "troubleIcon.png"));
this.UpdateIcon = interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "updateIcon.png"));
this.DefaultIcon = interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "defaultIcon.png"))!;
this.TroubleIcon = interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "troubleIcon.png"))!;
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.downloadThread = new Thread(this.DownloadTask);
this.downloadThread.Start();
@ -81,12 +82,18 @@ namespace Dalamud.Interface.Internal.Windows
/// </summary>
public TextureWrap UpdateIcon { get; }
/// <summary>
/// Gets the plugin installed icon overlay.
/// </summary>
public TextureWrap InstalledIcon { get; set; }
/// <inheritdoc/>
public void Dispose()
{
this.DefaultIcon?.Dispose();
this.TroubleIcon?.Dispose();
this.UpdateIcon?.Dispose();
this.InstalledIcon?.Dispose();
this.downloadToken?.Cancel();

View file

@ -1072,6 +1072,12 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.Image(this.imageCache.TroubleIcon.ImGuiHandle, iconSize);
ImGui.SameLine();
}
else if (plugin != null)
{
ImGui.SetCursorPos(cursorBeforeImage);
ImGui.Image(this.imageCache.InstalledIcon.ImGuiHandle, iconSize);
ImGui.SameLine();
}
ImGuiHelpers.ScaledDummy(5);
ImGui.SameLine();