コード例 #1
0
ファイル: MainWin.cs プロジェクト: calvarado194/layton-rando
        void Compile_Events(string path)
        {
            string fout;
            string fin;

            string mainQuest = path + "MainQuest.xml";

            if (File.Exists(mainQuest))
            {
                fout = pluginHost.Get_TempFile();
                fin  = pluginHost.Search_File(0xF76);
                MQuestText mqc = new MQuestText(pluginHost, fin, 0xF76);
                mqc.Import(mainQuest);
                mqc.Write(fout);
                pluginHost.ChangeFile(0xF76, fout);
            }

            if (Directory.Exists(path + "SubQuest"))
            {
                string[] sub  = Directory.GetFiles(path + "SubQuest", "*.xml", SearchOption.TopDirectoryOnly);
                sFolder  subf = pluginHost.Search_Folder(0xF07E);
                for (int i = 0; i < subf.files.Count; i++)
                {
                    string cfile = Array.Find(sub, a => Path.GetFileNameWithoutExtension(a) == subf.files[i].name);
                    if (cfile == null)
                    {
                        continue;
                    }

                    string tempsub = Save_File(subf.files[i]);
                    fout = pluginHost.Get_TempFile();

                    SQcontrol sqc = new SQcontrol(pluginHost, tempsub, subf.files[i].id);
                    SQ        sq  = sqc.Read(tempsub);
                    sqc.Import_XML(cfile, ref sq);
                    sqc.Write(fout, sq);

                    pluginHost.ChangeFile(subf.files[i].id, fout);
                }
            }

            string scenario = path + "Scenario.xml";

            if (File.Exists(scenario))
            {
                fout = pluginHost.Get_TempFile();
                fin  = pluginHost.Search_File(0xFF2);
                ScenarioText st = new ScenarioText(pluginHost, fin, 0xFF2);
                st.Import(scenario);
                st.Write(fout);
                pluginHost.ChangeFile(0xFF2, fout);
            }

            string system = path + "System.xml";

            if (File.Exists(system))
            {
                fout = pluginHost.Get_TempFile();
                fin  = pluginHost.Search_File(0xFF4);
                SystemText st = new SystemText(fin, 0xFF4, pluginHost);
                st.Import(system);
                st.Write(fout);
                pluginHost.ChangeFile(0xFF4, fout);
            }
        }
コード例 #2
0
ファイル: MainWin.cs プロジェクト: MetLob/tinke
        void Compile_Events(string path)
        {
            string fout;
            string fin;

            string mainQuest = path + "MainQuest.xml";
            if (File.Exists(mainQuest))
            {
                fout = pluginHost.Get_TempFile();
                fin = pluginHost.Search_File(0xF76);
                MQuestText mqc = new MQuestText(pluginHost, fin, 0xF76);
                mqc.Import(mainQuest);
                mqc.Write(fout);
                pluginHost.ChangeFile(0xF76, fout);
            }

            if (Directory.Exists(path + "SubQuest"))
            {
                string[] sub = Directory.GetFiles(path + "SubQuest", "*.xml", SearchOption.TopDirectoryOnly);
                sFolder subf = pluginHost.Search_Folder(0xF07E);
                for (int i = 0; i < subf.files.Count; i++)
                {
                    string cfile = Array.Find(sub, a => Path.GetFileNameWithoutExtension(a) == subf.files[i].name);
                    if (cfile == null)
                        continue;

                    string tempsub = Save_File(subf.files[i]);
                    fout = pluginHost.Get_TempFile();

                    SQcontrol sqc = new SQcontrol(pluginHost, tempsub, subf.files[i].id);
                    SQ sq = sqc.Read(tempsub);
                    sqc.Import_XML(cfile, ref sq);
                    sqc.Write(fout, sq);

                    pluginHost.ChangeFile(subf.files[i].id, fout);
                }
            }

            string scenario = path + "Scenario.xml";
            if (File.Exists(scenario))
            {
                fout = pluginHost.Get_TempFile();
                fin = pluginHost.Search_File(0xFF2);
                ScenarioText st = new ScenarioText(pluginHost, fin, 0xFF2);
                st.Import(scenario);
                st.Write(fout);
                pluginHost.ChangeFile(0xFF2, fout);
            }

            string system = path + "System.xml";
            if (File.Exists(system))
            {
                fout = pluginHost.Get_TempFile();
                fin = pluginHost.Search_File(0xFF4);
                SystemText st = new SystemText(fin, 0xFF4, pluginHost);
                st.Import(system);
                st.Write(fout);
                pluginHost.ChangeFile(0xFF4, fout);
            }
        }