From fbcc8ef046b8a2ad122fd4af895b29e590c5109f Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Tue, 14 Apr 2020 08:49:14 +0300 Subject: [PATCH] Reset dialogue history when the window can't track what closed it --- apps/openmw/mwgui/dialogue.cpp | 6 ++---- apps/openmw/mwgui/dialogue.hpp | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index bb3f3e4ba..bb40bea33 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -355,7 +355,6 @@ namespace MWGui { if (exit()) { - resetHistory(); MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue); } } @@ -476,8 +475,9 @@ namespace MWGui mDeleteLater.clear(); } - void DialogueWindow::resetHistory() + void DialogueWindow::onClose() { + // Reset history for (DialogueText* text : mHistoryContents) delete text; mHistoryContents.clear(); @@ -663,7 +663,6 @@ namespace MWGui void DialogueWindow::onGoodbyeActivated() { - resetHistory(); MWBase::Environment::get().getDialogueManager()->goodbyeSelected(); MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue); resetReference(); @@ -718,7 +717,6 @@ namespace MWGui void DialogueWindow::onReferenceUnavailable() { - resetHistory(); MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue); } diff --git a/apps/openmw/mwgui/dialogue.hpp b/apps/openmw/mwgui/dialogue.hpp index 77c767ed8..2c3fb1a44 100644 --- a/apps/openmw/mwgui/dialogue.hpp +++ b/apps/openmw/mwgui/dialogue.hpp @@ -133,6 +133,8 @@ namespace MWGui void updateTopics(); + void onClose(); + protected: void updateTopicsPane(); bool isCompanion(const MWWorld::Ptr& actor); @@ -156,7 +158,6 @@ namespace MWGui void updateDisposition(); void restock(); void deleteLater(); - void resetHistory(); bool mIsCompanion; std::list mKeywords;