Ejemplo n.º 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);
        }
        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);
        }