예제 #1
0
        /// <summary>
        /// Execution of Player´s choise in HighscoreMenu and Option
        /// </summary>
        public void selection(string ButtonName, string SubMenu)
        {
            switch (SubMenu)
            {
                #region Highscore
            case "Highscore":
            {
                if (ButtonName.Equals("Löschen"))
                {
                    prompt = new Prompt(game, "Reset", game.Graphics.Device.Viewport.Width,
                                        game.Graphics.Device.Viewport.Height,
                                        new string[] { "Delete the Highscorestates?" }, false);
                    prompt.accept  += new PromptEventHandler(HSReset);
                    prompt.decline += new PromptEventHandler(nothing);
                    prompt.intiateButtons();
                    menu.HighscoreMenu.Active = false;
                }
                else
                {
                    menu.CurrentMenu   = "Highscore";
                    menu.HighscoreMenu = null;
                    menu.Visiblity     = true;
                }
                break;
            }
                #endregion

                #region Optionen
            case "Optionen":
            {
                switch (ButtonName)
                {
                case "Akzeptieren":
                {
                    OptionList changer = (OptionList)menu.OptionMenu.Dialog.list;
                    if (changer.controlChanges())
                    {
                        prompt = new Prompt(game, "Save", game.Graphics.Device.Viewport.Width,
                                            game.Graphics.Device.Viewport.Height,
                                            new string[] { "Save the values?" }, false);
                        prompt.accept  += new PromptEventHandler(Save);
                        prompt.decline += new PromptEventHandler(nothingOpt);
                        prompt.intiateButtons();
                        menu.OptionMenu.Activity = false;
                    }
                    else
                    {
                        discardChanges();
                    }
                    break;
                }

                case "Ablehnen":
                {
                    discardChanges();
                    break;
                }

                case "Playername":
                {
                    prompt = new Prompt(game, "Playername", game.Graphics.Device.Viewport.Width,
                                        game.Graphics.Device.Viewport.Height,
                                        new string[] { "Please insert a playername:" }, false,
                                        (string)menu.OptionMenu.Dialog.Data["Playername"], true);
                    prompt.accept  += new PromptEventHandler(SetPlayername);
                    prompt.decline += new PromptEventHandler(nothingOpt);
                    prompt.intiateButtons();
                    menu.OptionMenu.Activity = false;
                    break;
                }

                default:
                    break;
                }
                break;
            }

            case "OptionenControl":
            {
                switch (ButtonName)
                {
                case "Akzeptieren":
                {
                    OptionList changer = (OptionList)menu.OptionMenu.Listbox.List;
                    if (changer.controlChanges())
                    {
                        prompt = new Prompt(game, "Save", game.Graphics.Device.Viewport.Width,
                                            game.Graphics.Device.Viewport.Height,
                                            new string[] { "Save the values?" }, false);
                        prompt.accept  += new PromptEventHandler(SaveControlSettings);
                        prompt.decline += new PromptEventHandler(nothingOpt);
                        prompt.intiateButtons();
                        menu.OptionMenu.Activity = false;
                    }
                    else
                    {
                        discardChanges();
                    }
                    break;
                }

                case "Ablehnen":
                {
                    discardChanges();
                    break;
                }

                default:
                    break;
                }
                break;
            }

                #endregion
            default:
                break;
            }
        }