From a79955352fe2e69f158b53d51a4ccc5a26b01993 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 14 May 2019 14:20:27 +0400 Subject: [PATCH] Revert MR !103 and !105 since they cause issues with dialogue window --- apps/openmw/mwgui/dialogue.cpp | 19 ++++++++----------- apps/openmw/mwgui/dialogue.hpp | 2 -- apps/openmw/mwgui/windowmanagerimp.cpp | 4 ++-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index f407a2d59..6b400c172 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -432,29 +432,26 @@ namespace MWGui mGoodbye = false; mTopicsList->setEnabled(true); - setTitle(mPtr.getClass().getName(mPtr)); - - updateDisposition(); - restock(); - } - - void DialogueWindow::onOpen() - { - if (!MWBase::Environment::get().getDialogueManager()->startDialogue(mPtr, mGreetingCallback.get())) + if (!MWBase::Environment::get().getDialogueManager()->startDialogue(actor, mGreetingCallback.get())) { // No greetings found. The dialogue window should not be shown. // If this is a companion, we must show the companion window directly (used by BM_bear_be_unique). MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue); - if (isCompanion(mPtr)) - MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Companion, mPtr); mPtr = MWWorld::Ptr(); + if (isCompanion(actor)) + MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Companion, actor); return; } + MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mGoodbyeButton); + setTitle(mPtr.getClass().getName(mPtr)); + updateTopics(); updateTopicsPane(); // force update for new services + updateDisposition(); + restock(); } void DialogueWindow::restock() diff --git a/apps/openmw/mwgui/dialogue.hpp b/apps/openmw/mwgui/dialogue.hpp index fdae1ab1a..2538602c6 100644 --- a/apps/openmw/mwgui/dialogue.hpp +++ b/apps/openmw/mwgui/dialogue.hpp @@ -122,8 +122,6 @@ namespace MWGui void setPtr(const MWWorld::Ptr& actor); - void onOpen(); - void setKeywords(std::list keyWord); void addResponse (const std::string& title, const std::string& text, bool needMargin = true); diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 952cb05ee..f8ebc4748 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -1271,8 +1271,6 @@ namespace MWGui if (mode==GM_Inventory && mAllowed==GW_None) return; - for (WindowBase* window : mGuiModeStates[mode].mWindows) - window->setPtr(arg); if (mGuiModes.empty() || mGuiModes.back() != mode) { // If this mode already exists somewhere in the stack, just bring it to the front. @@ -1291,6 +1289,8 @@ namespace MWGui mGuiModeStates[mode].update(true); playSound(mGuiModeStates[mode].mOpenSound); } + for (WindowBase* window : mGuiModeStates[mode].mWindows) + window->setPtr(arg); mKeyboardNavigation->restoreFocus(mode);