BXLYT : Support loading textures with different name cases.

This commit is contained in:
KillzXGaming 2020-09-18 17:59:55 -04:00
parent 426e7440a6
commit 91f4909b1f

View file

@ -87,12 +87,23 @@ namespace LayoutBXLYT
if (bxlyt.Textures.Count > 0) if (bxlyt.Textures.Count > 0)
{ {
var textures = bxlyt.GetTextures; var textures = bxlyt.GetTextures;
foreach (var tex in textures) foreach (var tex in bxlyt.Textures)
if (!Textures.ContainsKey(tex.Key)) {
Textures.Add(tex.Key, tex.Value); //Some games use different cases for archives
string lowerCase = tex.ToLower();
if (textures.ContainsKey(tex))
AddTexture(tex, textures[tex]);
else if (textures.ContainsKey(lowerCase))
AddTexture(tex, textures[lowerCase]);
}
} }
} }
private void AddTexture(string name, STGenericTexture tex) {
if (!Textures.ContainsKey(name))
Textures.Add(name, tex);
}
public override void OnControlClosing() public override void OnControlClosing()
{ {
foreach (var tex in LayoutFile.Textures) foreach (var tex in LayoutFile.Textures)