feat: add option to clear image cache to Plugin menu

This commit is contained in:
goat 2021-08-23 02:04:54 +02:00
parent 4921c289e0
commit 029f798b91
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 16 additions and 0 deletions

View file

@ -496,6 +496,11 @@ namespace Dalamud.Interface.Internal
this.OpenPluginInstaller();
}
if (ImGui.MenuItem("Clear cached images/icons"))
{
this.pluginWindow?.ClearIconCache();
}
ImGui.Separator();
if (ImGui.MenuItem("Open Plugin Stats"))

View file

@ -164,6 +164,17 @@ namespace Dalamud.Interface.Internal.Windows
this.DrawErrorModal();
}
/// <summary>
/// Clear the cache of downloaded icons.
/// </summary>
public void ClearIconCache()
{
this.pluginIconMap.Clear();
this.pluginImagesMap.Clear();
this.DownloadPluginIcons();
}
private static Vector2 GetButtonSize(string text) => ImGui.CalcTextSize(text) + (ImGui.GetStyle().FramePadding * 2);
private void DrawHeader()