diff options
Diffstat (limited to 'engines/titanic/pet_control/pet_section.cpp')
-rw-r--r-- | engines/titanic/pet_control/pet_section.cpp | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index 116fd94ddb..a29a8f8115 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -39,30 +39,36 @@ static const uint PALETTE3[5] = { }; void CPetSection::displayMessage(const CString &msg) { - error("TODO"); + CPetText *text = getText(); + + if (text) { + text->setColor(getColor(1)); + _petControl->makeDirty(); + removeText(5000); + } } void CPetSection::proc25(int val) { if (!val) { - proc28(); + removeText(); _petControl->makeDirty(); } } -void CPetSection::proc27(int duration) { +void CPetSection::removeText(int duration) { if (duration > 0) _petControl->startPetTimer(0, duration, 0, this); else - proc28(); + removeText(); } -void CPetSection::proc28() { +void CPetSection::removeText() { CPetText *text = getText(); if (text) text->setup(); } -void CPetSection::proc29() { +void CPetSection::stopTextTimer() { _petControl->stopPetTimer(0); } @@ -83,4 +89,21 @@ const uint *CPetSection::getColorTable(int tableNum) { } } +void CPetSection::areaChanged(PetArea area) { + if (_petControl && _petControl->_currentArea == area) + _petControl->makeDirty(); +} + +CString CPetSection::getActiveNPCName() const { + if (_petControl && _petControl->_activeNPC) + return _petControl->_activeNPC->getName(); + else + return CString(); +} + +void CPetSection::copyColors(uint tableNum, uint colors[5]) { + const uint *src = getColorTable(tableNum); + Common::copy(src, src + 5, colors); +} + } // End of namespace Titanic |