aboutsummaryrefslogtreecommitdiff
path: root/engines/pink
diff options
context:
space:
mode:
authorAndrei Prykhodko2018-06-29 17:46:15 +0300
committerAndrei Prykhodko2018-06-29 17:46:55 +0300
commit91d40fdd69da3b4c0ecc7107c0e5488443ad376f (patch)
tree5f360f0347c7635eea9dc1f6f094332eae483da9 /engines/pink
parent247ba1f587929da7040e4d278d51c31a3a4d18ba (diff)
downloadscummvm-rg350-91d40fdd69da3b4c0ecc7107c0e5488443ad376f.tar.gz
scummvm-rg350-91d40fdd69da3b4c0ecc7107c0e5488443ad376f.tar.bz2
scummvm-rg350-91d40fdd69da3b4c0ecc7107c0e5488443ad376f.zip
PINK: implemented GoToPreviousPage command
Diffstat (limited to 'engines/pink')
-rw-r--r--engines/pink/pda_mgr.cpp8
-rw-r--r--engines/pink/pda_mgr.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/engines/pink/pda_mgr.cpp b/engines/pink/pda_mgr.cpp
index 8e8b6eca8b..60b51a4934 100644
--- a/engines/pink/pda_mgr.cpp
+++ b/engines/pink/pda_mgr.cpp
@@ -50,6 +50,12 @@ void PDAMgr::execute(const Command &command) {
case Command::kGoToPage:
goToPage(command.arg);
break;
+ case Command::kGoToPreviousPage: {
+ assert(_previousPages.size() >= 2);
+ _previousPages.pop();
+ goToPage(_previousPages.pop());
+ break;
+ }
case Command::kClose:
close();
break;
@@ -75,6 +81,8 @@ void PDAMgr::goToPage(const Common::String &pageName) {
}
_cursorMgr.setPage(_page);
+
+ _previousPages.push(_page->getName());
}
void PDAMgr::onLeftButtonClick(Common::Point point) {
diff --git a/engines/pink/pda_mgr.h b/engines/pink/pda_mgr.h
index 08c3d96b62..246679dee1 100644
--- a/engines/pink/pda_mgr.h
+++ b/engines/pink/pda_mgr.h
@@ -68,6 +68,7 @@ private:
CursorMgr _cursorMgr;
Array<Actor *> _globalActors;
Common::String _savedPage;
+ Common::Stack<Common::String> _previousPages;
};
} // End of namespace Pink