From 9538af05541fb037cf1e5db3126da5f2cc663b61 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Sat, 3 Jan 2026 20:46:48 +0100 Subject: [PATCH] UldWidget fixes (#2557) * Fix missing directory separator in theme path * Hide themed texture exception when file not found * Check ThemeSupportBitmask --- .../Windows/Data/Widgets/UldWidget.cs | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/UldWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/UldWidget.cs index 56ed45446..7c8110301 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/UldWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/UldWidget.cs @@ -47,6 +47,7 @@ internal class UldWidget : IDataWindowWidget ("48 8D 15 ?? ?? ?? ?? 45 33 C0 E9 ?? ?? ?? ??", 3) ]; + private DataManager dataManager; private CancellationTokenSource? cts; private Task? uldNamesTask; @@ -69,6 +70,8 @@ internal class UldWidget : IDataWindowWidget /// public void Load() { + this.dataManager ??= Service.Get(); + this.cts?.Cancel(); ClearTask(ref this.uldNamesTask); this.uldNamesTask = null; @@ -264,7 +267,7 @@ internal class UldWidget : IDataWindowWidget } private string ToThemedPath(string path) => - UldBaseBath + (this.selectedTheme > 0 ? $"img{this.selectedTheme:D2}" : string.Empty) + path[UldBaseBath.Length..]; + UldBaseBath + (this.selectedTheme > 0 ? $"img{this.selectedTheme:D2}/" : string.Empty) + path[UldBaseBath.Length..]; private void DrawTextureEntry(UldRoot.TextureEntry textureEntry, TextureManager textureManager) { @@ -292,14 +295,17 @@ internal class UldWidget : IDataWindowWidget else if (e is not null) ImGui.Text(e.ToString()); - if (this.selectedTheme != 0) + if (this.selectedTheme != 0 && (textureEntry.ThemeSupportBitmask & (1 << (this.selectedTheme - 1))) != 0) { var texturePathThemed = this.ToThemedPath(texturePath); - ImGui.Text($"Themed path at {texturePathThemed}:"); - if (textureManager.Shared.GetFromGame(texturePathThemed).TryGetWrap(out wrap, out e)) - ImGui.Image(wrap.Handle, wrap.Size); - else if (e is not null) - ImGui.Text(e.ToString()); + if (this.dataManager.FileExists(texturePathThemed)) + { + ImGui.Text($"Themed path at {texturePathThemed}:"); + if (textureManager.Shared.GetFromGame(texturePathThemed).TryGetWrap(out wrap, out e)) + ImGui.Image(wrap.Handle, wrap.Size); + else if (e is not null) + ImGui.Text(e.ToString()); + } } ImGui.EndTooltip();