Exemplo n.º 1
0
        //----------------------------------------------------------------------
        public void Draw()
        {
            MenuScreen.Draw();

            if (mPopupStack.Count > 0)
            {
                PopupScreen.Draw();
            }
        }
Exemplo n.º 2
0
        public void AddPopupScreen(string text, Texture2D texture, PopupType type, bool pause)
        {
            var pup = new PopupScreen(text, texture, type);

            pup.ParentScreen  = this;
            pup.ScreenManager = ScreenManager;
            pup.Load();
            Popups.Add(pup);
            PauseScreen();
        }
Exemplo n.º 3
0
        //----------------------------------------------------------------------
        public virtual void Update(float _fElapsedTime)
        {
            MenuScreen.IsActive  = Game.IsActive && (Game.GameStateMgr == null || !Game.GameStateMgr.IsSwitching) && mPopupStack.Count == 0;
            PopupScreen.IsActive = Game.IsActive && (Game.GameStateMgr == null || !Game.GameStateMgr.IsSwitching) && mPopupStack.Count > 0;

            MenuScreen.HandleInput();
            if (mPopupStack.Count > 0)
            {
                PopupScreen.HandleInput();
            }

            MenuScreen.Update(_fElapsedTime);
            if (mPopupStack.Count > 0)
            {
                PopupScreen.Update(_fElapsedTime);
            }
        }
Exemplo n.º 4
0
        //----------------------------------------------------------------------
        // NOTE: This method takes the removed popup as an argument to help ensure consistency
        public void PopPopup(Panel _popup)
        {
            if (mPopupStack.Count == 0 || mPopupStack.Peek() != _popup)
            {
                throw new InvalidOperationException("Cannot pop a popup if it isn't at the top of the stack");
            }

            mPopupStack.Pop();

            PopupScreen.Root.Clear();

            if (mPopupStack.Count > 0)
            {
                PopupScreen.Root.AddChild(mPopupFade);

                var panel = (Panel)mPopupStack.Peek();
                PopupScreen.Root.AddChild(panel);
                PopupScreen.Focus(panel);
            }
        }
Exemplo n.º 5
0
 public static TMP_InputField GetTMP_InputField(this PopupScreen popupScreen)
 {
     return(popupScreen.GetFirstActivePopup()?.GetComponentInChildren <TMP_InputField>());
 }