Exemplo n.º 1
0
        public void loadTransports()
        {
            for (int i = 0; i < 0x11; i++)
            {
                short[] e = new short[13];
                e[0]  = (byte)(((ROM.IMPORTDATA[Constants.OWExitMapIdWhirlpool + (i * 2) + 1] << 8) + (ROM.IMPORTDATA[Constants.OWExitMapIdWhirlpool + (i * 2)])));
                e[1]  = (short)((ROM.IMPORTDATA[Constants.OWExitVramWhirlpool + (i * 2) + 1] << 8) + (ROM.IMPORTDATA[Constants.OWExitVramWhirlpool + (i * 2)]));
                e[2]  = (short)((ROM.IMPORTDATA[Constants.OWExitYScrollWhirlpool + (i * 2) + 1] << 8) + (ROM.IMPORTDATA[Constants.OWExitYScrollWhirlpool + (i * 2)]));
                e[3]  = (short)((ROM.IMPORTDATA[Constants.OWExitXScrollWhirlpool + (i * 2) + 1] << 8) + (ROM.IMPORTDATA[Constants.OWExitXScrollWhirlpool + (i * 2)]));
                e[4]  = (short)((ROM.IMPORTDATA[Constants.OWExitYPlayerWhirlpool + (i * 2) + 1] << 8) + (ROM.IMPORTDATA[Constants.OWExitYPlayerWhirlpool + (i * 2)]));
                e[5]  = (short)((ROM.IMPORTDATA[Constants.OWExitXPlayerWhirlpool + (i * 2) + 1] << 8) + (ROM.IMPORTDATA[Constants.OWExitXPlayerWhirlpool + (i * 2)]));
                e[6]  = (short)((ROM.IMPORTDATA[Constants.OWExitYCameraWhirlpool + (i * 2) + 1] << 8) + (ROM.IMPORTDATA[Constants.OWExitYCameraWhirlpool + (i * 2)]));
                e[7]  = (short)((ROM.IMPORTDATA[Constants.OWExitXCameraWhirlpool + (i * 2) + 1] << 8) + (ROM.IMPORTDATA[Constants.OWExitXCameraWhirlpool + (i * 2)]));
                e[8]  = (byte)((ROM.IMPORTDATA[Constants.OWExitUnk1Whirlpool + i]));
                e[9]  = (byte)((ROM.IMPORTDATA[Constants.OWExitUnk2Whirlpool + i]));
                e[10] = (short)((ROM.IMPORTDATA[Constants.OWWhirlpoolPosition + (i * 2) + 1] << 8) + (ROM.IMPORTDATA[Constants.OWWhirlpoolPosition + (i * 2)]));
                if (i > 8)
                {
                    e[10] = (short)((ROM.IMPORTDATA[Constants.OWWhirlpoolPosition + ((i - 9) * 2) + 1] << 8) + (ROM.IMPORTDATA[Constants.OWWhirlpoolPosition + ((i - 9) * 2)]));
                }


                TransportOW eo = (new TransportOW((byte)e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], (byte)e[8], (byte)e[9], e[10]));
                ow.allWhirlpools.Add(eo);
            }
        }
Exemplo n.º 2
0
        public void Draw(Graphics g)
        {
            int   transparency = 200;
            Brush bgrBrush     = new SolidBrush(Color.FromArgb(transparency, 48, 188, 142));
            Pen   contourPen   = new Pen(Color.FromArgb(transparency, 0, 0, 0));

            g.CompositingMode = CompositingMode.SourceOver;
            for (int i = 0; i < scene.ow.allWhirlpools.Count; i++)
            {
                TransportOW e = scene.ow.allWhirlpools[i];

                if (e.mapId < 64 + scene.ow.worldOffset && e.mapId >= scene.ow.worldOffset)
                {
                    if (selectedTransport != null)
                    {
                        if (e == selectedTransport)
                        {
                            bgrBrush = new SolidBrush(Color.FromArgb((int)transparency, 0, 55, 240));
                            scene.drawText(g, e.playerX - 1, e.playerY + 16, "map : " + e.mapId.ToString());
                            //scene.drawText(g, e.playerX - 1, e.playerY + 26, "entrance : " + e.mapId.ToString());
                            scene.drawText(g, e.playerX - 4, e.playerY + 36, "mpos : " + e.vramLocation.ToString());
                        }
                        else
                        {
                            bgrBrush = new SolidBrush(Color.FromArgb((int)transparency, 255, 200, 16));
                        }
                    }

                    g.FillRectangle(bgrBrush, new Rectangle(e.playerX, e.playerY, 16, 16));
                    g.DrawRectangle(contourPen, new Rectangle(e.playerX, e.playerY, 16, 16));
                    if (i > 8)
                    {
                        scene.drawText(g, e.playerX + 4, e.playerY + 4, i.ToString("X2") + " - Whirlpool");
                    }
                    else
                    {
                        scene.drawText(g, e.playerX + 4, e.playerY + 4, i.ToString("X2") + " - Flute");
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void onMouseUp(MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (selectedTransport != null)
                {
                    lastselectedTransport = selectedTransport;
                    selectedTransport     = null;
                    scene.mouse_down      = false;
                }
            }
            else if (e.Button == MouseButtons.Right)
            {
                for (int i = 0; i < 0x11; i++)
                {
                    TransportOW en = scene.ow.allWhirlpools[i];
                    if (en.mapId >= scene.ow.worldOffset && en.mapId < 64 + scene.ow.worldOffset)
                    {
                        if (e.X >= en.playerX && e.X < en.playerX + 16 && e.Y >= en.playerY && e.Y < en.playerY + 16)
                        {
                            ContextMenuStrip menu = new ContextMenuStrip();
                            menu.Items.Add("Whirlpool Properties");
                            lastselectedTransport = en;
                            selectedTransport     = null;
                            scene.mouse_down      = false;

                            if (lastselectedTransport == null)
                            {
                                menu.Items[0].Enabled = false;
                            }

                            menu.Items[0].Click += exitProperty_Click;
                            menu.Show(Cursor.Position);
                        }
                    }
                }
                //scene.Invalidate(new Rectangle((scene.owForm.splitContainer1.Panel2.HorizontalScroll.Value), (scene.owForm.splitContainer1.Panel2.VerticalScroll.Value), (scene.owForm.splitContainer1.Panel2.Width), (scene.owForm.splitContainer1.Panel2.Height)));
            }
        }
Exemplo n.º 4
0
 public void onMouseDown(MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         for (int i = 0; i < 0x11; i++)
         {
             TransportOW en = scene.ow.allWhirlpools[i];
             if (en.mapId >= scene.ow.worldOffset && en.mapId < 64 + scene.ow.worldOffset)
             {
                 if (e.X >= en.playerX && e.X < en.playerX + 16 && e.Y >= en.playerY && e.Y < en.playerY + 16)
                 {
                     if (scene.mouse_down == false)
                     {
                         selectedTransport     = en;
                         lastselectedTransport = en;
                         scene.Invalidate(new Rectangle(scene.mainForm.panel5.HorizontalScroll.Value, scene.mainForm.panel5.VerticalScroll.Value, scene.mainForm.panel5.Width, scene.mainForm.panel5.Height));
                         scene.mouse_down = true;
                     }
                 }
             }
         }
     }
 }