Esempio n. 1
0
    void ThankYou()
    {
        scroll_Thanks = EditorGUILayout.BeginScrollView(scroll_Thanks, false, false, docSize);

        GUILayout.Space(10);

        EditorGUILayout.LabelField("We here at Tank & Healer Studio would like to thank you for purchasing the Ultimate Status Bar asset package from the Unity Asset Store. If you have any questions about this product please don't hesitate to contact us at: ", EditorStyles.wordWrappedLabel);

        EditorGUILayout.LabelField("*****@*****.**", EditorStyles.boldLabel);

        EditorGUILayout.LabelField("\nWe hope that the Ultimate Status Bar will be a great help to you in the development of your game. After pressing the continue button below, you will be presented with helpful information on this asset to assist you in implementing it into your project.\n", EditorStyles.wordWrappedLabel);

        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        EditorGUILayout.LabelField("Happy Game Making,\n	-Tank & Healer Studio", GUILayout.Height(30));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        GUILayout.Space(15);

        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Continue", buttonSize))
        {
            EditorPrefs.SetBool("UltimateStatusBarStartup", true);
            Selection.activeObject = AssetDatabase.LoadMainAssetAtPath("Assets/Plugins/Ultimate Status Bar/README.txt");

            currentMenu = CurrentMenu.MainMenu;
            menuTitle   = "Main Menu";
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.EndScrollView();
    }
Esempio n. 2
0
        /// <summary>
        /// Read a response from the user, connected with the member view, and change the currentMenu based on the response
        /// </summary>
        /// <returns>0, unless the user enters a number above 0, then returns the number. In case the user wants to the delete the member, -1 is returned</returns>
        public int GetMemberResponse()
        {
            string readResponse = ReadResponse();

            if (readResponse.Equals("b"))
            {
                currentMenu = CurrentMenu.AddBoat;
            }
            else if (readResponse.Equals("c"))
            {
                currentMenu = CurrentMenu.EditMember;
            }
            else if (readResponse.Equals("d"))
            {
                currentMenu = CurrentMenu.Main;
                return(-1);
            }
            else if (readResponse.Equals("q"))
            {
                currentMenu = CurrentMenu.Main;
            }
            else
            {
                int  number    = 0;
                bool isNumeric = int.TryParse(readResponse, out number);

                if (isNumeric && number > 0)
                {
                    currentMenu = CurrentMenu.Boat;
                    return(int.Parse(readResponse));
                }
            }

            return(0);
        }
Esempio n. 3
0
        public static void OpenPage(string page, bool setCurrentTab = true)
        {
            GameObject pageGameObject = GameObject.Find(page);

            if (pageGameObject == null)
            {
                MelonLoader.MelonLogger.Error($"Page with path {page} could not be found");
                return;
            }

            CurrentMenu.SetActive(false);

            if (page.Split('/').Last() == "ShortcutMenu")
            {
                SetMenuIndex(0);
            }
            else
            {
                QuickMenu.prop_QuickMenu_0.field_Private_Int32_0 = -1;
                CurrentMenu = pageGameObject;
            }

            CurrentTabMenu.SetActive(false);
            if (setCurrentTab)
            {
                CurrentTabMenu = pageGameObject;
            }

            QuickMenuContextualDisplay quickMenuContextualDisplay = QuickMenu.prop_QuickMenu_0.field_Private_QuickMenuContextualDisplay_0;

            QuickMenuContexualDisplayMethod.Invoke(quickMenuContextualDisplay, new object[] { QuickMenuContextualDisplayEnum.GetEnumValues().GetValue(Array.IndexOf(QuickMenuContextualDisplayEnum.GetEnumNames(), "NoSelection")) });

            pageGameObject.SetActive(true);
        }
Esempio n. 4
0
 public void MergeFrom(GetOutpostDetailsResponse other)
 {
     if (other == null)
     {
         return;
     }
     imageUrls_.Add(other.imageUrls_);
     if (other.currentMenu_ != null)
     {
         if (currentMenu_ == null)
         {
             CurrentMenu = new global::WUProtos.Data.OutpostMenu();
         }
         CurrentMenu.MergeFrom(other.CurrentMenu);
     }
     if (other.PartnerId.Length != 0)
     {
         PartnerId = other.PartnerId;
     }
     if (other.poiDetails_ != null)
     {
         if (poiDetails_ == null)
         {
             PoiDetails = new global::WUProtos.Data.PoiDetails();
         }
         PoiDetails.MergeFrom(other.PoiDetails);
     }
     if (other.PoiAccessibility != 0)
     {
         PoiAccessibility = other.PoiAccessibility;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Esempio n. 5
0
        public override int GetHashCode()
        {
            int hash = 1;

            hash ^= imageUrls_.GetHashCode();
            if (currentMenu_ != null)
            {
                hash ^= CurrentMenu.GetHashCode();
            }
            if (PartnerId.Length != 0)
            {
                hash ^= PartnerId.GetHashCode();
            }
            if (poiDetails_ != null)
            {
                hash ^= PoiDetails.GetHashCode();
            }
            if (PoiAccessibility != 0)
            {
                hash ^= PoiAccessibility.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 6
0
        protected virtual void Update()
        {
            if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject())
            {
                CloseCurrentMenu();
            }
            else if (Input.GetMouseButtonDown(1))
            {
                CloseCurrentMenu();

                var ray     = RayCamera.ScreenPointToRay(Input.mousePosition);
                var hitInfo = new RaycastHit();
                if (Physics.Raycast(ray, out hitInfo, maxDistance, layerMask))
                {
                    var menuAgent = hitInfo.transform.GetComponent <IContextMenuAgent>();
                    if (menuAgent != null)
                    {
                        CurrentMenu = FindContextMenu(menuAgent.MenuName);
                        if (CurrentMenu != null)
                        {
                            CurrentMenu.Show(menuAgent, Input.mousePosition);
                        }
                    }
                }
            }
        }
Esempio n. 7
0
        public override void KeyEvent(Int32 key)
        {
            switch (key)
            {
            case KeysDef.K_ESCAPE:
            case 'n':
            case 'N':
                if (_PrevMenu != null)
                {
                    _PrevMenu.Show(Host);
                }
                else
                {
                    CurrentMenu.Hide( );
                }
                break;

            case 'Y':
            case 'y':
                Host.Keyboard.Destination = KeyDestination.key_console;
                Host.Quit_f(null);
                break;

            default:
                break;
            }
        }
Esempio n. 8
0
        public override void KeyEvent(Int32 key)
        {
            switch (key)
            {
            case KeysDef.K_ESCAPE:
                SinglePlayerMenu.Show(Host);
                break;

            case KeysDef.K_ENTER:
                CurrentMenu.Hide( );
                Host.Commands.Buffer.Append(String.Format("save s{0}\n", _Cursor));
                return;

            case KeysDef.K_UPARROW:
            case KeysDef.K_LEFTARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                _Cursor--;
                if (_Cursor < 0)
                {
                    _Cursor = MAX_SAVEGAMES - 1;
                }
                break;

            case KeysDef.K_DOWNARROW:
            case KeysDef.K_RIGHTARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                _Cursor++;
                if (_Cursor >= MAX_SAVEGAMES)
                {
                    _Cursor = 0;
                }
                break;
            }
        }
Esempio n. 9
0
        public void Update(GameTime gameTime)
        {
            // Do state-specific update logic.
            CurrentState.OnStateUpdate(gameTime);

            // Update current menu.
            CurrentMenu?.Update(gameTime);

            #region Global input handling
            if (Control.MuteSound.IsJustPressed)
            {
                SoundController.ToggleMute();
                SoundController.Play(Sound.Bip2);
            }

            if (Control.MuteMusic.IsJustPressed)
            {
                SoundController.ToggleMuteMusic();
                SoundController.Play(Sound.Bip2);
            }

            if (Control.SkipTutorial.IsJustPressed)
            {
                skipTutorial = !skipTutorial;
                SoundController.Play(Sound.Bip2);
            }
            #endregion
        }
Esempio n. 10
0
 private void StartUp()
 {
     // Makes sure the menu is aways first
     currentMenu      = CurrentMenu.First;
     Cursor.visible   = true;
     Cursor.lockState = CursorLockMode.None;
     FadeIn();
 }
Esempio n. 11
0
 /// <summary>
 /// Close current context menu.
 /// </summary>
 protected void CloseCurrentMenu()
 {
     if (CurrentMenu != null)
     {
         CurrentMenu.Close();
         CurrentMenu = null;
     }
 }
        public ActionResult DeleteConfirmed(int id)
        {
            CurrentMenu currentMenu = db.CurrentMenus.Find(id);

            db.CurrentMenus.Remove(currentMenu);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 13
0
 public void Draw(SpriteBatch spriteBatch)
 {
     Game.GraphicsDevice.Clear(Color.Black);
     spriteBatch.Begin();
     TotemAnimator.Draw(spriteBatch);
     spriteBatch.End();
     CurrentMenu.Draw(spriteBatch);
 }
Esempio n. 14
0
 public void Update(GameTime gameTime)
 {
     CurrentMenu.Update(gameTime);
     ContentLoader.Shaders["menu"].Parameters["Time"].SetValue((float)gameTime.TotalGameTime.TotalSeconds);
     TotemAnimator.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds);
     TotemAnimator.Position = TotemPositionResolver.Resolve();
     TotemAnimator.Scale    = new Vector2(TotemScaleResolver.Resolve());
 }
Esempio n. 15
0
        /// <summary>
        /// M_Main_Key
        /// </summary>
        public override void KeyEvent(Int32 key)
        {
            switch (key)
            {
            case KeysDef.K_ESCAPE:
                //Host.Keyboard.Destination = keydest_t.key_game;
                CurrentMenu.Hide( );
                Host.Client.cls.demonum = _SaveDemoNum;
                if (Host.Client.cls.demonum != -1 && !Host.Client.cls.demoplayback && Host.Client.cls.state != cactive_t.ca_connected)
                {
                    Host.Client.NextDemo( );
                }
                break;

            case KeysDef.K_DOWNARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                if (++_Cursor >= MAIN_ITEMS)
                {
                    _Cursor = 0;
                }
                break;

            case KeysDef.K_UPARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                if (--_Cursor < 0)
                {
                    _Cursor = MAIN_ITEMS - 1;
                }
                break;

            case KeysDef.K_ENTER:
                Host.Menu.EnterSound = true;

                switch (_Cursor)
                {
                case 0:
                    SinglePlayerMenu.Show(Host);
                    break;

                case 1:
                    MultiPlayerMenu.Show(Host);
                    break;

                case 2:
                    OptionsMenu.Show(Host);
                    break;

                case 3:
                    HelpMenu.Show(Host);
                    break;

                case 4:
                    QuitMenu.Show(Host);
                    break;
                }
                break;
            }
        }
Esempio n. 16
0
    void Update()
    {
        // If the menu is active, but the input is not within range...
        if (weaponRadialMenu.RadialMenuActive && !weaponRadialMenu.InputInRange)
        {
            // And the left mouse button is caught down...
            if (Input.GetMouseButtonDown(0))
            {
                // Store the mouse position.
                Vector2 mousePosition = Input.mousePosition;

                // If the mouse position is less than the min input range, then the user is wanting to move to the menu on the left...
                if (mousePosition.x < horizontalInputMin)
                {
                    // If the current menu is the Light Weapons...
                    if (currentMenu == CurrentMenu.LightWeapons)
                    {
                        // Then set the current menu to Utility since it is the one that we are moving to.
                        currentMenu = CurrentMenu.UtilityWeapons;

                        // Populate the radial menu with the Utility Weapons.
                        PopulateRadialMenu(UtilityWeapons, "Utility Weapons");
                    }
                    // Else if the current menu is the Heavy Weapons...
                    else if (currentMenu == CurrentMenu.HeavyWeapons)
                    {
                        // Set the current menu to Light Weapons.
                        currentMenu = CurrentMenu.LightWeapons;

                        // Populate the radial menu with the Light Weapons.
                        PopulateRadialMenu(LightWeapons, "Light Weapons");
                    }
                }
                // Else if the mouse position is greater than the max input range, then the user wants to move to the right, so...
                else if (mousePosition.x > horizontalInputMax)
                {
                    // If the current menu is the Light Weapons...
                    if (currentMenu == CurrentMenu.LightWeapons)
                    {
                        // Set the current menu to heavy.
                        currentMenu = CurrentMenu.HeavyWeapons;

                        // Populate the radial menu with the heavy weapons.
                        PopulateRadialMenu(HeavyWeapons, "Heavy Weapons");
                    }
                    // Else if the current menu is the Utility weapons...
                    else if (currentMenu == CurrentMenu.UtilityWeapons)
                    {
                        // Change the current menu to Light.
                        currentMenu = CurrentMenu.LightWeapons;

                        // Populate the radial menu with the light weapons.
                        PopulateRadialMenu(LightWeapons, "Light Weapons");
                    }
                }
            }
        }
    }
Esempio n. 17
0
 private void OpenMenu(IMenuPresenter menu)
 {
     if (CurrentMenu != null)
     {
         CurrentMenu.Close();
     }
     menu.Open();
     CurrentMenu = menu;
 }
Esempio n. 18
0
 public void HideSettingsMenu()
 {
     currentMenu = CurrentMenu.Main;
     gameTitleCanvasGroup.DOFade(1f, .5f);
     mainMenuCanvasGroup.transform.parent.gameObject.SetActive(true);
     mainMenuCanvasGroup.alpha = 0f;
     mainMenuCanvasGroup.DOFade(1f, .5f);
     settingsCanvasGroup.DOFade(0f, .5f).OnComplete(() => settingsCanvasGroup.gameObject.SetActive(currentMenu == CurrentMenu.Settings));
 }
Esempio n. 19
0
    // This function will be called when the radial menu is disabled.
    void OnRadialMenuDisabled()
    {
        // Disable the background panel.
        backgroundPanel.SetActive(false);

        // Reset the radial menu to the Light Weapons.
        currentMenu = CurrentMenu.LightWeapons;
        PopulateRadialMenu(LightWeapons, "Light Weapons");
    }
 public ActionResult Edit([Bind(Include = "ID,Dessert,MainDish,SecondDish")] CurrentMenu currentMenu)
 {
     if (ModelState.IsValid)
     {
         db.Entry(currentMenu).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(currentMenu));
 }
        public ActionResult Create([Bind(Include = "ID,Dessert,MainDish,SecondDish")] CurrentMenu currentMenu)
        {
            if (ModelState.IsValid)
            {
                db.CurrentMenus.Add(currentMenu);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(currentMenu));
        }
Esempio n. 22
0
 /// <summary>
 /// 隐藏菜单
 /// </summary>
 public static void HideMenu()
 {
     if (UIRoot != null)
     {
         UIRoot.activeSelf = false;
     }
     if (CurrentMenu != null)
     {
         CurrentMenu.Hide();
     }
 }
Esempio n. 23
0
 /// <summary>
 /// 隐藏菜单
 /// </summary>
 public static void HideMenu()
 {
     if (Root != null)
     {
         Root.gameObject.SetActive(false);
     }
     if (CurrentMenu != null)
     {
         CurrentMenu.Hide();
     }
 }
Esempio n. 24
0
 public void HideCharacterMenu()
 {
     currentMenu = CurrentMenu.Main;
     characterMenu.localScale   = Vector3.one;
     gameTitleCanvasGroup.alpha = 1f;
     mainMenuCanvasGroup.transform.parent.gameObject.SetActive(true);
     mainMenuCanvasGroup.alpha = 0f;
     mainMenuCanvasGroup.DOFade(1f, 1f);
     scoreShellAnim.SetBool("isDisplayed", true);
     characterMenu.DOScale(new Vector3(0f, 0f, 1f), .25f).OnComplete(() => characterMenu.transform.parent.gameObject.SetActive(currentMenu == CurrentMenu.Character));
 }
Esempio n. 25
0
        //called when the user presses the "start test" button
        private void handleStartPhase()
        {
            //generates the next menu
            CurrentType = completion.getNextType();
            CurrentMenu = factory.getNextMenu(CurrentType);
            CurrentMenu.MenuFinished += handleMenuFinished;

            Instructions.setInstructions(CurrentMenu.WantedControls);
            Instructions.launchInstructions();
            CurrentState = StudyState.TEST;
            CurrentMenu.startMenu();
        }
Esempio n. 26
0
        protected void LoadEntityPicker(EntityPicker picker, Enums.MealTypes mealType)
        {
            List <hccMenuItem> allItemsList      = hccMenuItem.GetBy(mealType);
            List <hccMenuItem> selectedItemsList = new List <hccMenuItem>();

            if (CurrentMenu != null)
            {
                selectedItemsList = CurrentMenu.GetMenuItems(false, mealType);
            }

            picker.Bind <hccMenuItem>(allItemsList, selectedItemsList);
        }
Esempio n. 27
0
        // MAIN MENU

        /// <summary>
        /// Displays the main menu to the user.
        /// </summary>
        public void DisplayMainMenu()
        {
            currentMenu = CurrentMenu.Main;
            System.Console.Clear();
            System.Console.WriteLine("Welcome, member, to The Happy Pirates member and boat list application");
            System.Console.WriteLine("----------------------------------");
            System.Console.WriteLine("c to view a compact member list");
            System.Console.WriteLine("v to view a verbose member list");
            System.Console.WriteLine("a to add a new member");
            System.Console.WriteLine("q to quit");
            System.Console.WriteLine("----------------------------------");
        }
Esempio n. 28
0
 void Update()
 {
     if (playing)
     {
         score += Time.deltaTime;
     }
     if (Input.GetKey(KeyCode.Escape) && playing)
     {
         Time.timeScale = 0;
         curMenu        = CurrentMenu.paused;
         playing        = false;
     }
 }
        // GET: CurrentMenus/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CurrentMenu currentMenu = db.CurrentMenus.Find(id);

            if (currentMenu == null)
            {
                return(HttpNotFound());
            }
            return(View(currentMenu));
        }
Esempio n. 30
0
    public void DisplayCharacterMenu()
    {
        currentMenu = CurrentMenu.Character;
        characterMenu.localScale = new Vector3(0f, 0f, 1f);
        characterMenu.DOScale(Vector3.one, .25f);
        mainMenuCanvasGroup.DOFade(0f, .25f).OnComplete(() => mainMenuCanvasGroup.transform.parent.gameObject.SetActive(currentMenu == CurrentMenu.Main));
        //   gameTitleCanvasGroup.DOFade(0f, .25f);
        scoreShellAnim.SetBool("isDisplayed", false);
        AudioSource audio = ApplicationController.ac.characters[CharacterSelector.currentCharacter].skin.GetComponent <AudioSource>();

        if (audio != null)
        {
            audio.Play();
        }
    }
Esempio n. 31
0
 /// <summary>
 /// Read a response from the user, connected with the boatmenu, and change the currentMenu based on the response
 /// </summary>
 /// <returns>0, unless the user wants to the delete the boat, then -1 is returned</returns>
 public int GetBoatResponse()
 {
     string readResponse = ReadResponse();
     if (readResponse.Equals("e"))
     {
         currentMenu = CurrentMenu.EditBoat;
     }
     else if (readResponse.Equals("d"))
     {
         currentMenu = CurrentMenu.Member;
         return -1;
     }
     else if (readResponse.Equals("q"))
     {
         currentMenu = CurrentMenu.Member;
     }
     return 0;
 }
Esempio n. 32
0
 public MenuAction checkactions(List<Input.MenuKeys> keys, List<Input.MenuKeys> oldkeys)
 {
     MenuAction action = MenuAction.Nothing;
     if (keys.Contains(Input.MenuKeys.Enter) && !oldkeys.Contains(Input.MenuKeys.Enter))
     {
         if (current_menu_list == 0 && currentmenu == CurrentMenu.MainMenu)
         {
             if (current_pos == 0)
             {
                 current_menu_list = 1;
                 current_pos = 0;
                 menulists[current_menu_list].SetActiveButton(0);
             }
             else if (current_pos == 1)
             {
                 currentmenu = CurrentMenu.CustomMaps;
             }
             else if (current_pos == 4)
             {
                 action = MenuAction.Quit;
             }
             else if (current_pos == 3)
             {
                 //action = MenuAction.ShowCredits;
             }
         }
     }
     else if (keys.Contains(Star.Input.MenuKeys.Back) && !oldkeys.Contains(Star.Input.MenuKeys.Back))
     {
         if (current_menu_list == 1)
         {
             current_menu_list = 0;
             current_pos = 0;
             menulists[current_menu_list].SetActiveButton(0);
         }
     }
     return action;
 }
    void MainMenu()
    {
        EditorGUILayout.BeginVertical();
        GUILayout.Space( 25 );

        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if( GUILayout.Button( "How To", buttonSize ) )
        {
            currentMenu = CurrentMenu.HowTo;
            menuTitle = "How To";
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if( GUILayout.Button( "Overview", buttonSize ) )
        {
            currentMenu = CurrentMenu.Overview;
            menuTitle = "Overview";
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if( GUILayout.Button( "Documentation", buttonSize ) )
        {
            currentMenu = CurrentMenu.Documentation;
            menuTitle = "Documentation";
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if( GUILayout.Button( "Extras", buttonSize ) )
        {
            currentMenu = CurrentMenu.Extras;
            menuTitle = "Extras";
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if( GUILayout.Button( "Other Products", buttonSize ) )
        {
            currentMenu = CurrentMenu.OtherProducts;
            menuTitle = "Other Products";
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if( GUILayout.Button( "Feedback", buttonSize ) )
        {
            currentMenu = CurrentMenu.Feedback;
            menuTitle = "Feedback";
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();
        EditorGUILayout.EndVertical();
    }
 void BackToMainMenu()
 {
     currentMenu = CurrentMenu.MainMenu;
     menuTitle = "Main Menu";
 }
Esempio n. 35
0
        public EGameState Update(Microsoft.Xna.Framework.GameTime gameTime, Input.Inputhandler inputhandler,Options options)
        {
            List<MenuKeys> keys = inputhandler.GetMenuKeys;
            List<MenuKeys> oldkeys = inputhandler.GetOldMenuKeys;
            EGameState gamestate = EGameState.Menu;
            cloudlayer.Update(gameTime, Vector2.Zero, options,Vector2.Zero);
            newMenueEffect.Update(gameTime);
            oldMenuEffect.Update(gameTime);
            //if (keys != oldkeys)
            {
                switch (currentmenu)
                {
                    case CurrentMenu.MainMenu:
                        newmenu = mainmenu.Update(gameTime, inputhandler);
                        DoMenuTransition(newmenu);
                        if (currentmenu == CurrentMenu.Quit)
                            gamestate = EGameState.Quit;
                        else if (currentmenu == Menu.CurrentMenu.Credits)
                        {
                            gamestate = EGameState.Credits;
                            currentmenu = Menu.CurrentMenu.MainMenu;
                        }
                        break;

                    case CurrentMenu.CustomMaps:
                        newmenu = custmapmenu.Update(gameTime, inputhandler);
                        DoMenuTransition(newmenu);
                        if (newmenu == CurrentMenu.LoadLevel)
                        {
                            leveltype = LevelType.CustomLevels;
                            level_name = custmapmenu.GetLevelName;
                            gamestate = EGameState.Loading;
                        }
                        break;
                    case CurrentMenu.LoadLevel:
                        gamestate = EGameState.Loading;
                        break;
                    case CurrentMenu.Options:
                        newmenu = optionsMenu.Update(gameTime, inputhandler);
                        DoMenuTransition(newmenu);
                        break;

                }
            }

            return gamestate;
        }
Esempio n. 36
0
 private void DoMenuTransition(CurrentMenu newMenu)
 {
     if (newmenu != currentmenu)
     {
         oldMenu = currentmenu;
         currentmenu = newMenu;
         ResetTransition();
     }
     else
         currentmenu = newMenu;
 }
Esempio n. 37
0
 // MAIN MENU
 /// <summary>
 /// Displays the main menu to the user.
 /// </summary>
 public void DisplayMainMenu()
 {
     currentMenu = CurrentMenu.Main;
     System.Console.Clear();
     System.Console.WriteLine("Welcome, member, to The Happy Pirates member and boat list application");
     System.Console.WriteLine("----------------------------------");
     System.Console.WriteLine("c to view a compact member list");
     System.Console.WriteLine("v to view a verbose member list");
     System.Console.WriteLine("a to add a new member");
     System.Console.WriteLine("q to quit");
     System.Console.WriteLine("----------------------------------");
 }
Esempio n. 38
0
        /// <summary>
        /// Read a response from the user, connected with the member list, and change the currentMenu based on the response
        /// </summary>
        /// <returns>0, unless the user enters a number above 0, then returns the number</returns>
        public int GetMemberListResponse()
        {
            string readResponse = ReadResponse();
            if (readResponse.Equals("q"))
            {
                currentMenu = CurrentMenu.Main;
            }
            else
            {
                int number = 0;
                bool isNumeric = int.TryParse(readResponse, out number);

                if (isNumeric && number > 0)
                {
                    currentMenu = CurrentMenu.Member;
                    return int.Parse(readResponse);
                }
            }
            return 0;
        }
Esempio n. 39
0
        /// <summary>
        /// Read a response from the user, connected with the member view, and change the currentMenu based on the response
        /// </summary>
        /// <returns>0, unless the user enters a number above 0, then returns the number. In case the user wants to the delete the member, -1 is returned</returns>
        public int GetMemberResponse()
        {
            string readResponse = ReadResponse();
            if (readResponse.Equals("b"))
            {
                currentMenu = CurrentMenu.AddBoat;
            }
            else if (readResponse.Equals("c"))
            {
                currentMenu = CurrentMenu.EditMember;
            }
            else if (readResponse.Equals("d"))
            {
                currentMenu = CurrentMenu.Main;
                return -1;
            }
            else if (readResponse.Equals("q"))
            {
                currentMenu = CurrentMenu.Main;
            }
            else
            {
                int number = 0;
                bool isNumeric = int.TryParse(readResponse, out number);

                if (isNumeric && number > 0)
                {
                    currentMenu = CurrentMenu.Boat;
                    return int.Parse(readResponse);
                }
            }

            return 0;
        }
Esempio n. 40
0
 /// <summary>
 /// Read a response from the user, connected with the main menu, and change the currentMenu based on the response
 /// </summary>
 public void MainMenuResponse()
 {
     string readResponse = ReadResponse();
     if (readResponse.Equals("c"))
     {
         currentMenu = CurrentMenu.CompactList;
     }
     else if (readResponse.Equals("v"))
     {
         currentMenu = CurrentMenu.VerboseList;
     }
     else if (readResponse.Equals("a"))
     {
         currentMenu = CurrentMenu.AddMember;
     }
     else if (readResponse.Equals("q"))
     {
         currentMenu = CurrentMenu.Quit;
     }
 }
Esempio n. 41
0
 // SET CURRENT MENU
 /// <summary>
 /// Set the menu the user should be at
 /// </summary>
 /// <param name="a_menu">CurrentMenu. the currentmenu enum value</param>
 public void SetCurrentMenu(CurrentMenu a_menu)
 {
     currentMenu = a_menu;
 }