Beispiel #1
0
        void btnTab_OnPress(object sender, ButtonEventArgs e)
        {
            for (int i = 0; i < btnTabs.Count; i++)
            {
                if (btnTabs[i] != ((CommandCenterGeneralButton)sender)) //not the button that launched the event
                {
                    if (btnTabs[i].IsPressed)                           //and currently pressed (previosly selected)
                    {
                        btnTabs[i].ReleaseButton();                     //it is released
                        //hides the previously selected button's page
                        spritePages[i].FrameNumber = 0;
                        spritePages[i].Visible     = false;

                        if (i == 3)//the btnTab4 is the one that is currently pressed
                        {
                            tab4Scrollbar.Hide();
                        }
                    }
                }
                else // the button that Launched the Event
                {
                    spritePages[i].Visible = true;

                    if (i == 3)//the btnTab4 launched the event
                    {
                        tab4Scrollbar.Show();
                    }
                }
            }
        }
        /// <summary>
        /// Shows the indicated submenu's options
        /// </summary>
        void ShowSubmenuButtonOptions(int generalButtonIndex, int submenuButtonIndex)
        {
            switch (generalButtonIndex)
            {
            case 0:     //Game
                switch (submenuButtonIndex)
                {
                case 1:         //SaveGame
                    btnSave.Show();
                    AutosaveSprite.Visible = true;
                    AutosaveScrollbar.Show();
                    AutosaveTime.Visible = true;
                    break;

                case 2:         //Difficulty
                    rbnEasy.Show();
                    rbnMedium.Show();
                    rbnHard.Show();
                    break;
                }
                break;

            case 1:     //Video
                switch (submenuButtonIndex)
                {
                case 1:         //ResolutionIndex
                    Resolution.Visible = true;
                    ResolutionIndicator.Show();
                    break;

                case 2:         //FullScreen
                    rbnFullScreenOn.Show();
                    rbnFullScreenOff.Show();
                    break;
                }
                break;

            case 2:     //Audio
                switch (submenuButtonIndex)
                {
                case 1:         //Volume
                    VolumeIndicator.Show();
                    VolumeValueSprite.Visible = true;
                    break;

                case 2:         //Sound
                    rbnSoundOn.Show();
                    rbnSoundOff.Show();
                    break;
                }
                break;

            case 3:     //Controls
                switch (submenuButtonIndex)
                {
                case 1:         //Mouse
                    CameraSpeedSprite.Visible      = true;
                    CameraSpeedValueSprite.Visible = true;
                    CameraSpeedIndicator.Show();
                    break;

                case 2:         //Keyboard
                    btnKeyShortcuts.Show();
                    break;
                }
                break;
            }
        }