コード例 #1
0
ファイル: EditorSWSH.cs プロジェクト: exgile/pkNX
        private void PopWildEdit(string file)
        {
            IFileContainer fp         = ROM.GetFile(GameFile.NestData);
            var            data_table = new GFPack(fp[0]);
            var            sdo        = data_table.GetDataFileName($"encount_symbol_{file}.bin");
            var            hdo        = data_table.GetDataFileName($"encount_{file}.bin");
            var            s          = FlatBufferConverter.DeserializeFrom <EncounterArchive8>(sdo);
            var            h          = FlatBufferConverter.DeserializeFrom <EncounterArchive8>(hdo);

            while (s.EncounterTables[0].SubTables.Length != 9)
            {
                s = FlatBufferConverter.DeserializeFrom <EncounterArchive8>(sdo);
                h = FlatBufferConverter.DeserializeFrom <EncounterArchive8>(hdo);
            }

            using var form = new SSWE(ROM, s, h);
            form.ShowDialog();
            if (!form.Modified)
            {
                return;
            }

            var sd = FlatBufferConverter.SerializeFrom(s);
            var hd = FlatBufferConverter.SerializeFrom(h);

            data_table.SetDataFileName($"encount_symbol_{file}.bin", sd);
            data_table.SetDataFileName($"encount_{file}.bin", hd);

            fp[0] = data_table.Write();
        }
コード例 #2
0
        private void PopWildEdit(string file)
        {
            IFileContainer fp         = ROM.GetFile(GameFile.NestData);
            var            data_table = new GFPack(fp[0]);
            var            s          = FlatBufferConverter.DeserializeFrom <EncounterArchive8>(data_table.GetDataFileName($"encount_symbol_{file}.bin"));
            var            h          = FlatBufferConverter.DeserializeFrom <EncounterArchive8>(data_table.GetDataFileName($"encount_{file}.bin"));

            using var form = new SSWE(ROM, s, h);
            form.ShowDialog();

            var sd = FlatBufferConverter.SerializeFrom(s);
            var hd = FlatBufferConverter.SerializeFrom(s);

            data_table.SetDataFileName($"encount_symbol_{file}.bin", sd);
            data_table.SetDataFileName($"encount_{file}.bin", hd);

            fp[0] = data_table.Write();
        }