Пример #1
0
        public override void Replace(string FileName)
        {
            string ext = Utils.GetExtension(FileName);

            if (ext == ".bfmaa")
            {
                MaterialAnim.Import(FileName);
                MaterialAnim.Name = Text;
                LoadAnim(MaterialAnim);
            }
            else if (ext == ".yaml")
            {
                MaterialAnim      = YamlFmaa.FromYaml(FileName);
                MaterialAnim.Name = Text;
                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;
                LoadAnim(MaterialAnim);
            }

            UpdateEditor();
        }
Пример #2
0
        public void Replace(string FileName, ResFile resFile)
        {
            ShaderParamAnim = new ShaderParamAnim();

            string ext = Utils.GetExtension(FileName);

            if (ext == ".bfshu")
            {
                ShaderParamAnim.Import(FileName, resFile, ShaderParamAnimType.ShaderParameter);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }
            else if (ext == ".bfcsh")
            {
                ShaderParamAnim.Import(FileName, resFile, ShaderParamAnimType.Color);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }
            else if (ext == ".bftsh")
            {
                ShaderParamAnim.Import(FileName, resFile, ShaderParamAnimType.TextureSRT);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }
            else if (ext == ".bfmaa")
            {
                var fmaa = new Syroot.NintenTools.NSW.Bfres.MaterialAnim();;
                fmaa.Import(FileName);
                ShaderParamAnim      = BfresPlatformConverter.FSHUConvertSwitchToWiiU(fmaa);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }
            else if (ext == ".yaml")
            {
                var fmaa = new Syroot.NintenTools.NSW.Bfres.MaterialAnim();
                fmaa                 = YamlFmaa.FromYaml(FileName);
                ShaderParamAnim      = BfresPlatformConverter.FSHUConvertSwitchToWiiU(fmaa);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }
            else if (ext == ".clr0")
            {
                ShaderParamAnim      = BrawlboxHelper.FSHUConverter.Clr02Fshu(FileName);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }

            UpdateEditor();
        }
Пример #3
0
        public void Replace(string FileName, ResFile resFile)
        {
            string ext = Utils.GetExtension(FileName);

            if (ext == ".bftxp")
            {
                bool IsSwitch = BfresUtilies.IsSubSectionSwitch(FileName);
                if (IsSwitch)
                {
                    var fmaa = new Syroot.NintenTools.NSW.Bfres.MaterialAnim();
                    fmaa.Import(FileName);
                    TexPatternAnim = BfresPlatformConverter.FTXPConvertSwitchToWiiU(fmaa);
                }
                else
                {
                    TexPatternAnim.Import(FileName, resFile);
                }

                TexPatternAnim.Name = Text;
                LoadAnim(TexPatternAnim);
            }
            else if (ext == ".yaml")
            {
                var fmaa = new Syroot.NintenTools.NSW.Bfres.MaterialAnim();
                fmaa                = YamlFmaa.FromYaml(FileName);
                TexPatternAnim      = BfresPlatformConverter.FTXPConvertSwitchToWiiU(fmaa);
                TexPatternAnim.Name = Text;
                LoadAnim(TexPatternAnim);
            }
            else if (ext == ".gif")
            {
                BFRESGroupNode ftexFolder         = PluginRuntime.ftexContainers[0];
                GifToTexturePatternAnimation anim = new GifToTexturePatternAnimation(FileName, ftexFolder, this);
                TexPatternAnim.Name = Text;
                LoadAnim(TexPatternAnim);
            }
        }