diff --git a/Dalamud/Interface/UldWrapper.cs b/Dalamud/Interface/UldWrapper.cs index e78546ed9..127ea85ec 100644 --- a/Dalamud/Interface/UldWrapper.cs +++ b/Dalamud/Interface/UldWrapper.cs @@ -1,10 +1,10 @@ using System.Collections.Generic; +using System.IO; using System.Linq; using Dalamud.Data; using Dalamud.Interface.Internal; using Dalamud.Utility; -using ImGuiScene; using Lumina.Data.Files; using Lumina.Data.Parsing.Uld; @@ -155,20 +155,27 @@ public class UldWrapper : IDisposable // Try to load HD textures first. var hrPath = texturePath.Replace(".tex", "_hr1.tex"); + var substitution = Service.Get(); + hrPath = substitution.GetSubstitutedPath(hrPath); var hd = true; - var file = this.data.GetFile(hrPath); - if (file == null) + var tex = Path.IsPathRooted(hrPath) + ? this.data.GameData.GetFileFromDisk(hrPath) + : this.data.GetFile(hrPath); + if (tex == null) { hd = false; - file = this.data.GetFile(texturePath); + texturePath = substitution.GetSubstitutedPath(texturePath); + tex = Path.IsPathRooted(texturePath) + ? this.data.GameData.GetFileFromDisk(texturePath) + : this.data.GetFile(texturePath); // Neither texture could be loaded. - if (file == null) + if (tex == null) { return null; } } - return (id, file.Header.Width, file.Header.Height, hd, file.GetRgbaImageData()); + return (id, tex.Header.Width, tex.Header.Height, hd, tex.GetRgbaImageData()); } }