From 711c4d83daefd5c812596dbfdc2c8f013786cf58 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 7 Oct 2017 23:33:36 +0300 Subject: [PATCH] [Client] Fix build after recent OpenMW changes to GUI --- apps/openmw/mwbase/dialoguemanager.hpp | 2 +- apps/openmw/mwgui/container.cpp | 2 +- apps/openmw/mwmp/CellController.cpp | 8 ++++---- apps/openmw/mwmp/CellController.hpp | 2 +- apps/openmw/mwmp/GUI/GUIChat.cpp | 7 ++++--- apps/openmw/mwmp/GUI/GUIChat.hpp | 7 +++---- apps/openmw/mwmp/GUI/TextInputDialog.cpp | 4 ++-- apps/openmw/mwmp/GUI/TextInputDialog.hpp | 2 +- apps/openmw/mwmp/LocalPlayer.cpp | 5 ++--- apps/openmw/mwmp/LocalPlayer.hpp | 2 +- apps/openmw/mwmp/WorldEvent.cpp | 2 +- 11 files changed, 21 insertions(+), 22 deletions(-) diff --git a/apps/openmw/mwbase/dialoguemanager.hpp b/apps/openmw/mwbase/dialoguemanager.hpp index 386f73382..f777f838f 100644 --- a/apps/openmw/mwbase/dialoguemanager.hpp +++ b/apps/openmw/mwbase/dialoguemanager.hpp @@ -105,7 +105,7 @@ namespace MWBase Declare this method here so it can be used from outside of MWDialogue::DialogueManager */ - virtual void updateTopics() = 0; + virtual void updateActorKnownTopics() = 0; /* End of tes3mp addition */ diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 5663f5c5d..085404fcc 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -226,7 +226,7 @@ namespace MWGui Mark this container as open for multiplayer logic purposes */ - mwmp::Main::get().getCellController()->openContainer(container, loot); + mwmp::Main::get().getCellController()->openContainer(container); /* End of tes3mp addition */ diff --git a/apps/openmw/mwmp/CellController.cpp b/apps/openmw/mwmp/CellController.cpp index aac250775..466a63c58 100644 --- a/apps/openmw/mwmp/CellController.cpp +++ b/apps/openmw/mwmp/CellController.cpp @@ -338,14 +338,14 @@ bool CellController::isSameCell(const ESM::Cell& cell, const ESM::Cell& otherCel return false; } -void CellController::openContainer(const MWWorld::Ptr &container, bool loot) +void CellController::openContainer(const MWWorld::Ptr &container) { // Record this as the player's current open container - Main::get().getLocalPlayer()->storeCurrentContainer(container, loot); + Main::get().getLocalPlayer()->storeCurrentContainer(container); const auto &cellRef = container.getCellRef(); - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Container \"%s\" (%d) is opened. Loot: %s", - cellRef.getRefId().c_str(), cellRef.getRefNum().mIndex, loot ? "true" : "false"); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Container \"%s\" (%d) is opened", + cellRef.getRefId().c_str(), cellRef.getRefNum().mIndex); for (const auto &ptr : container.getClass().getContainerStore(container)) { diff --git a/apps/openmw/mwmp/CellController.hpp b/apps/openmw/mwmp/CellController.hpp index ae2de1862..4b28043d3 100644 --- a/apps/openmw/mwmp/CellController.hpp +++ b/apps/openmw/mwmp/CellController.hpp @@ -59,7 +59,7 @@ namespace mwmp bool isSameCell(const ESM::Cell& cell, const ESM::Cell& otherCell); - void openContainer(const MWWorld::Ptr& container, bool loot); + void openContainer(const MWWorld::Ptr& container); void closeContainer(const MWWorld::Ptr& container); int getCellSize() const; diff --git a/apps/openmw/mwmp/GUI/GUIChat.cpp b/apps/openmw/mwmp/GUI/GUIChat.cpp index 7e464ce47..414f40269 100644 --- a/apps/openmw/mwmp/GUI/GUIChat.cpp +++ b/apps/openmw/mwmp/GUI/GUIChat.cpp @@ -46,7 +46,7 @@ namespace mwmp delay = 3; // 3 sec. } - void GUIChat::open() + void GUIChat::onOpen() { // Give keyboard focus to the combo box whenever the console is // turned on @@ -54,7 +54,7 @@ namespace mwmp windowState = CHAT_ENABLED; } - void GUIChat::close() + void GUIChat::onClose() { // Apparently, hidden widgets can retain key focus // Remove for MyGUI 3.2.2 @@ -62,9 +62,10 @@ namespace mwmp SetEditState(0); } - void GUIChat::exit() + bool GUIChat::exit() { //WindowBase::exit(); + return true; } void GUIChat::acceptCommand(MyGUI::EditBox *_sender) diff --git a/apps/openmw/mwmp/GUI/GUIChat.hpp b/apps/openmw/mwmp/GUI/GUIChat.hpp index ca75ec21d..059882561 100644 --- a/apps/openmw/mwmp/GUI/GUIChat.hpp +++ b/apps/openmw/mwmp/GUI/GUIChat.hpp @@ -43,11 +43,10 @@ namespace mwmp void Update(float dt); + virtual void onOpen(); + virtual void onClose(); - virtual void open(); - virtual void close(); - - virtual void exit(); + virtual bool exit(); void setFont(const std::string &fntName); diff --git a/apps/openmw/mwmp/GUI/TextInputDialog.cpp b/apps/openmw/mwmp/GUI/TextInputDialog.cpp index 484bb64d0..38793a6eb 100644 --- a/apps/openmw/mwmp/GUI/TextInputDialog.cpp +++ b/apps/openmw/mwmp/GUI/TextInputDialog.cpp @@ -55,9 +55,9 @@ namespace mwmp setText("TextNote", note); } - void TextInputDialog::open() + void TextInputDialog::onOpen() { - WindowModal::open(); + WindowModal::onOpen(); // Make sure the edit box has focus MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mTextEdit); } diff --git a/apps/openmw/mwmp/GUI/TextInputDialog.hpp b/apps/openmw/mwmp/GUI/TextInputDialog.hpp index 1c755e12d..cf6b3a1ff 100644 --- a/apps/openmw/mwmp/GUI/TextInputDialog.hpp +++ b/apps/openmw/mwmp/GUI/TextInputDialog.hpp @@ -29,7 +29,7 @@ namespace mwmp void setEditPassword(bool value); - virtual void open(); + virtual void onOpen(); /** Event : Dialog finished, OK button clicked.\n signature : void method()\n diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 16a3d4441..691eab1f3 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -719,7 +719,7 @@ void LocalPlayer::addTopics() env.getDialogueManager()->addTopic(topicId); if (env.getWindowManager()->containsMode(MWGui::GM_Dialogue)) - env.getDialogueManager()->updateTopics(); + env.getDialogueManager()->updateActorKnownTopics(); } } @@ -1369,10 +1369,9 @@ void LocalPlayer::storeCellState(ESM::Cell cell, int stateType) cellStateChanges.cellStates.push_back(cellState); } -void LocalPlayer::storeCurrentContainer(const MWWorld::Ptr &container, bool loot) +void LocalPlayer::storeCurrentContainer(const MWWorld::Ptr &container) { currentContainer.refId = container.getCellRef().getRefId(); currentContainer.refNumIndex = container.getCellRef().getRefNum().mIndex; currentContainer.mpNum = container.getCellRef().getMpNum(); - currentContainer.loot = loot; } diff --git a/apps/openmw/mwmp/LocalPlayer.hpp b/apps/openmw/mwmp/LocalPlayer.hpp index 23308428c..7c0a06353 100644 --- a/apps/openmw/mwmp/LocalPlayer.hpp +++ b/apps/openmw/mwmp/LocalPlayer.hpp @@ -86,7 +86,7 @@ namespace mwmp void clearCurrentContainer(); void storeCellState(ESM::Cell cell, int stateType); - void storeCurrentContainer(const MWWorld::Ptr& container, bool loot); + void storeCurrentContainer(const MWWorld::Ptr& container); private: Networking *getNetworking(); diff --git a/apps/openmw/mwmp/WorldEvent.cpp b/apps/openmw/mwmp/WorldEvent.cpp index c7f304ec1..43f663447 100644 --- a/apps/openmw/mwmp/WorldEvent.cpp +++ b/apps/openmw/mwmp/WorldEvent.cpp @@ -142,7 +142,7 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) currentContainer->mpNum == ptrFound.getCellRef().getMpNum()) { MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Container); - MWBase::Environment::get().getWindowManager()->openContainer(ptrFound, currentContainer->loot); + MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Container, ptrFound); } } }