Exemple #1
0
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            base.Update(gameTime);

            float deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;

            PlayerInput.Update(deltaTime);

            if (GUIMessageBox.VisibleBox != null)
            {
                GUIComponent.ForceMouseOn(GUIMessageBox.VisibleBox);
                GUIMessageBox.VisibleBox.Update(deltaTime);
                return;
            }

            GUIComponent.ClearUpdateList();
            guiRoot.AddToGUIUpdateList();
            GUIComponent.UpdateMouseOn();

            guiRoot.Update(deltaTime);
        }
Exemple #2
0
        public virtual void Update(float deltaTime)
        {
            if (gameStarted && Screen.Selected == GameMain.GameScreen)
            {
                chatMsgBox.Visible = Character.Controlled == null || Character.Controlled.CanSpeak;

                inGameHUD.Update(deltaTime);

                GameMain.GameSession.CrewManager.Update(deltaTime);

                if (Character.Controlled == null || Character.Controlled.IsDead)
                {
                    GameMain.GameScreen.Cam.TargetPos = Vector2.Zero;
                    GameMain.LightManager.LosEnabled  = false;
                }
            }

            if (PlayerInput.KeyHit(InputType.Chat) && chatMsgBox.Visible)
            {
                if (chatMsgBox.Selected)
                {
                    chatMsgBox.Text = "";
                    chatMsgBox.Deselect();
                }
                else
                {
                    chatMsgBox.Select();
                }
            }
        }
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }


            if (settings.AutoCheckUpdates)
            {
                if (updateCheckState == 0)
                {
                    updateInfoText.Text = "Checking for updates...";
                    updateCheckState++;
                }
                else if (updateCheckState == 2)
                {
                    CheckForUpdates();
                    updateCheckState++;
                }
            }

            base.Update(gameTime);

            float deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;

            PlayerInput.Update(deltaTime);

            if (GUIMessageBox.VisibleBox != null)
            {
                GUIMessageBox.VisibleBox.AddToGUIUpdateList();
                GUIComponent.UpdateMouseOn();
                GUIMessageBox.VisibleBox.Update(deltaTime);
                return;
            }

            GUIComponent.ClearUpdateList();
            guiRoot.AddToGUIUpdateList();
            GUIComponent.UpdateMouseOn();

            guiRoot.Update(deltaTime);
        }
Exemple #4
0
    ///--------------------------------------------------------------------------------------
    /// <summary>
    /// 界面的Update逻辑
    /// </summary>
    ///--------------------------------------------------------------------------------------
    public void Update( )
    {
        if (UIRoot == null)
        {
            UIRoot = GameObject.Find("UI Root");
        }

        foreach (var item in m_mapFrame)
        {
            GUIFrame pFrame = item.Value as GUIFrame;
            if (pFrame != null && pFrame.IsLoaded() && pFrame.IsNeedUpdate)
            {
                pFrame.Update();
            }
        }

        for (int i = 0; i < m_mapDestory.Count; i++)
        {
            GUIFrame pFrame = m_mapDestory[i];
            DetachUIRoot(pFrame, true);
            pFrame.Destroy();
        }
        m_mapDestory.Clear();
    }