From ea3729790f113120d98fae5940e62f6d852a4e5c Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 8 Oct 2017 09:20:07 +0400 Subject: [PATCH 1/6] Add showsInInventory() check to the ContainerItemModel --- apps/openmw/mwgui/containeritemmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwgui/containeritemmodel.cpp b/apps/openmw/mwgui/containeritemmodel.cpp index 479638672..9f7a9965c 100644 --- a/apps/openmw/mwgui/containeritemmodel.cpp +++ b/apps/openmw/mwgui/containeritemmodel.cpp @@ -142,6 +142,9 @@ void ContainerItemModel::update() for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it) { + if (!(*it).getClass().showsInInventory(*it)) + continue; + std::vector::iterator itemStack = mItems.begin(); for (; itemStack != mItems.end(); ++itemStack) { From dc127fbb93316865f8023977ccb29b91b8f3ad5b Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Sun, 8 Oct 2017 11:58:38 +0200 Subject: [PATCH 2/6] Add a launch checkbox to the OpenMW installer --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0050104cf..50c0d5455 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -497,6 +497,7 @@ if(WIN32) SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.openmw.org") SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.openmw.org") SET(CPACK_NSIS_INSTALLED_ICON_NAME "openmw-launcher.exe") + SET(CPACK_NSIS_MUI_FINISHPAGE_RUN "openmw-launcher.exe") SET(CPACK_NSIS_MUI_ICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico") SET(CPACK_NSIS_MUI_UNIICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico") SET(CPACK_PACKAGE_ICON "${OpenMW_SOURCE_DIR}\\\\files\\\\openmw.bmp") From 479f9535b43fdc528539a632413e35e415007924 Mon Sep 17 00:00:00 2001 From: scrawl <720642+scrawl@users.noreply.github.com> Date: Sun, 8 Oct 2017 20:38:20 +0000 Subject: [PATCH 3/6] Allow training window exit() --- apps/openmw/mwgui/trainingwindow.cpp | 6 ++++++ apps/openmw/mwgui/trainingwindow.hpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/trainingwindow.cpp b/apps/openmw/mwgui/trainingwindow.cpp index b6504d223..04b051e16 100644 --- a/apps/openmw/mwgui/trainingwindow.cpp +++ b/apps/openmw/mwgui/trainingwindow.cpp @@ -203,4 +203,10 @@ namespace MWGui checkReferenceAvailable(); mTimeAdvancer.onFrame(dt); } + + bool TrainingWindow::exit() + { + return !mTimeAdvancer.isRunning(); + } + } diff --git a/apps/openmw/mwgui/trainingwindow.hpp b/apps/openmw/mwgui/trainingwindow.hpp index 69a013059..2edad1f27 100644 --- a/apps/openmw/mwgui/trainingwindow.hpp +++ b/apps/openmw/mwgui/trainingwindow.hpp @@ -16,7 +16,7 @@ namespace MWGui virtual void onOpen(); - bool exit() { return false; } + bool exit(); void setPtr(const MWWorld::Ptr& actor); From 4f112ba3d76c02b9a91f5aee20631912d819fe44 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 10 Oct 2017 04:05:36 +0300 Subject: [PATCH 4/6] [Client] Use regular message boxes where expected to do so This helps us move towards using the same terminology as OpenMW for GUI elements, leading to less confusion. --- apps/openmw/mwmp/GUIController.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/openmw/mwmp/GUIController.cpp b/apps/openmw/mwmp/GUIController.cpp index 9cd496887..e06b4248b 100644 --- a/apps/openmw/mwmp/GUIController.cpp +++ b/apps/openmw/mwmp/GUIController.cpp @@ -118,9 +118,7 @@ void mwmp::GUIController::showDialogList(const mwmp::BasePlayer::GUIMessageBox & void mwmp::GUIController::showMessageBox(const BasePlayer::GUIMessageBox &guiMessageBox) { MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager(); - std::vector buttons; - buttons.push_back("Ok"); - windowManager->interactiveMessageBox(guiMessageBox.label, buttons); + windowManager->messageBox(guiMessageBox.label); calledMessageBox = true; } From c35101cc3636400a44022215bba15e95213562e7 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 10 Oct 2017 04:11:36 +0300 Subject: [PATCH 5/6] [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); From f532ab241d6e589822669d761247397941ab3cbd Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 10 Oct 2017 05:48:56 +0300 Subject: [PATCH 6/6] [Server] Avoid duplicates of the same player in a cell's loaders --- apps/openmw-mp/Cell.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/openmw-mp/Cell.cpp b/apps/openmw-mp/Cell.cpp index 05ce084ac..207b684a6 100644 --- a/apps/openmw-mp/Cell.cpp +++ b/apps/openmw-mp/Cell.cpp @@ -29,8 +29,17 @@ Cell::Iterator Cell::end() const void Cell::addPlayer(Player *player) { - auto it = find(player->cells.begin(), player->cells.end(), this); - if (it == player->cells.end()) + // Ensure the player hasn't already been added + auto it = find(begin(), end(), player); + + if (it != end()) + { + LOG_APPEND(Log::LOG_INFO, "- Attempt to add %s to Cell %s again was ignored", player->npc.mName.c_str(), getDescription().c_str()); + return; + } + + auto it2 = find(player->cells.begin(), player->cells.end(), this); + if (it2 == player->cells.end()) { LOG_APPEND(Log::LOG_INFO, "- Adding %s to Player %s", getDescription().c_str(), player->npc.mName.c_str());