Example #1
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            int tileX  = (e.X / 16);
            int tileY  = (e.Y / 16);
            int superX = (tileX / 32);
            int superY = (tileY / 32);
            int mapId  = (superY * 8) + superX;

            globalmouseTileDownX = tileX;
            globalmouseTileDownY = tileY;
            selectedMap          = mapId;
            updateMapGfx();

            if (selectedMode == ObjectMode.Tile)
            {
                tilemode.OnMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Exits)
            {
                exitmode.onMouseDown(e);
            }
            else if (selectedMode == ObjectMode.OWDoor)
            {
                doorMode.OnMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Entrances)
            {
                entranceMode.onMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Itemmode)
            {
                itemMode.onMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Spritemode)
            {
                spriteMode.onMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Flute)
            {
                transportMode.onMouseDown(e);
            }
            Invalidate(new Rectangle(mainForm.panel5.HorizontalScroll.Value, mainForm.panel5.VerticalScroll.Value, mainForm.panel5.Width, mainForm.panel5.Height));
            base.OnMouseDown(e);
        }
Example #2
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            int tileX  = (e.X / 16);
            int tileY  = (e.Y / 16);
            int superX = (tileX / 32);
            int superY = (tileY / 32);
            int mapId  = (superY * 8) + superX;

            globalmouseTileDownX = tileX;
            globalmouseTileDownY = tileY;

            mainForm.anychange = true;
            selectedMap        = mapId;


            owForm.previewTextPicturebox.Visible = false;
            updateMapGfx();
            owForm.updateTiles();

            if (selectedMode == ObjectMode.Tile)
            {
                tilemode.OnMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Overlay)
            {
                overlayMode.OnMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Exits)
            {
                exitmode.onMouseDown(e);
            }
            else if (selectedMode == ObjectMode.OWDoor)
            {
                doorMode.OnMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Entrances)
            {
                entranceMode.onMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Itemmode)
            {
                itemMode.onMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Spritemode)
            {
                spriteMode.onMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Flute)
            {
                transportMode.onMouseDown(e);
            }
            else if (selectedMode == ObjectMode.Gravestone)
            {
                gravestoneMode.onMouseDown(e);
            }

            if (lowEndMode)
            {
                int x = ow.allmaps[selectedMap].parent % 8;
                int y = ow.allmaps[selectedMap].parent / 8;
                if (!ow.allmaps[ow.allmaps[selectedMap].parent].largeMap)
                {
                    Invalidate(new Rectangle(x * 512, y * 512, 512, 512));
                }
                else
                {
                    Invalidate(new Rectangle(x * 512, y * 512, 1024, 1024));
                }
            }
            else
            {
                Invalidate(new Rectangle(owForm.splitContainer1.Panel2.HorizontalScroll.Value, owForm.splitContainer1.Panel2.VerticalScroll.Value, owForm.splitContainer1.Panel2.Width, owForm.splitContainer1.Panel2.Height));
            }



            base.OnMouseDown(e);
        }