From c4d5203e14e50d80b83f50685f1031d6a64b11f4 Mon Sep 17 00:00:00 2001 From: Phillip A Date: Thu, 9 May 2019 23:28:43 +0000 Subject: [PATCH] Fix MR !103 breaking of dialogue with actors with no greetings --- apps/openmw/mwgui/dialogue.cpp | 19 +++++++++++-------- apps/openmw/mwgui/dialogue.hpp | 2 ++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index 6b400c172..f407a2d59 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -432,26 +432,29 @@ namespace MWGui mGoodbye = false; mTopicsList->setEnabled(true); - if (!MWBase::Environment::get().getDialogueManager()->startDialogue(actor, mGreetingCallback.get())) + setTitle(mPtr.getClass().getName(mPtr)); + + updateDisposition(); + restock(); + } + + void DialogueWindow::onOpen() + { + if (!MWBase::Environment::get().getDialogueManager()->startDialogue(mPtr, 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 2538602c6..fdae1ab1a 100644 --- a/apps/openmw/mwgui/dialogue.hpp +++ b/apps/openmw/mwgui/dialogue.hpp @@ -122,6 +122,8 @@ 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);