Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pack"></param>
        /// <param name="fighter"></param>
        /// <param name="mexData"></param>
        private static void ExtractFiles(ZipFile pack, MEXFighterEntry fighter, MexDataEditor mexData)
        {
            Console.WriteLine($"Copying files to directory...");

            var root = Path.GetDirectoryName(MainForm.Instance.FilePath);

            foreach (var e in pack)
            {
                var fileName = Path.GetFileName(e.FileName);

                if (Regex.IsMatch(fileName, @"Pl...dat") ||
                    Regex.IsMatch(fileName, @"Pl..AJ.dat") ||
                    Regex.IsMatch(fileName, @"GmRstM...dat") ||
                    Regex.IsMatch(fileName, @"Pl..DViWaitAJ.dat") ||
                    Regex.IsMatch(fileName, @"Kirby/PlKbCp...dat") ||
                    Regex.IsMatch(fileName, @"Costume/.*"))
                {
                    File.WriteAllBytes(Path.Combine(root, Path.GetFileName(fileName)), GetBytes(e));
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fighter"></param>
        /// <param name="editor"></param>
        /// <param name="internalID"></param>
        private void RemoveUI(MEXFighterEntry fighter, MexDataEditor editor, int internalID)
        {
            Console.WriteLine("Removing UI");
            var root    = Path.GetDirectoryName(MainForm.Instance.FilePath);
            int GroupID = MEXIdConverter.ToExternalID(internalID, editor.FighterControl.FighterEntries.Count + 1) - 1;
            int stride  = editor.FighterControl.FighterEntries.Count - 3 + 1;


            Console.WriteLine("Removing CSP");

            /*var chrSelPath = Path.Combine(root, "MnSlChr.usd");
             * if (File.Exists(chrSelPath))
             * {
             *  var cssFile = new HSDRawFile(chrSelPath);
             *
             *  if (cssFile.Roots[0].Data is SBM_SelectChrDataTable cssTable)
             *  {
             *      foreach (var n in cssTable.SingleMenuMaterialAnimation.Children[9].Children)
             *          RemoveMatAnim(n.MaterialAnimation.TextureAnimation, GroupID, stride, FighterPackageInstaller.MAX_COSTUME_COUNT);
             *
             *      foreach (var n in cssTable.MenuMaterialAnimation.Children[6].Children)
             *          RemoveMatAnim(n.MaterialAnimation.TextureAnimation, GroupID, stride, FighterPackageInstaller.MAX_COSTUME_COUNT);
             *
             *      foreach (var n in cssTable.SingleMenuMaterialAnimation.Children[6].Children)
             *          RemoveMatAnim(n.MaterialAnimation.TextureAnimation, GroupID, stride, FighterPackageInstaller.MAX_COSTUME_COUNT);
             *
             *      foreach (var n in cssTable.PortraitMaterialAnimation.Children[2].Children)
             *          RemoveMatAnim(n.MaterialAnimation.TextureAnimation, GroupID, stride, FighterPackageInstaller.MAX_COSTUME_COUNT);
             *
             *
             *      foreach (var n in cssTable.MenuMaterialAnimation.Children[5].Children)
             *          RemoveMatAnim(n.MaterialAnimation.Next.TextureAnimation, GroupID, stride, 1);
             *
             *      foreach (var n in cssTable.SingleMenuMaterialAnimation.Children[5].Children)
             *          RemoveMatAnim(n.MaterialAnimation.Next.TextureAnimation, GroupID, stride, 1);
             *
             *      foreach (var n in cssTable.PortraitMaterialAnimation.Children[1].Children)
             *          RemoveMatAnim(n.MaterialAnimation.Next.TextureAnimation, GroupID, stride, 1);
             *
             *  }
             *
             *  editedFiles.Add(new Tuple<HSDRawFile, string, bool>(cssFile, chrSelPath, true));
             * }*/


            Console.WriteLine("Removing Icons");
            var ifallPath = Path.Combine(root, "IfAll.usd");

            if (File.Exists(ifallPath))
            {
                var datFile = new HSDRawFile(ifallPath);

                var mark = datFile.Roots.Find(e => e.Name.Equals("Stc_scemdls")).Data as HSDNullPointerArrayAccessor <HSD_JOBJDesc>;

                for (int i = 0; i < 7; i++) // first 7
                {
                    RemoveMatAnim(mark[0].MaterialAnimations[0].Children[i].MaterialAnimation.TextureAnimation, GroupID, stride, FighterPackageInstaller.MAX_COSTUME_COUNT);
                }


                var emblemGroup = datFile.Roots.Find(e => e.Name.Equals("DmgMrk_scene_models")).Data as HSDNullPointerArrayAccessor <HSD_JOBJDesc>;

                RemoveMatAnim(emblemGroup[0].MaterialAnimations[0].Child.MaterialAnimation.TextureAnimation, GroupID, stride, 1);


                editedFiles.Add(new Tuple <HSDRawFile, string, bool>(datFile, ifallPath, true));
            }


            Console.WriteLine("Removing Result UI");
            var gmrst = Path.Combine(root, "GmRst.usd");

            if (File.Exists(gmrst))
            {
                var datFile = new HSDRawFile(gmrst);

                var flmsce = datFile.Roots.Find(e => e.Name.Equals("flmsce")).Data as HSD_SOBJ;
                var pnlsce = datFile.Roots.Find(e => e.Name.Equals("pnlsce")).Data as HSD_SOBJ;

                // remove stock icons
                for (int i = 5; i <= 8; i++) // at 5-8, 2nd mat anim
                {
                    RemoveMatAnim(pnlsce.JOBJDescs[0].MaterialAnimations[0].Children[i].MaterialAnimation.Next.TextureAnimation,
                                  GroupID,
                                  stride,
                                  FighterPackageInstaller.MAX_COSTUME_COUNT);
                }

                // remove emblem entries
                var matgroup = pnlsce.JOBJDescs[0].MaterialAnimations[0].Children[17];

                for (int i = 0; i < 4; i++)
                {
                    RemoveMatAnim(matgroup.Children[i].MaterialAnimation.TextureAnimation, GroupID, stride, 1);
                }


                // check if any other fighter is using this stock icon
                // if not, remove it and adjust ids
                if (!editor.FighterControl.FighterEntries.Any(e => e.InsigniaID == fighter.InsigniaID))
                {
                    var emblemGroup = flmsce.JOBJDescs[0];

                    emblemGroup.JointAnimations[0].Children[4].RemoveChildAt(fighter.InsigniaID);
                    emblemGroup.MaterialAnimations[0].Children[4].RemoveChildAt(fighter.InsigniaID);
                    emblemGroup.RootJoint.Children[4].RemoveChildAt(fighter.InsigniaID);

                    foreach (var f in editor.FighterControl.FighterEntries)
                    {
                        if (f.InsigniaID > fighter.InsigniaID)
                        {
                            f.InsigniaID--;
                        }
                    }
                }


                // name textures
                var largenameGroup = pnlsce.JOBJDescs[0].MaterialAnimations[0].Children[0].Children[2].MaterialAnimation.Next.TextureAnimation;

                RemoveMatAnim(largenameGroup, GroupID, stride, 1);

                var smallnameGroup = pnlsce.JOBJDescs[0].MaterialAnimations[0];

                for (int i = 9; i < 13; i++)
                {
                    RemoveMatAnim(smallnameGroup.Children[i].Children[1].MaterialAnimation.TextureAnimation, GroupID, stride, 1);
                }

                editedFiles.Add(new Tuple <HSDRawFile, string, bool>(datFile, gmrst, true));
            }
        }
Esempio n. 3
0
 public FighterPackageUninstaller(int internalID, MEXFighterEntry fighter, MexDataEditor editor)
 {
     this.internalID = internalID;
     this.fighter    = fighter;
     this.editor     = editor;
 }
Esempio n. 4
0
 public FighterPackageInstaller(string packagePage, MexDataEditor editor)
 {
     this.packagePath = packagePage;
     this.editor      = editor;
 }