Skip to content

Commit 27e0d6e

Browse files
authored
Merge pull request #27 from goaaats/hi-res
Add Hi-Res texture support to XivUi
2 parents d8e8f66 + 56c5a0e commit 27e0d6e

File tree

1 file changed

+25
-3
lines changed
  • xivModdingFramework/Items/DataContainers

1 file changed

+25
-3
lines changed

xivModdingFramework/Items/DataContainers/XivUi.cs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ public class XivUi : IItem
7777
/// </summary>
7878
public int IconNumber { get; set; }
7979

80+
/// <summary>
81+
/// Whether or not this file has a hi-res equivalent
82+
/// </summary>
83+
public bool HasHiRes { get; private set; }
8084

8185
/// <summary>
8286
/// Gets the item's name as it should be written to the modlist/modpack files.
@@ -119,9 +123,12 @@ public override int GetHashCode()
119123
return this.Name.GetHashCode() ^ this.IconNumber.GetHashCode();
120124
}
121125

126+
private const string HiResUiExt = "_hr1";
122127

123-
public async Task<Dictionary<string, string>> GetTexPaths()
128+
public async Task<Dictionary<string, string>> GetTexPaths(bool addLowRes, bool addHiRes)
124129
{
130+
var resPaths = new Dictionary<string, string>();
131+
125132
if(SecondaryCategory == XivStrings.Maps)
126133
{
127134
var _tex = new Tex(XivCache.GameInfo.GameDirectory);
@@ -131,14 +138,29 @@ public async Task<Dictionary<string, string>> GetTexPaths()
131138
} else if(SecondaryCategory == XivStrings.HUD)
132139
{
133140
//ui/uld/aozactionlearned.tex
134-
return new Dictionary<string, string>() { { Name, "ui/uld/" + Name.ToLower() + ".tex" } };
141+
HasHiRes = true;
142+
143+
if (addLowRes)
144+
resPaths.Add(Name, "ui/uld/" + Name.ToLower() + ".tex");
145+
146+
if (addHiRes)
147+
resPaths.Add(Name, "ui/uld/" + Name.ToLower() + HiResUiExt + ".tex");
135148
}
136149
else
137150
{
151+
HasHiRes = true;
152+
138153
var block = ((IconNumber / 1000) * 1000).ToString().PadLeft(6,'0');
139154
var icon = IconNumber.ToString().PadLeft(6, '0');
140-
return new Dictionary<string, string>() { { Name, "ui/icon/" + block + '/' + icon + ".tex" } };
155+
156+
if (addLowRes)
157+
resPaths.Add(Name, "ui/icon/" + block + '/' + icon + ".tex");
158+
159+
if (addLowRes)
160+
resPaths.Add(Name, "ui/icon/" + block + '/' + icon + HiResUiExt + ".tex");
141161
}
162+
163+
return resPaths;
142164
}
143165
}
144166
}

0 commit comments

Comments
 (0)