From 91d40fdd69da3b4c0ecc7107c0e5488443ad376f Mon Sep 17 00:00:00 2001 From: Andrei Prykhodko Date: Fri, 29 Jun 2018 17:46:15 +0300 Subject: PINK: implemented GoToPreviousPage command --- engines/pink/pda_mgr.cpp | 8 ++++++++ engines/pink/pda_mgr.h | 1 + 2 files changed, 9 insertions(+) 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 _globalActors; Common::String _savedPage; + Common::Stack _previousPages; }; } // End of namespace Pink -- cgit v1.2.3