diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/pet_control/pet_conversations.cpp | 17 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_text.cpp | 16 |
2 files changed, 30 insertions, 3 deletions
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp index c884d181d3..d5f4da41c6 100644 --- a/engines/titanic/pet_control/pet_conversations.cpp +++ b/engines/titanic/pet_control/pet_conversations.cpp @@ -61,6 +61,7 @@ bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) { if (_doorBot.MouseButtonUpMsg(msg->_mousePos)) { switch (canSummonNPC("DoorBot")) { case SUMMON_CANT: + _log.addLine("Sadly, it is not possible to summon the DoorBot from this location.", getColor(1)); break; case SUMMON_CAN: summonNPC("DoorBot"); @@ -71,10 +72,24 @@ bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) { // Scroll to the bottom of the log scrollToBottom(); + return true; } if (_bellBot.MouseButtonUpMsg(msg->_mousePos)) { - // TODO + switch (canSummonNPC("BellBot")) { + case SUMMON_CANT: + _log.addLine("Sadly, it is not possible to summon the BellBot from this location.", getColor(1)); + break; + case SUMMON_CAN: + summonNPC("BellBot"); + return true; + default: + break; + } + + // Scroll to the bottom of the log + scrollToBottom(); + return true; } return false; diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp index 67910dc18c..c31d4fd851 100644 --- a/engines/titanic/pet_control/pet_text.cpp +++ b/engines/titanic/pet_control/pet_text.cpp @@ -292,8 +292,20 @@ void CPetText::addLine(const CString &str, uint color) { } void CPetText::addLine(const CString &str, byte r, byte g, byte b) { - warning("TODO: CPetText::addLine"); -} + if (_lineCount == ((int)_array.size() - 1)) { + // Lines array is full + if (_array.size() > 1) { + // Delete the oldest line, and add a new entry at the end + _array.remove_at(0); + _array.resize(_array.size() + 1); + } + + --_lineCount; + } + setLineColor(_lineCount, r, g, b); + changeText(str); + ++_lineCount; +} } // End of namespace Titanic |