mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-26 06:20:24 +00:00
BXLYT : Support loading textures with different name cases.
This commit is contained in:
parent
426e7440a6
commit
91f4909b1f
1 changed files with 14 additions and 3 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue