Esempio n. 1
0
        //マップ変化のベース領域の強制割り当て
        public static uint PreciseChangeListForce(uint mapid)
        {
            MapPointerNewPLISTPopupForm f = (MapPointerNewPLISTPopupForm)InputFormRef.JumpFormLow <MapPointerNewPLISTPopupForm>();

            f.Init(MapPointerForm.PLIST_TYPE.CHANGE);
            DialogResult dr = f.ShowDialog();

            if (dr != System.Windows.Forms.DialogResult.OK)
            {
                return(0);
            }

            uint plist = f.GetSelectPLIST();

            Undo.UndoData undodata = Program.Undo.NewUndoData("Precise MapChange", mapid.ToString("X"));

            byte[] data = new byte[12];
            data[0] = 0xFF; //終端.
            uint write_addr = InputFormRef.AppendBinaryData(data, undodata);

            if (write_addr == U.NOT_FOUND)
            {
                Program.Undo.Rollback(undodata);
                return(0);
            }
            bool r = MapPointerForm.Write_Plsit(MapPointerForm.PLIST_TYPE.CHANGE, plist, write_addr, undodata);

            if (!r)
            {
                Program.Undo.Rollback(undodata);
                return(0);
            }
            r = MapSettingForm.WriteMapChangePlist(mapid, plist, undodata);
            if (!r)
            {
                Program.Undo.Rollback(undodata);
                return(0);
            }

            Program.Undo.Push(undodata);

            return(plist);
        }