1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-27 23:39:41 +00:00

[Client] Don't use message box call boolean for regular message boxes

This commit is contained in:
David Cernat 2017-10-10 04:11:36 +03:00
parent 4f112ba3d7
commit c35101cc36
2 changed files with 5 additions and 6 deletions

View file

@ -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<std::string> 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<std::string> 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();

View file

@ -69,7 +69,7 @@ namespace mwmp
int keyChatMode;
long id;
bool calledMessageBox;
bool calledInteractiveMessage;
TextInputDialog *mInputBox;
GUIDialogList *mListBox;
void onInputBoxDone(MWGui::WindowBase* parWindow);