Beispiel #1
0
        public BinaryFormat Convert(Po source)
        {
            //Check if the dictionary exist
            if (System.IO.File.Exists("TextArea.map"))
            {
                PB.BP.DictionaryEnabled = true;
                PB.BP.GenerateFontMap("TextArea.map");
            }
            PoLine = 0;
            var Bfs = new BinaryFormat2Script();

            Result = Bfs.Convert(new BinaryFormat(FileName));

            Source = source;
            GetBlockScript();
            FileStream = new DataStream();
            Writer     = new DataWriter(FileStream);
            GenerateFile();

            return(new BinaryFormat(Writer.Stream));
        }
Beispiel #2
0
        public static void ExportDat(string name, string path, string outFile)
        {
            var  nodo   = NodeFactory.FromFile(path); //BinaryFormat
            Node nodoPo = null;
            IConverter <BinaryFormat, Po> nodeConverter = null;

            Console.WriteLine(@"Exporting " + name + @"...");
            switch (name)
            {
            //Disgaea 1
            case "TALK.DAT":
                nodeConverter = new TALKDAT.Binary2Po();
                break;

            case "SCRIPT.DAT":
                IConverter <BinaryFormat, SCRIPT.DAT.SCRIPT> scriptConverter = new SCRIPT.DAT.BinaryFormat2Script();
                Node nodoScript = nodo.Transform(scriptConverter);
                IConverter <SCRIPT.DAT.SCRIPT, Po> poConverter = new SCRIPT.DAT.Script2po();
                nodoPo = nodoScript.Transform(poConverter);
                break;

            case "CHAR_E.DAT":
                nodeConverter = new DAT.Binary2po_CHAR_E();
                break;

            case "CHARHELP.DAT":
                nodeConverter = new DAT.Binary2po_CHARHELP();
                break;

            case "DUNGEON.DAT":
                nodeConverter = new DAT.Binary2po_DUNGEON();
                break;

            case "GE.DAT":
                nodeConverter = new DAT.Binary2po_GE();
                break;

            case "GEOCUBE.DAT":
                nodeConverter = new DAT.Binary2po_GEOCUBE();
                break;

            case "HABIT.DAT":
                nodeConverter = new DAT.Binary2po_HABIT();
                break;

            case "MAGIC.DAT":
                nodeConverter = new DAT.Binary2po_MAGIC();
                break;

            case "MITEM.DAT":
                nodeConverter = new DAT.Binary2po_MITEM();
                break;

            case "MUSICSHOP.DAT":
                nodeConverter = new DAT.Binary2po_MUSICSHOP();
                break;

            case "THIEF.DAT":
                nodeConverter = new DAT.Binary2po_THIEF();
                break;

            case "WISH.DAT":
                nodeConverter = new DAT.Binary2po_WISH();
                break;

            case "ZUKAN.DAT":
                nodeConverter = new DAT.Binary2po_ZUKAN();
                break;

            default:
                throw new DatNotSupported();
            }
            if (name != "SCRIPT.DAT")
            {
                nodoPo = nodo.Transform(nodeConverter);
            }
            nodoPo?.Transform <Po2Binary, Po, BinaryFormat>().Stream.WriteTo(outFile);
        }