Esempio n. 1
0
        //リストが拡張されたとき
        void AddressListExpandsEvent(object sender, EventArgs arg)
        {
            InputFormRef.ExpandsEventArgs eearg = (InputFormRef.ExpandsEventArgs)arg;
            uint addr  = eearg.NewBaseAddress;
            int  count = (int)eearg.NewDataCount;

            //戦闘アニメーションを0クリアしておきます。トラブルを避けるため
            //クラスIDもちゃんと割り振ろう
            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "ClearBattleAnimationPointer");
            addr = addr + (eearg.OldDataCount * eearg.BlockSize);
            for (int i = (int)eearg.OldDataCount; i < count; i++)
            {
                //クラスID
                Program.ROM.write_u8(addr + 4, (uint)i, undodata);

                //戦闘アニメクリア
                Program.ROM.write_u32(addr + 52, 0, undodata);

                addr += eearg.BlockSize;
            }

            if (Program.ROM.RomInfo.version() == 8)
            {
                CCBranchForm.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);
            }
            if (Program.ROM.RomInfo.is_multibyte())
            {
                OPClassAlphaNameForm.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);
            }
            //移動アイコンはクラスIDと連動しているので増設しないといけない.
            ImageUnitMoveIconFrom.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);

            Program.Undo.Push(undodata);
        }
Esempio n. 2
0
        //リストが拡張されたとき
        void AddressListExpandsEvent(object sender, EventArgs arg)
        {
            InputFormRef.ExpandsEventArgs eearg = (InputFormRef.ExpandsEventArgs)arg;
            uint addr  = eearg.NewBaseAddress;
            int  count = (int)eearg.NewDataCount;

            //戦闘アニメーションを0クリアしておきます。トラブルを避けるため
            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "ClearBattleAnimationPointer");
            addr = addr + ((eearg.OldDataCount - 1) * eearg.BlockSize);            //-1は class は 0x00から始まるため
            for (int i = (int)eearg.OldDataCount - 1; i < count; i++)
            {
                //クラスID
                Program.ROM.write_u8(addr + 4, (uint)i, undodata);

                //戦闘アニメクリア
                Program.ROM.write_u32(addr + 48, 0, undodata);
                addr += eearg.BlockSize;
            }
            //移動アイコンはクラスIDと連動しているので増設しないといけない.
            ImageUnitMoveIconFrom.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);

            Program.Undo.Push(undodata);
        }