From c35101cc3636400a44022215bba15e95213562e7 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 10 Oct 2017 04:11:36 +0300 Subject: [PATCH] [Client] Don't use message box call boolean for regular message boxes --- apps/openmw/mwmp/GUIController.cpp | 9 ++++----- apps/openmw/mwmp/GUIController.hpp | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwmp/GUIController.cpp b/apps/openmw/mwmp/GUIController.cpp index e06b4248b..cff86664a 100644 --- a/apps/openmw/mwmp/GUIController.cpp +++ b/apps/openmw/mwmp/GUIController.cpp @@ -43,7 +43,7 @@ mwmp::GUIController::GUIController(): mInputBox(0), mListBox(0) mChat = nullptr; keySay = SDL_SCANCODE_Y; keyChatMode = SDL_SCANCODE_F2; - calledMessageBox = false; + calledInteractiveMessage = false; } mwmp::GUIController::~GUIController() @@ -119,7 +119,6 @@ void mwmp::GUIController::showMessageBox(const BasePlayer::GUIMessageBox &guiMes { MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager(); windowManager->messageBox(guiMessageBox.label); - calledMessageBox = true; } std::vector splitString(const std::string &str, char delim = ';') @@ -137,7 +136,7 @@ void mwmp::GUIController::showCustomMessageBox(const BasePlayer::GUIMessageBox & MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager(); std::vector buttons = splitString(guiMessageBox.buttons); windowManager->interactiveMessageBox(guiMessageBox.label, buttons); - calledMessageBox = true; + calledInteractiveMessage = true; } void mwmp::GUIController::showInputBox(const BasePlayer::GUIMessageBox &guiMessageBox) @@ -205,10 +204,10 @@ void mwmp::GUIController::update(float dt) // checked somewhere else int pressedButton = MWBase::Environment::get().getWindowManager()->readPressedButton(false); - if (pressedButton != -1 && calledMessageBox) + if (pressedButton != -1 && calledInteractiveMessage) { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Pressed: %d", pressedButton); - calledMessageBox = false; + calledInteractiveMessage = false; Main::get().getLocalPlayer()->guiMessageBox.data = MyGUI::utility::toString(pressedButton); Main::get().getNetworking()->getPlayerPacket(ID_GUI_MESSAGEBOX)->setPlayer(Main::get().getLocalPlayer()); Main::get().getNetworking()->getPlayerPacket(ID_GUI_MESSAGEBOX)->Send(); diff --git a/apps/openmw/mwmp/GUIController.hpp b/apps/openmw/mwmp/GUIController.hpp index 8e6efba15..db42d692f 100644 --- a/apps/openmw/mwmp/GUIController.hpp +++ b/apps/openmw/mwmp/GUIController.hpp @@ -69,7 +69,7 @@ namespace mwmp int keyChatMode; long id; - bool calledMessageBox; + bool calledInteractiveMessage; TextInputDialog *mInputBox; GUIDialogList *mListBox; void onInputBoxDone(MWGui::WindowBase* parWindow);