Example #1
0
        public void TestConvertAndBuildMmo()
        {
            var resPath = Path.Combine(Environment.CurrentDirectory, @"..\..\Res");
            var path    = Path.Combine(resPath, "dx_e-moteショコラ小ex制服b.psb.json");
            var psb     = PsbCompiler.LoadPsbFromJsonFile(path);

            psb.SwitchSpec(PsbSpec.krkr);
            psb.Merge();
            //File.WriteAllBytes(Path.Combine(resPath, "neko-krkr.psb"), psb.Build());
            //return;
            MmoBuilder mmoBuilder = new MmoBuilder(true);
            var        psbMmo     = mmoBuilder.Build(psb);

            psbMmo.Merge();
            File.WriteAllBytes(Path.Combine(resPath, "mmo", "DxNekoCrash.mmo"), psbMmo.Build());
        }
Example #2
0
        public void TestMmoGraft()
        {
            var        resPath    = Path.Combine(Environment.CurrentDirectory, @"..\..\Res");
            var        path       = Path.Combine(resPath, "template39.json");
            var        path2      = Path.Combine(resPath, "template39-krkr.json");
            var        mmo        = PsbCompiler.LoadPsbFromJsonFile(path);
            var        psb        = PsbCompiler.LoadPsbFromJsonFile(path2);
            MmoBuilder mmoBuilder = new MmoBuilder(true);
            var        psbMmo     = mmoBuilder.Build(psb);
            //mmo.Objects["objectChildren"] = psbMmo.Objects["objectChildren"];
            var data  = (PsbDictionary)mmo.Objects["metaformat"].Children("data");
            var data2 = (PsbDictionary)psbMmo.Objects["metaformat"].Children("data");

            data["bustControlDefinitionList"] = data2["bustControlDefinitionList"];
            mmo.Merge();
            mmo.SaveAsMdfFile(Path.Combine(resPath, "mmo", "temp.mmo"));
        }
Example #3
0
        public void TestBuildMmo()
        {
            var resPath = Path.Combine(Environment.CurrentDirectory, @"..\..\Res");
            var path    = Path.Combine(resPath, "e-mote3.0ショコラパジャマa中-krkr.json");
            //var path = Path.Combine(resPath, "template39-krkr.json");
            var        psb        = PsbCompiler.LoadPsbFromJsonFile(path);
            MmoBuilder mmoBuilder = new MmoBuilder(true);

            //Add custom menu paths
            mmoBuilder.CustomPartMenuPaths.Add("スカート", "胴体/スカート");
            mmoBuilder.CustomPartMenuPaths.Add("前髪_le1", "頭部/前髪1");
            mmoBuilder.CustomPartMenuPaths.Add("後髪_le4", "頭部/後髪4");
            mmoBuilder.CustomPartMenuPaths.Add("後髪_le5", "頭部/後髪5");

            var psbMmo = mmoBuilder.Build(psb);

            psbMmo.Merge();
            File.WriteAllBytes(Path.Combine(resPath, "mmo", "NekoCrash.mmo"), psbMmo.Build());
        }
Example #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("FreeMote MMO Decompiler (Preview)");
            Console.WriteLine("by Ulysses, [email protected]");
            FreeMount.Init();
            Console.WriteLine();
            Console.WriteLine("This is a preview version. If it crashes, send the PSB to me.");
            Console.WriteLine("All output files from this tool should follow [CC BY-NC-SA 4.0] license. Agree this license by pressing Enter:");
            Console.ReadLine();
            if (args.Length < 1 || !File.Exists(args[0]))
            {
                return;
            }

            PSB psb = null;

            try
            {
                psb = new PSB(args[0]);
            }
            catch (Exception e)
            {
                Console.WriteLine("Input PSB is invalid.");
            }

            if (psb != null)
            {
                psb.FixMotionMetadata(); //Fix for partial exported PSB
                if (psb.Platform != PsbSpec.krkr)
                {
                    if (psb.Platform == PsbSpec.common || psb.Platform == PsbSpec.win)
                    {
                        psb.SwitchSpec(PsbSpec.krkr);
                        psb.Merge();
                    }
                    else
                    {
                        Console.WriteLine(
                            $"EmtMake do not support {psb.Platform} PSB. Please use pure krkr PSB.");
                        goto END;
                    }
                }
#if !DEBUG
                try
#endif
                {
                    MmoBuilder builder = new MmoBuilder();
                    var        output  = builder.Build(psb);
                    output.Merge();
                    File.WriteAllBytes(Path.ChangeExtension(args[0], ".FreeMote.mmo"), output.Build());
                }
#if !DEBUG
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
#endif
            }

END:
            Console.WriteLine("Done.");
            Console.ReadLine();
        }