aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/pda_mgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pink/pda_mgr.cpp')
-rw-r--r--engines/pink/pda_mgr.cpp63
1 files changed, 40 insertions, 23 deletions
diff --git a/engines/pink/pda_mgr.cpp b/engines/pink/pda_mgr.cpp
index 9cce204ad8..a2cfb5d454 100644
--- a/engines/pink/pda_mgr.cpp
+++ b/engines/pink/pda_mgr.cpp
@@ -32,8 +32,15 @@ namespace Pink {
PDAMgr::PDAMgr(Pink::PinkEngine *game)
: _game(game), _page(nullptr), _cursorMgr(game, nullptr) {}
-void PDAMgr::update() {
- _cursorMgr.update();
+void PDAMgr::loadState(Archive &archive) {
+ _savedPage = archive.readString();
+}
+
+void PDAMgr::saveState(Archive &archive) {
+ if (_page)
+ archive.writeString(_page->getName());
+ else
+ archive.writeString("");
}
void PDAMgr::execute(const Command &command) {
@@ -49,10 +56,6 @@ void PDAMgr::execute(const Command &command) {
}
}
-PinkEngine *PDAMgr::getGame() const {
- return _game;
-}
-
void PDAMgr::goToPage(const Common::String &pageName) {
if (_page && _page->getName() == pageName)
return;
@@ -71,6 +74,37 @@ void PDAMgr::goToPage(const Common::String &pageName) {
_cursorMgr.setPage(_page);
}
+void PDAMgr::update() {
+ _cursorMgr.update();
+}
+
+void PDAMgr::onLeftButtonClick(Common::Point point) {
+ Actor *actor = _game->getDirector()->getActorByPoint(point);
+ if (actor)
+ actor->onClick();
+}
+
+void PDAMgr::onMouseMove(Common::Point point) {
+ Actor *actor = _game->getDirector()->getActorByPoint(point);
+ if (actor && dynamic_cast<PDAButtonActor*>(actor))
+ actor->onMouseOver(point, &_cursorMgr);
+ else _cursorMgr.setCursor(kPDADefaultCursor, point,Common::String());
+}
+
+
+PinkEngine *PDAMgr::getGame() const {
+ return _game;
+}
+
+const Common::String &PDAMgr::getSavedPageName() {
+ return _savedPage;
+}
+
+
+void PDAMgr::setLead(LeadActor *lead) {
+ _lead = lead;
+}
+
void PDAMgr::close() {
for (uint i = 0; i < _globalActors.size(); ++i) {
delete _globalActors[i];
@@ -94,21 +128,4 @@ void PDAMgr::loadGlobal() {
}
}
-void PDAMgr::setLead(LeadActor *lead) {
- _lead = lead;
-}
-
-void PDAMgr::onLeftButtonClick(Common::Point point) {
- Actor *actor = _game->getDirector()->getActorByPoint(point);
- if (actor)
- actor->onClick();
-}
-
-void PDAMgr::onMouseMove(Common::Point point) {
- Actor *actor = _game->getDirector()->getActorByPoint(point);
- if (actor && dynamic_cast<PDAButtonActor*>(actor))
- actor->onMouseOver(point, &_cursorMgr);
- else _cursorMgr.setCursor(kPDADefaultCursor, point,Common::String());
-}
-
} // End of namespace Pink