Update Combos.

This commit is contained in:
Ottermandias 2024-02-12 23:32:45 +01:00
parent 95d5d6c4b0
commit d2bfcefb89
6 changed files with 19 additions and 36 deletions

View file

@ -32,7 +32,8 @@ public static class TextureDrawer
if (texture.LoadError is DllNotFoundException)
{
ImGuiUtil.TextColored(Colors.RegexWarningBorder, "A texture handling dependency could not be found. Try installing a current Microsoft VC Redistributable.");
ImGuiUtil.TextColored(Colors.RegexWarningBorder,
"A texture handling dependency could not be found. Try installing a current Microsoft VC Redistributable.");
if (ImGui.Button("Microsoft VC Redistributables"))
Dalamud.Utility.Util.OpenLink(link);
ImGuiUtil.HoverTooltip($"Open {link} in your browser.");
@ -111,14 +112,12 @@ public static class TextureDrawer
}
}
public sealed class PathSelectCombo : FilterComboCache<(string Path, bool Game, bool IsOnPlayer)>
public sealed class PathSelectCombo(TextureManager textures, ModEditor editor, Func<ISet<string>> getPlayerResources)
: FilterComboCache<(string Path, bool Game, bool IsOnPlayer)>(() => CreateFiles(textures, editor, getPlayerResources),
MouseWheelType.None, Penumbra.Log)
{
private int _skipPrefix = 0;
public PathSelectCombo(TextureManager textures, ModEditor editor, Func<ISet<string>> getPlayerResources)
: base(() => CreateFiles(textures, editor, getPlayerResources), Penumbra.Log)
{ }
protected override string ToString((string Path, bool Game, bool IsOnPlayer) obj)
=> obj.Path;
@ -140,7 +139,8 @@ public static class TextureDrawer
return ret;
}
private static IReadOnlyList<(string Path, bool Game, bool IsOnPlayer)> CreateFiles(TextureManager textures, ModEditor editor, Func<ISet<string>> getPlayerResources)
private static IReadOnlyList<(string Path, bool Game, bool IsOnPlayer)> CreateFiles(TextureManager textures, ModEditor editor,
Func<ISet<string>> getPlayerResources)
{
var playerResources = getPlayerResources();