diff options
author | Paul Gilbert | 2016-09-11 14:16:11 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-09-11 14:16:11 -0400 |
commit | dd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0 (patch) | |
tree | f1608efae67f5475ddf4fe456fdd7a9df1aed3d9 /engines/titanic/pet_control | |
parent | f207bc86cb29c6b941aeb3da0444d56e7d4d408d (diff) | |
download | scummvm-rg350-dd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0.tar.gz scummvm-rg350-dd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0.tar.bz2 scummvm-rg350-dd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0.zip |
TITANIC: Extra loading logic and translation code for German version
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r-- | engines/titanic/pet_control/pet_show_translation.cpp | 68 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_show_translation.h | 4 |
2 files changed, 63 insertions, 9 deletions
diff --git a/engines/titanic/pet_control/pet_show_translation.cpp b/engines/titanic/pet_control/pet_show_translation.cpp index 2a3b024324..cf52916b3b 100644 --- a/engines/titanic/pet_control/pet_show_translation.cpp +++ b/engines/titanic/pet_control/pet_show_translation.cpp @@ -25,7 +25,7 @@ namespace Titanic { -BEGIN_MESSAGE_MAP(CPetShowTranslation, CGameObject) +BEGIN_MESSAGE_MAP(CPETShowTranslation, CGameObject) ON_MESSAGE(EnterViewMsg) ON_MESSAGE(LeaveViewMsg) ON_MESSAGE(ChangeSeasonMsg) @@ -33,17 +33,17 @@ BEGIN_MESSAGE_MAP(CPetShowTranslation, CGameObject) END_MESSAGE_MAP() -void CPetShowTranslation::save(SimpleFile *file, int indent) { +void CPETShowTranslation::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); CGameObject::save(file, indent); } -void CPetShowTranslation::load(SimpleFile *file) { +void CPETShowTranslation::load(SimpleFile *file) { file->readNumber(); CGameObject::load(file); } -bool CPetShowTranslation::EnterViewMsg(CEnterViewMsg *msg) { +bool CPETShowTranslation::EnterViewMsg(CEnterViewMsg *msg) { CPetControl *pet = getPetControl(); if (!pet) return true; @@ -113,15 +113,69 @@ bool CPetShowTranslation::EnterViewMsg(CEnterViewMsg *msg) { return true; } -bool CPetShowTranslation::LeaveViewMsg(CLeaveViewMsg *msg) { +bool CPETShowTranslation::LeaveViewMsg(CLeaveViewMsg *msg) { + CPetControl *pet = getPetControl(); + if (pet) + pet->clearTranslation(); + return true; } -bool CPetShowTranslation::ChangeSeasonMsg(CChangeSeasonMsg *msg) { +bool CPETShowTranslation::ChangeSeasonMsg(CChangeSeasonMsg *msg) { + CPetControl *pet = getPetControl(); + if (pet) { + pet->clearTranslation(); + + CString viewName = getFullViewName(); + if (viewName == "Arboretum.Node 2.N" || viewName == "FrozenArboretum.Node 2.N") { + if (msg->_season == "Summer") + pet->addTranslation(DE_SUMMER_ARBORETUM, DE_SUMMER); + else if (msg->_season == "Autumn") + pet->addTranslation(DE_AUTUMN_ARBORETUM, DE_AUTUMN); + else if (msg->_season == "Winter") + pet->addTranslation(DE_WINTER_ARBORETUM, DE_WINTER); + else if (msg->_season == "Spring") + pet->addTranslation(DE_SPRING_ARBORETUM, DE_SPRING); + + pet->addTranslation(DE_ARBORETUM_MSG1, DE_ARBORETUM_MSG2); + } + } + return true; } -bool CPetShowTranslation::ArboretumGateMsg(CArboretumGateMsg *msg) { +bool CPETShowTranslation::ArboretumGateMsg(CArboretumGateMsg *msg) { + CPetControl *pet = getPetControl(); + if (pet) { + pet->clearTranslation(); + + CString viewName = getFullViewName(); + if (viewName == "Arboretum.Node 2.N" || viewName == "FrozenArboretum.Node 2.N") { + switch (stateGetSeason()) { + case SEASON_SUMMER: + pet->addTranslation(DE_SUMMER_ARBORETUM, DE_SUMMER); + break; + + case SEASON_AUTUMN: + pet->addTranslation(DE_AUTUMN_ARBORETUM, DE_AUTUMN); + break; + + case SEASON_WINTER: + pet->addTranslation(DE_WINTER_ARBORETUM, DE_WINTER); + break; + + case SEASON_SPRING: + pet->addTranslation(DE_SPRING_ARBORETUM, DE_SPRING); + break; + + default: + break; + } + + pet->addTranslation(DE_ARBORETUM_MSG1, DE_ARBORETUM_MSG2); + } + } + return true; } diff --git a/engines/titanic/pet_control/pet_show_translation.h b/engines/titanic/pet_control/pet_show_translation.h index cef9708616..a0feae8504 100644 --- a/engines/titanic/pet_control/pet_show_translation.h +++ b/engines/titanic/pet_control/pet_show_translation.h @@ -31,7 +31,7 @@ namespace Titanic { * Used by the German version to show contextual translation of * English background text throughout the game */ -class CPetShowTranslation: public CGameObject { +class CPETShowTranslation: public CGameObject { DECLARE_MESSAGE_MAP; bool EnterViewMsg(CEnterViewMsg *msg); bool LeaveViewMsg(CLeaveViewMsg *msg); @@ -39,7 +39,7 @@ class CPetShowTranslation: public CGameObject { bool ArboretumGateMsg(CArboretumGateMsg *msg); public: CLASSDEF; - CPetShowTranslation() : CGameObject() {} + CPETShowTranslation() : CGameObject() {} /** * Save the data for the class to file |