示例#1
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (gb.ReadByte(lastAddress + 4) == 0xFF)
     {
         MessageBox.Show("Unable to continue. End of warp data for that group.", "Cannot Advance");
         return;
     }
     if ((primaryWarp.opcode & 0x80) != 0)
     {
         if (MessageBox.Show("The next warp will not be read by the current map. Continue anyway?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.No)
         {
             return;
         }
     }
     fillWarp(warpLoader.loadWarp(lastAddress + 4));
     lastAddress += 4;
 }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool dungeon = new MinimapCreator(gb).dungeon(cboArea.SelectedIndex, game);

            mapLoader.loadMap((int)nMap.Value, new MinimapCreator(gb).getRealMapGroup(cboArea.SelectedIndex, game), 0, true, game);
            bool sideMap = isSidemap(mapLoader.room);

            this.sideMap = sideMap;
            if (!sideMap)
            {
                groupBox3.Visible = false;
                int address = warpLoader.getWarpHeaderAddress(getRealMapGroup(cboArea.SelectedIndex), (int)nMap.Value, new MinimapCreator(gb).dungeon(cboArea.SelectedIndex, game), flag2, game);
                lastAddress = address;
                if (address == -1)
                {
                    groupBox1.Visible = false;
                    groupBox2.Visible = false;
                    button5.Enabled   = false;
                    if (!dungeon)
                    {
                        MessageBox.Show("No warp for that map found. To add one, find\nan existing warp on the same group\nand change the index.", "No Warp Found");
                    }
                    else
                    {
                        MessageBox.Show("No warp for that map found. Either find an\nexisting warp and replace it or have the warp\nlead directly to the underlying or above room.", "No Warp Found");
                    }
                    return;
                }

                Warp w = warpLoader.loadWarp(address);
                w.srcGroup      = (byte)cboArea.SelectedIndex;
                button5.Enabled = true;
                loadedWarp      = w;

                if ((w.opcode & 0x40) != 0)
                {
                    groupBox2.Text    = "Warp Header - 0x" + address.ToString("X");
                    groupBox1.Visible = false;
                    groupBox2.Visible = true;
                    nFType.Value      = w.opcode;
                    nFMap.Value       = w.map;
                    nPointer.Value    = 0x10000 + w.fpointer;
                }
                else
                {
                    groupBox1.Text    = "Warp Header - 0x" + address.ToString("X");
                    groupBox2.Visible = false;
                    groupBox1.Visible = true;
                    nType.Value       = w.opcode;
                    nSrcMap.Value     = w.map;
                    nWarp.Value       = w.index;
                    nDestGroup.Value  = w.group;
                    nEntrance.Value   = w.entrance;
                }
            }
            else
            {
                int address = warpLoader.getSideWarpHeaderAddress((new MinimapCreator(gb).getRealMapGroup(cboArea.SelectedIndex, game) == 4 ? 6 : 7), (int)nMap.Value, game);
                lastAddress       = address;
                groupBox1.Visible = false;
                groupBox2.Visible = false;
                if (address == -1)
                {
                    groupBox3.Visible = false;
                    MessageBox.Show("No warp for that map found. To add one, find\nan existing warp on the same group\nand change the values to match the format similar\nto a regular side-map warp.", "No Warp Found");
                    button5.Enabled = false;
                    return;
                }
                button5.Enabled   = true;
                groupBox3.Text    = "Warp Header - 0x" + address.ToString("X");
                groupBox3.Visible = true;
                Warp w = warpLoader.loadSideWarp(address);
                w.srcGroup       = (byte)cboArea.SelectedIndex;
                nX.Value         = w.x;
                nSMap.Value      = w.map;
                nSIndex.Value    = w.index;
                nSGroup.Value    = w.group;
                nSEntrance.Value = w.entrance;
                loadedWarp       = w;
            }
        }