aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/pda_mgr.cpp22
-rw-r--r--engines/pink/pda_mgr.h2
2 files changed, 24 insertions, 0 deletions
diff --git a/engines/pink/pda_mgr.cpp b/engines/pink/pda_mgr.cpp
index 947ebcc573..0877b0b556 100644
--- a/engines/pink/pda_mgr.cpp
+++ b/engines/pink/pda_mgr.cpp
@@ -201,6 +201,7 @@ void PDAMgr::initPerilButtons() {
domainButton->setAction(kInactiveAction);
updateWheels();
} else {
+ calculateIndexes();
navigatorButton->setAction(kIdleAction);
if (isDomain(_page->getName()))
domainButton->setAction(kInactiveAction);
@@ -240,4 +241,25 @@ void PDAMgr::updateLocator() {
locator->setAction(g_countries[_countryIndex]);
}
+void PDAMgr::calculateIndexes() {
+ Common::String country = Common::String::format("%.3s", _page->getName().c_str());
+ for (uint i = 0; i < 6; ++i) {
+ if (country == g_countries[i]) {
+ _countryIndex = i;
+ break;
+ }
+ }
+
+ Common::String domain = _page->getName();
+ domain.erase(0, 3);
+ if (domain.size() >= 4)
+ domain.erase(3);
+ for (uint i = 0; i < 8; ++i) {
+ if (domain == g_domains[i]) {
+ _domainIndex = i;
+ break;
+ }
+ }
+}
+
} // End of namespace Pink
diff --git a/engines/pink/pda_mgr.h b/engines/pink/pda_mgr.h
index 92ebcf165f..afcae1ba53 100644
--- a/engines/pink/pda_mgr.h
+++ b/engines/pink/pda_mgr.h
@@ -68,6 +68,8 @@ private:
void updateWheels(bool playSfx = 0);
void updateLocator();
+ void calculateIndexes();
+
static bool isNavigate(const Common::String &name);
static bool isDomain(const Common::String &name);