Inheritance: System.Windows.Forms.Form
Exemplo n.º 1
0
        private void pictureLevel_MouseDown(object sender, MouseEventArgs e)
        {
            int Divx, Divy, Divyi;

            Divx = (e.X / 16);
            Divy = (e.Y / 16);

            LX = Divx * 16;
            LY = Divy * 16;
            //PutBox(LX, LY, CurrentImageIndex);

            Divyi = (MainImage.Height / 16) - (Divy + 1);

            if (e.Button == MouseButtons.Left)
            {
                LevelEditorObject le = CheckPosition(Divx, Divyi);
                if (le == null)
                {
                    le   = new LevelEditorObject((LevelEditorObject)list.Items[CurrentImageIndex].Tag);
                    le.x = Divx;
                    le.y = Divyi;
                    Objects.Add(le);
                }
                else
                {
                    if (le.ParamTypes != null)
                    {
                        FormParams PR = new FormParams(le);
                        PR.ShowDialog();
                        if (PR.Update)
                        {
                            le = PR.MainObject;
                        }
                        PR.Dispose();
                    }
                }
            }
            if (e.Button == MouseButtons.Right)
            {
                LevelEditorObject le = CheckPosition(Divx, Divyi);
                if (le != null)
                {
                    Objects.Remove(le);
                    pictureLevel.Invalidate();
                }
            }
        }
Exemplo n.º 2
0
        private void pictureLevel_MouseDown(object sender, MouseEventArgs e)
        {
            int Divx, Divy, Divyi;

            Divx = (e.X / 16);
            Divy = (e.Y / 16);

            LX = Divx * 16;
            LY = Divy * 16;
            //PutBox(LX, LY, CurrentImageIndex);

            Divyi = (MainImage.Height / 16) - (Divy + 1);

            if (e.Button == MouseButtons.Left)
            {
                LevelEditorObject le = CheckPosition(Divx, Divyi);
                if (le == null)
                {
                    le = new LevelEditorObject((LevelEditorObject)list.Items[CurrentImageIndex].Tag);
                    le.x = Divx;
                    le.y = Divyi;
                    Objects.Add(le);
                }
                else
                {
                    if (le.ParamTypes != null)
                    {
                        FormParams PR = new FormParams(le);
                        PR.ShowDialog();
                        if (PR.Update)
                            le = PR.MainObject;
                        PR.Dispose();
                    }

                }
            }
            if (e.Button == MouseButtons.Right)
            {
                LevelEditorObject le = CheckPosition(Divx, Divyi);
                if (le != null)
                {
                    Objects.Remove(le);
                    pictureLevel.Invalidate();
                }

            }
        }