示例#1
0
        private void RenderBox_LeftMouseDown(object sender, MouseEventArgs e)
        {
            if (this.m_mode == MODE.PLACE) // This has to be in front of OnLeftMouseDown
            {
                this.m_GameEngine.SetEntityType(int.Parse(this.Combo_Model.Text.Split(':')[0]));
            }
            else if (this.m_mode == MODE.PLACEBRUSH) // This has to be in front of OnLeftMouseDown
            {
                this.m_GameEngine.SetEntityType(int.Parse(this.ComboBox_Model_Brush.Text.Split(':')[0]));
            }

            m_GameEngine.OnLeftMouseDown((uint)e.X, (uint)e.Y);
            UpdateSaveStatus();

            if (this.m_mode == MODE.SELECT)
            {
                GetAllSelectedInfo();

                // Check if anything has been selected
                int numSelected;
                m_GameEngine.GetNrOfSelectedEntities(out numSelected);

                if (numSelected > 0 && autoSwitchMove)
                {
                    this.m_mode = MODE.MOVE;
                    switchMode();
                    m_GameEngine.ChangeMode((int)m_mode);
                }
            }
            else if (this.m_mode == MODE.MOVE)
            {
                this.m_mode    = MODE.SELECT;
                autoSwitchMove = true;
                switchMode();
                m_GameEngine.ChangeMode((int)m_mode);
                GetAllSelectedInfo();
            }
        }