From a12729670b7e10a6eab83db78d06756e5522320e Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 10 Mar 2012 01:24:59 +0000 Subject: [PATCH] - Fixed: The user could interact with the conversation menu during demo playback and mess up the demo. - Fixed: The conversation menu stayed up during demo playback even after the conversation was over. SVN r3419 (trunk) --- src/p_conversation.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index 089ef45238..ad637c39cf 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -809,6 +809,15 @@ public: bool MenuEvent(int mkey, bool fromcontroller) { + if (demoplayback) + { // During demo playback, don't let the user do anything besides close this menu. + if (mkey == MKEY_Back) + { + Close(); + return true; + } + return false; + } if (mkey == MKEY_Up) { if (--mSelection < 0) mSelection = mResponses.Size() - 1; @@ -894,6 +903,10 @@ public: bool Responder(event_t *ev) { + if (demoplayback) + { // No interaction during demo playback + return false; + } if (ev->type == EV_GUI_Event && ev->subtype == EV_GUI_Char && ev->data1 >= '0' && ev->data1 <= '9') { // Activate an item of type numberedmore (dialogue only) mSelection = ev->data1 == '0' ? 9 : ev->data1 - '1'; @@ -1401,6 +1414,13 @@ void P_ConversationCommand (int netcode, int pnum, BYTE **stream) { player_t *player = &players[pnum]; + // The conversation menus are normally closed by the menu code, but that + // doesn't happen during demo playback, so we need to do it here. + if (demoplayback && DMenu::CurrentMenu != NULL && + DMenu::CurrentMenu->IsKindOf(RUNTIME_CLASS(DConversationMenu))) + { + DMenu::CurrentMenu->Close(); + } if (netcode == DEM_CONVREPLY) { int nodenum = ReadWord(stream);