From d6ee366bb764a1fe69ba9d49138d36c163684457 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 24 Jul 2001 15:06:30 +0000 Subject: [PATCH] --- source/game/convo.cpp | 24 ++++++++++++++++++++++-- source/game/convo.h | 4 ++++ source/game/game.cpp | 10 +++++++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/source/game/convo.cpp b/source/game/convo.cpp index a919082b9..759d8428e 100644 --- a/source/game/convo.cpp +++ b/source/game/convo.cpp @@ -295,6 +295,8 @@ int CConversation::s_textPageOffset; int CConversation::s_maxTextPageOffset; SpriteBank *CConversation::s_sprites; +int CConversation::s_ignoreNewlyPressedButtonsOnPadThisThink; + static xmPlayingId s_playingSfxId; @@ -323,6 +325,8 @@ void CConversation::init() s_sprites=new ("ConvoSprites") SpriteBank(); s_sprites->load(SPRITES_SPRITES_SPR); + + s_ignoreNewlyPressedButtonsOnPadThisThink=false; } @@ -361,8 +365,11 @@ void CConversation::think(int _frames) s_currentState=STATE_ACTIVE; } - thinkText(); - thinkQuestion(); + if(!s_ignoreNewlyPressedButtonsOnPadThisThink) + { + thinkText(); + thinkQuestion(); + } s_currentScript->run(); if(s_currentScript->isFinished()) @@ -377,6 +384,8 @@ void CConversation::think(int _frames) } s_playingSfxId=CSoundMediator::playSfx(CSoundMediator::SFX_FRONT_END__OK); } + + s_ignoreNewlyPressedButtonsOnPadThisThink=false; } } @@ -974,5 +983,16 @@ RECT CConversation::getTextRegion() return clipRegion; } +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CConversation::ignoreNewlyPressedButtonsOnPadThisThink() +{ + s_ignoreNewlyPressedButtonsOnPadThisThink=true; +} + /*=========================================================================== end */ diff --git a/source/game/convo.h b/source/game/convo.h index 7b30c8482..28e638d6f 100644 --- a/source/game/convo.h +++ b/source/game/convo.h @@ -57,6 +57,8 @@ public: static int getResponse(); static RECT getTextRegion(); + static void ignoreNewlyPressedButtonsOnPadThisThink(); + private: enum @@ -170,6 +172,8 @@ private: static int s_maxTextPageOffset; static class SpriteBank *s_sprites; + static int s_ignoreNewlyPressedButtonsOnPadThisThink; + }; diff --git a/source/game/game.cpp b/source/game/game.cpp index 8b22e0790..de6e1669d 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -627,7 +627,15 @@ void CGameScene::think_playing(int _frames) // Conversation think ( with pad debounce stuff.. ) if(CConversation::isActive())m_player->ignoreNewlyPressedButtonsOnPadThisThink(); - CConversation::think(_frames); + if(!m_pauseMenu->isActive()) + { + CConversation::think(_frames); + } + else + { + // Must be a better way to do this? :/ + CConversation::ignoreNewlyPressedButtonsOnPadThisThink(); + } // Pause menu think ( with pad debounce stuff.. ) if(m_pauseMenu->isActive())m_player->ignoreNewlyPressedButtonsOnPadThisThink();