Get textures in the active bfres first for texture pattern animations to avoid conflicts
This commit is contained in:
parent
46c7141486
commit
c02e248a7b
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -499,19 +499,28 @@ namespace Bfres.Structs
|
|||||||
|
|
||||||
public override STGenericTexture GetActiveTexture(int index)
|
public override STGenericTexture GetActiveTexture(int index)
|
||||||
{
|
{
|
||||||
|
string name = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
name = MatAnimWrapper.Textures[(int)index];
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw new Exception("Index out of range " + index);
|
||||||
|
}
|
||||||
|
|
||||||
|
var bfres = (BFRES)MatAnimWrapper.Parent.Parent.Parent;
|
||||||
|
var BfresTextures = bfres.GetBNTX;
|
||||||
|
if (BfresTextures != null)
|
||||||
|
{
|
||||||
|
if (BfresTextures.Textures.ContainsKey(name))
|
||||||
|
return BfresTextures.Textures[name];
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var bntx in PluginRuntime.bntxContainers)
|
foreach (var bntx in PluginRuntime.bntxContainers)
|
||||||
{
|
{
|
||||||
try
|
if (bntx.Textures.ContainsKey(name))
|
||||||
{
|
return bntx.Textures[name];
|
||||||
string name = MatAnimWrapper.Textures[(int)index];
|
|
||||||
|
|
||||||
if (bntx.Textures.ContainsKey(name))
|
|
||||||
return bntx.Textures[name];
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw new Exception("Index out of range " + index);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -149,6 +149,15 @@ namespace Bfres.Structs
|
|||||||
public override STGenericTexture GetActiveTexture(int index)
|
public override STGenericTexture GetActiveTexture(int index)
|
||||||
{
|
{
|
||||||
string name = GetActiveTextureNameByIndex(index);
|
string name = GetActiveTextureNameByIndex(index);
|
||||||
|
|
||||||
|
var bfres = (BFRES)AnimWrapper.Parent.Parent.Parent;
|
||||||
|
var BfresTextures = bfres.GetFTEXContainer;
|
||||||
|
if (BfresTextures != null)
|
||||||
|
{
|
||||||
|
if (BfresTextures.ResourceNodes.ContainsKey(name))
|
||||||
|
return (STGenericTexture)BfresTextures.ResourceNodes[name];
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var ftexFolder in PluginRuntime.ftexContainers)
|
foreach (var ftexFolder in PluginRuntime.ftexContainers)
|
||||||
{
|
{
|
||||||
if (ftexFolder.ResourceNodes.ContainsKey(name))
|
if (ftexFolder.ResourceNodes.ContainsKey(name))
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user