mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 12:33:12 +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)
|
||||
{
|
||||
var textures = bxlyt.GetTextures;
|
||||
foreach (var tex in textures)
|
||||
if (!Textures.ContainsKey(tex.Key))
|
||||
Textures.Add(tex.Key, tex.Value);
|
||||
foreach (var tex in bxlyt.Textures)
|
||||
{
|
||||
//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()
|
||||
{
|
||||
foreach (var tex in LayoutFile.Textures)
|
||||
|
|
Loading…
Reference in a new issue