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

View file

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