From 43279c49b50a4a13218bc6c8930d958244b440a7 Mon Sep 17 00:00:00 2001 From: scrawl <720642+scrawl@users.noreply.github.com> Date: Sun, 30 Jul 2017 23:51:32 +0200 Subject: [PATCH] Go back to index when selecting 'cancel' on topics list --- apps/openmw/mwgui/journalwindow.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/journalwindow.cpp b/apps/openmw/mwgui/journalwindow.cpp index bb8d5fd4e..105f95085 100644 --- a/apps/openmw/mwgui/journalwindow.cpp +++ b/apps/openmw/mwgui/journalwindow.cpp @@ -58,6 +58,7 @@ namespace Book mTopicIndexBook; bool mQuestMode; bool mOptionsMode; + bool mTopicsMode; bool mAllQuests; template @@ -196,6 +197,7 @@ namespace mQuestMode = false; mAllQuests = false; mOptionsMode = false; + mTopicsMode = false; } void adjustButton (char const * name) @@ -259,6 +261,7 @@ namespace void setBookMode () { mOptionsMode = false; + mTopicsMode = false; setVisible (OptionsBTN, true); setVisible (OptionsOverlay, false); @@ -269,6 +272,7 @@ namespace void setOptionsMode () { mOptionsMode = true; + mTopicsMode = false; setVisible (OptionsBTN, false); setVisible (OptionsOverlay, true); @@ -372,6 +376,7 @@ namespace setVisible (JournalBTN, true); mOptionsMode = false; + mTopicsMode = false; MWBase::Environment::get().getWindowManager()->playSound("book page"); } @@ -432,6 +437,8 @@ namespace setVisible (RightTopicIndex, false); setVisible (TopicsList, true); + mTopicsMode = true; + Gui::MWList* list = getWidget(TopicsList); list->clear(); @@ -447,6 +454,7 @@ namespace void notifyTopics(MyGUI::Widget* _sender) { mQuestMode = false; + mTopicsMode = false; setVisible (LeftTopicIndex, true); setVisible (RightTopicIndex, true); setVisible (TopicsList, false); @@ -524,9 +532,16 @@ namespace void notifyCancel(MyGUI::Widget* _sender) { - setBookMode(); + if (mTopicsMode) + { + notifyTopics(_sender); + } + else + { + setBookMode(); + MWBase::Environment::get().getWindowManager()->playSound("book page"); + } - MWBase::Environment::get().getWindowManager()->playSound("book page"); } void notifyClose(MyGUI::Widget* _sender)