Ejemplo n.º 1
0
        public void Update(GameEngine gameEngine, GameTime gameTime)
        {
            if (IsTransitioning)
            {
                return;
            }

            MouseState = Mouse.GetState();

            /*** Update components ***/
            SpeechMenu?.Update(gameTime);
            ConfirmMenu?.Update(gameTime);

            if (PrevMouseState.LeftButton == ButtonState.Pressed && MouseState.LeftButton == ButtonState.Released)
            {
                MouseClicked(MouseState);
            }

            PrevMouseState = MouseState;

            switch (GState)
            {
            case LocationState.Normal:
                foreach (string CharName in CharPics.Keys)
                {
                    CharPics[CharName].Update();
                }
                break;

            case LocationState.ConfirmedPerson:
                gameEngine.Push(new InterviewManager(SelectedPersonName), true, true);

                // Add an entry for the relationship when you meet a character.
                if (!MainCharacter.Relationships.ContainsKey(SelectedPersonName))
                {
                    MainCharacter.Relationships[SelectedPersonName] = 0;
                }
                IsTransitioning = true;
                break;

            case LocationState.ToNotebook:
                int[] Null = new int[] { -1 };
                gameEngine.Push(new NotebookManager(false, ref Null), true, true);
                IsTransitioning = true;
                break;

            case LocationState.ConfirmedReturn:
                gameEngine.Pop(true, true);
                IsTransitioning = true;
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        public void Update(GameEngine gameEngine, GameTime gameTime)
        {
            if (IsTransitioning)
            {
                return;
            }
            MouseState = Mouse.GetState();

            /*** Update Components ***/
            // Notebook sections (Constant)
            PeopleTab.Update();
            OptionsTab.Update();
            StatsTab.Update();
            TestimonyTab.Update();

            // Tab-specific components (Variable)
            MainOptionsList?.Update();
            TopicOptionsList?.Update();
            QuitButton?.Update();
            SaveButton?.Update();
            SelectTestimonyButton?.Update();
            ConfirmQuitMenu?.Update(gameTime);
            ConfirmContradictMenu?.Update(gameTime);

            if (PrevMouseState.LeftButton == ButtonState.Pressed && MouseState.LeftButton == ButtonState.Released)
            {
                MouseClicked(MouseState);
            }

            if (GState == NotebookState.Returning)
            {
                gameEngine.Pop(true, true);
                IsTransitioning = true;
            }

            if (GState == NotebookState.ConfirmedQuitGame)
            {
                gameEngine.PopAll(true, true);
                IsTransitioning = true;
            }

            PrevMouseState = MouseState;
        }