Go back to index when selecting 'cancel' on topics list

0.6.1
scrawl 8 years ago
parent 196eedf1b0
commit 43279c49b5

@ -58,6 +58,7 @@ namespace
Book mTopicIndexBook; Book mTopicIndexBook;
bool mQuestMode; bool mQuestMode;
bool mOptionsMode; bool mOptionsMode;
bool mTopicsMode;
bool mAllQuests; bool mAllQuests;
template <typename T> template <typename T>
@ -196,6 +197,7 @@ namespace
mQuestMode = false; mQuestMode = false;
mAllQuests = false; mAllQuests = false;
mOptionsMode = false; mOptionsMode = false;
mTopicsMode = false;
} }
void adjustButton (char const * name) void adjustButton (char const * name)
@ -259,6 +261,7 @@ namespace
void setBookMode () void setBookMode ()
{ {
mOptionsMode = false; mOptionsMode = false;
mTopicsMode = false;
setVisible (OptionsBTN, true); setVisible (OptionsBTN, true);
setVisible (OptionsOverlay, false); setVisible (OptionsOverlay, false);
@ -269,6 +272,7 @@ namespace
void setOptionsMode () void setOptionsMode ()
{ {
mOptionsMode = true; mOptionsMode = true;
mTopicsMode = false;
setVisible (OptionsBTN, false); setVisible (OptionsBTN, false);
setVisible (OptionsOverlay, true); setVisible (OptionsOverlay, true);
@ -372,6 +376,7 @@ namespace
setVisible (JournalBTN, true); setVisible (JournalBTN, true);
mOptionsMode = false; mOptionsMode = false;
mTopicsMode = false;
MWBase::Environment::get().getWindowManager()->playSound("book page"); MWBase::Environment::get().getWindowManager()->playSound("book page");
} }
@ -432,6 +437,8 @@ namespace
setVisible (RightTopicIndex, false); setVisible (RightTopicIndex, false);
setVisible (TopicsList, true); setVisible (TopicsList, true);
mTopicsMode = true;
Gui::MWList* list = getWidget<Gui::MWList>(TopicsList); Gui::MWList* list = getWidget<Gui::MWList>(TopicsList);
list->clear(); list->clear();
@ -447,6 +454,7 @@ namespace
void notifyTopics(MyGUI::Widget* _sender) void notifyTopics(MyGUI::Widget* _sender)
{ {
mQuestMode = false; mQuestMode = false;
mTopicsMode = false;
setVisible (LeftTopicIndex, true); setVisible (LeftTopicIndex, true);
setVisible (RightTopicIndex, true); setVisible (RightTopicIndex, true);
setVisible (TopicsList, false); setVisible (TopicsList, false);
@ -524,9 +532,16 @@ namespace
void notifyCancel(MyGUI::Widget* _sender) 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) void notifyClose(MyGUI::Widget* _sender)

Loading…
Cancel
Save