Esempio n. 1
0
        private void switchMode()
        {
            if (this.m_mode == MODE.NONE)
            {
                bnt_None.Focus();
                this.hideAll();
            }
            else if (this.m_mode == MODE.SELECT)
            {
                btn_Select.Focus();
                this.hideAll();
                this.Panel_Info.Show();
                this.Panel_Info.BringToFront();

                this.Panel_SliderPropBars.Show();
                this.Panel_SliderPropBars.SendToBack();
            }
            else if (m_mode == MODE.MOVE)
            {
                btn_Move.Focus();
                this.hideAll();
                this.Panel_Info.Show();
                this.Panel_Info.BringToFront();

                this.Panel_SliderPropBars.Show();
                this.Panel_SliderPropBars.SendToBack();
            }
            else if (this.m_mode == MODE.PLACE)
            {
                btn_PlaceObject.Focus();
                this.hideAll();
                this.Panel_PlaceObject.Show();
                this.Panel_PlaceObject.BringToFront();
            }
            else if (this.m_mode == MODE.LOWER)
            {
                btn_LowerGround.Focus();
                this.hideAll();
                this.Panel_Lower_Raise_Ground.Show();
                this.Panel_Lower_Raise_Ground.BringToFront();

                if (TextBox_BothCircles_Size.Text != "")
                {
                    m_GameEngine.SetBrushAttr("InnerCircle", float.Parse(this.TextBox_BothCircles_Size.Text));
                }

                m_GameEngine.SetBrushAttr("OuterCircle", 0.0f);

                if (TextBox_Strength_RaiseLower.Text != "")
                {
                    m_GameEngine.SetBrushAttr("Strength", float.Parse(this.TextBox_Strength_RaiseLower.Text));
                }
            }
            else if (this.m_mode == MODE.RAISE)
            {
                btn_RaiseGround.Focus();
                this.hideAll();

                this.Panel_Lower_Raise_Ground.Show();
                this.Panel_Lower_Raise_Ground.BringToFront();

                if (TextBox_BothCircles_Size.Text != "")
                {
                    m_GameEngine.SetBrushAttr("InnerCircle", float.Parse(this.TextBox_BothCircles_Size.Text));
                }

                m_GameEngine.SetBrushAttr("OuterCircle", 0.0f);

                if (TextBox_Strength_RaiseLower.Text != "")
                {
                    m_GameEngine.SetBrushAttr("Strength", float.Parse(this.TextBox_Strength_RaiseLower.Text));
                }
            }
            else if (this.m_mode == MODE.PLACEBRUSH)
            {
                btn_PlaceBrush.Focus();
                this.hideAll();

                this.Panel_PlaceBrush.Show();
                this.Panel_PlaceBrush.BringToFront();

                if (TextBox_BrushPlace_Inner.Text != "")
                {
                    m_GameEngine.SetBrushAttr("InnerCircle", float.Parse(this.TextBox_BrushPlace_Inner.Text));
                }

                m_GameEngine.SetBrushAttr("OuterCircle", 0.0f);

                if (TextBox_StrengthCircle.Text != "")
                {
                    m_GameEngine.SetBrushAttr("Strength", float.Parse(this.TextBox_StrengthCircle.Text));
                }
            }
            else if (this.m_mode == MODE.DRAWTEX)
            {
                btn_DrawTex.Focus();
                this.hideAll();

                this.Panel_Tex_Picker.Show();
                this.Panel_Tex_Picker.BringToFront();
                if (textBox_InnerCircle_Terrain.Text != "")
                {
                    m_GameEngine.SetBrushAttr("InnerCircle", float.Parse(textBox_InnerCircle_Terrain.Text));
                }
                if (textBox_OuterCircle_Terrain.Text != "")
                {
                    m_GameEngine.SetBrushAttr("OuterCircle", float.Parse(textBox_OuterCircle_Terrain.Text));
                }
                if (TextBox_Terrain_Strength.Text != "")
                {
                    m_GameEngine.SetBrushAttr("Strength", float.Parse(TextBox_Terrain_Strength.Text));
                }
            }
            else if (this.m_mode == MODE.SMOOTH)
            {
                this.btn_Smooth.Focus();
                this.hideAll();

                this.Panel_SmoothTool.Show();
                this.Panel_SmoothTool.BringToFront();
                if (TextBox_InnerCircle_Smooth.Text != "")
                {
                    m_GameEngine.SetBrushAttr("InnerCircle", float.Parse(TextBox_InnerCircle_Smooth.Text));
                }
                if (TextBox_OuterCircle_Smooth.Text != "")
                {
                    m_GameEngine.SetBrushAttr("OuterCircle", float.Parse(TextBox_OuterCircle_Smooth.Text));
                }
                if (TextBox_Strength_Smooth.Text != "")
                {
                    m_GameEngine.SetBrushAttr("Strength", float.Parse(TextBox_Strength_Smooth.Text));
                }
            }

            else if (this.m_mode == MODE.DELETEENTITIES)
            {
                this.btn_DeleteEntity.Focus();
                this.hideAll();

                this.panel_DeleteCircle.Show();
                this.panel_DeleteCircle.BringToFront();

                if (TextBox_DeleteCircle_Inner.Text != "")
                {
                    m_GameEngine.SetBrushAttr("InnerCircle", float.Parse(TextBox_DeleteCircle_Inner.Text));
                }

                m_GameEngine.SetBrushAttr("OuterCircle", 0.0f);
            }
            else if (this.m_mode == MODE.RESETGROUND)
            {
                this.btn_ResetGround.Focus();
                this.hideAll();

                this.panel_DeleteCircle.Show();
                this.panel_DeleteCircle.BringToFront();

                if (TextBox_DeleteCircle_Inner.Text != "")
                {
                    m_GameEngine.SetBrushAttr("InnerCircle", float.Parse(TextBox_DeleteCircle_Inner.Text));
                }

                m_GameEngine.SetBrushAttr("OuterCircle", 0.0f);
            }
            else if (this.m_mode == MODE.AIGRID)
            {
                this.btn_AIGrid.Focus();
                this.hideAll();

                this.Panel_AIGrid.Show();
                this.Panel_AIGrid.BringToFront();

                if (TextBox_DeleteCircle_Inner.Text != "")
                {
                    m_GameEngine.SetBrushAttr("InnerCircle", float.Parse(TextBox_AIGrid_Inner.Text));
                }

                m_GameEngine.SetBrushAttr("OuterCircle", 0.0f);
            }
            else if (this.m_mode == MODE.SHUFFLE)
            {
                this.btn_Shuffle.Focus();
                this.hideAll();

                this.Panel_Switch.Show();
                this.Panel_Switch.BringToFront();

                m_GameEngine.SetBrushAttr("InnerCircle", 1.0f);
                m_GameEngine.SetBrushAttr("OuterCircle", 0.0f);
            }
            else if (this.m_mode == MODE.WATER)
            {
                btn_Move.Focus();
                this.hideAll();
            }
        }