Exemple #1
0
        private void paletteBox_MouseDown(object sender, MouseEventArgs e)
        {
            int px = e.X / (8 * zoom);

            if (!modal && e.Button == MouseButtons.Right && px >= 0 && px < 16)
            {
                int         ro  = 16 + (1024 * me.room) + 0x3E0 + px;
                byte        old = mp.rom[ro];
                PalettePick p   = new PalettePick(old & 63);
                p.StartPosition = FormStartPosition.CenterParent;
                if (p.ShowDialog() == DialogResult.OK)
                {
                    byte np = (byte)p.picked;
                    if (mp.rom_modify(ro, np))
                    {
                        mp.refresh_map(me.room);
                        me.cache();
                        me.redraw(); // not covered by refresh_map
                        me.redraw_info();
                        redraw();
                    }
                }
            }
            else
            {
                paletteBox_MouseMove(sender, e);
            }
        }
Exemple #2
0
        private void defaultItemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int item = comboBox.SelectedIndex;

            if (item < 0 || item >= 9)
            {
                return;
            }
            int eo = 16 + (1024 * me.room) + 0x320 + (item * 16);

            mp.rom_modify_start();
            byte[] DEFAULT_MONSTER = { 0x51, 0x03, 0x00, 0x00, 0x0D, 0x01, 0x5D, 0x02, 0x02, 0x01 }; // 0,0 default Meta Black
            mp.rom_modify_range(eo, DEFAULT_MONSTER);
            redraw();
            me.redraw();
            mp.refresh_map(me.room);
            me.redraw_info();
        }