diff options
author | Andrei Prykhodko | 2018-06-30 12:54:52 +0300 |
---|---|---|
committer | Andrei Prykhodko | 2018-06-30 12:54:52 +0300 |
commit | ef9892dbd4c15f30586c8532e4e6ab56215b1582 (patch) | |
tree | db986683b7b6a2366a63158dd3a9a40a96cee7ae /engines/pink | |
parent | 699f38b5fd8ea9a96624840f8c65dc96f1b54f27 (diff) | |
download | scummvm-rg350-ef9892dbd4c15f30586c8532e4e6ab56215b1582.tar.gz scummvm-rg350-ef9892dbd4c15f30586c8532e4e6ab56215b1582.tar.bz2 scummvm-rg350-ef9892dbd4c15f30586c8532e4e6ab56215b1582.zip |
PINK: implemented Inc/Dec Countries/Domains commands
Diffstat (limited to 'engines/pink')
-rw-r--r-- | engines/pink/constants.h | 4 | ||||
-rw-r--r-- | engines/pink/pda_mgr.cpp | 51 | ||||
-rw-r--r-- | engines/pink/pda_mgr.h | 3 |
3 files changed, 51 insertions, 7 deletions
diff --git a/engines/pink/constants.h b/engines/pink/constants.h index abf7ba8b95..ce0e6a9988 100644 --- a/engines/pink/constants.h +++ b/engines/pink/constants.h @@ -198,12 +198,16 @@ static const char * const kTrueValue = "TRUE"; static const char * const kCountryWheel = "CountryWheel"; static const char * const kDomainWheel = "DomainWheel"; +static const char * const kLocator = "Locator"; + static const char * const kPreviousPageButton = "PreviousPageButton"; static const char * const kDomainButton = "DomainButton"; static const char * const kNavigatorButton = "NavigatorButton"; static const char * const kNavigatePage = "NAVIGATE"; +static const char * const kSfx = "SFX"; + } // End of namespace Pink #endif diff --git a/engines/pink/pda_mgr.cpp b/engines/pink/pda_mgr.cpp index ddf5eb00f2..01a4d2dc11 100644 --- a/engines/pink/pda_mgr.cpp +++ b/engines/pink/pda_mgr.cpp @@ -55,18 +55,38 @@ void PDAMgr::execute(const Command &command) { case Command::kGoToPage: goToPage(command.arg); break; - case Command::kGoToPreviousPage: { + case Command::kGoToPreviousPage: assert(_previousPages.size() >= 2); _previousPages.pop(); goToPage(_previousPages.pop()); break; - } case Command::kGoToDomain: goToPage(Common::String::format("%.6s", _page->getName().c_str())); break; case Command::kGoToHelp: warning("Command GoToHelp is not supported and won't be"); break; + case Command::kNavigateToDomain: + goToPage(Common::String(g_countries[_countryIndex]) += g_domains[_domainIndex]); + break; + case Command::kIncrementCountry: + _countryIndex = (_countryIndex + 1) % 6; + updateWheels(1); + updateLocator(); + break; + case Command::kDecrementCountry: + _countryIndex = (_countryIndex + 5) % 6; + updateWheels(1); + updateLocator(); + break; + case Command::kIncrementDomain: + _domainIndex = (_domainIndex + 1) % 8; + updateWheels(1); + break; + case Command::kDecrementDomain: + _domainIndex = (_domainIndex + 6) % 8; + updateWheels(1); + break; case Command::kClose: close(); break; @@ -157,7 +177,7 @@ void PDAMgr::initPerilButtons() { else domainButton->setAction(kIdleAction); } - + updateLocator(); } Actor *PDAMgr::findGlobalActor(const Common::String &actorName) { @@ -168,9 +188,22 @@ Actor *PDAMgr::findGlobalActor(const Common::String &actorName) { return nullptr; } -void PDAMgr::updateWheels() { - _page->findActor(kCountryWheel)->setAction(g_countries[_countryIndex]); - _page->findActor(kDomainWheel)->setAction(g_domains[_domainIndex]); +void PDAMgr::updateWheels(bool playSfx) { + Actor *wheel = _page->findActor(kCountryWheel); + if (playSfx && wheel->getAction()->getName() != g_countries[_countryIndex]) { + wheel->setAction(Common::String(g_countries[_countryIndex]) + kSfx); + dynamic_cast<ActionCEL*>(wheel->getAction())->update(); + dynamic_cast<ActionCEL*>(wheel->getAction())->update(); // hack + } + wheel->setAction(g_countries[_countryIndex]); + + wheel = _page->findActor(kDomainWheel); + if (playSfx && wheel->getAction()->getName() != g_domains[_domainIndex]) { + wheel->setAction(Common::String(g_domains[_domainIndex]) + kSfx); + dynamic_cast<ActionCEL*>(wheel->getAction())->update(); + dynamic_cast<ActionCEL*>(wheel->getAction())->update(); // hack + } + wheel->setAction(g_domains[_domainIndex]); } bool PDAMgr::isNavigate(const Common::String &name) { @@ -181,4 +214,10 @@ bool PDAMgr::isDomain(const Common::String &name) { return name.size() == 6; } +void PDAMgr::updateLocator() { + Actor *locator = findGlobalActor(kLocator); + if (locator) + locator->setAction(g_countries[_countryIndex]); +} + } // End of namespace Pink diff --git a/engines/pink/pda_mgr.h b/engines/pink/pda_mgr.h index 0ae16e8102..a81ea7359d 100644 --- a/engines/pink/pda_mgr.h +++ b/engines/pink/pda_mgr.h @@ -64,7 +64,8 @@ private: void initPerilButtons(); - void updateWheels(); + void updateWheels(bool playSfx = 0); + void updateLocator(); Actor *findGlobalActor(const Common::String &actorName); |