1
0
mirror of synced 2025-01-31 12:23:52 +01:00

Add type extension on replace

This commit is contained in:
KillzXGaming 2019-07-14 10:08:06 -04:00
parent 8051af0c28
commit c9584baf33
5 changed files with 22 additions and 3 deletions

Binary file not shown.

View File

@ -24,6 +24,25 @@ namespace Bfres.Structs
private static readonly string VisibiltyAnimType = "_fvm";
private static readonly string VisibiltyAnimType2 = "_vm";
public string GetTypeExtension()
{
if (Parent == null)
return "";
BFRESGroupNode AnimFolder = (BFRESGroupNode)Parent;
switch (AnimFolder.Type)
{
case BRESGroupType.TexPatAnim: return TexturePatternAnimType;
case BRESGroupType.ShaderParamAnim: return ShaderParamAnimType;
case BRESGroupType.TexSrtAnim: return TextureSrtAnimType;
case BRESGroupType.ColorAnim: return ColorAnimType;
case BRESGroupType.MatVisAnim: return VisibiltyAnimType;
default:
return "";
}
}
public static bool IsShaderParamAnimation(string name) {
return name.Contains(ShaderParamAnimType) ||
name.Contains(ShaderParamAnimType2);
@ -709,20 +728,20 @@ namespace Bfres.Structs
if (ext == ".bfmaa")
{
MaterialAnim.Import(FileName);
MaterialAnim.Name = Text;
MaterialAnim.Name = Text + GetTypeExtension();
LoadAnim(MaterialAnim);
}
else if (ext == ".yaml")
{
MaterialAnim = YamlFmaa.FromYaml(FileName);
MaterialAnim.Name = Text;
MaterialAnim.Name = Text + GetTypeExtension();
LoadAnim(MaterialAnim);
}
else if (ext == ".gif" || ext == ".png" || ext == ".apng")
{
BNTX bntx = PluginRuntime.bntxContainers[0];
GifToTexturePatternAnimation anim = new GifToTexturePatternAnimation(FileName, bntx, this);
MaterialAnim.Name = Text;
MaterialAnim.Name = Text + GetTypeExtension();
LoadAnim(MaterialAnim);
}
}