Esempio n. 1
0
        public override bool HandleMouse(SMouseEvent mouseEvent)
        {
            if (_EditMode == EEditMode.None)
            {
                base.HandleMouse(mouseEvent);
            }

            if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
            {
                if (_Buttons[_ButtonExit].Selected)
                {
                    CGraphics.FadeTo(EScreen.Main);
                }
                else if (_Buttons[_ButtonSave].Selected)
                {
                    _SaveProfiles();
                }
                else if (_Buttons[_ButtonNew].Selected)
                {
                    _NewProfile();
                }
                else if (_Buttons[_ButtonDelete].Selected)
                {
                    _DeleteProfile();
                }
                else if (_Buttons[_ButtonPlayerName].Selected)
                {
                    if (CProfiles.NumProfiles > 0 && _EditMode != EEditMode.PlayerName)
                    {
                        _EditMode = EEditMode.PlayerName;
                    }
                    else
                    {
                        _EditMode = EEditMode.None;
                    }
                }
                else if (_SelectSlides[_SelectSlideDifficulty].Selected)
                {
                    CProfiles.SetDifficulty(_GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag),
                                            (EGameDifficulty)_SelectSlides[_SelectSlideDifficulty].Selection);
                }
                else if (_SelectSlides[_SelectSlideAvatars].Selected)
                {
                    CProfiles.SetAvatar(_GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag),
                                        _SelectSlides[_SelectSlideAvatars].SelectedTag);
                    if (CWebcam.IsDeviceAvailable() && _WebcamTexture != null)
                    {
                        _OnDiscardSnapshot();
                    }
                }
                else if (_SelectSlides[_SelectSlideUserRole].Selected)
                {
                    CProfiles.SetUserRoleProfile(_GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag),
                                                 (EUserRole)_SelectSlides[_SelectSlideUserRole].Selection);
                }
                else if (_SelectSlides[_SelectSlideActive].Selected)
                {
                    CProfiles.SetActive(_GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag),
                                        (EOffOn)_SelectSlides[_SelectSlideActive].Selection);
                }
                else if (_Buttons[_ButtonWebcam].Selected)
                {
                    _OnWebcam();
                }
                else if (_Buttons[_ButtonSaveSnapshot].Selected)
                {
                    _OnSaveSnapshot();
                }
                else if (_Buttons[_ButtonDiscardSnapshot].Selected)
                {
                    _OnDiscardSnapshot();
                }
                else if (_Buttons[_ButtonTakeSnapshot].Selected)
                {
                    _OnTakeSnapshot();
                }
            }

            if (mouseEvent.RB)
            {
                CGraphics.FadeTo(EScreen.Main);
            }
            return(true);
        }