diff options
author | Paul Gilbert | 2016-04-28 20:30:13 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:22:36 -0400 |
commit | ff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f (patch) | |
tree | fc70218725ad20467ff8fd027b7210620284a9e0 | |
parent | de7329619612514e8fd3e9ba1f3e6d7389fd199d (diff) | |
download | scummvm-rg350-ff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f.tar.gz scummvm-rg350-ff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f.tar.bz2 scummvm-rg350-ff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f.zip |
TITANIC: Implement PET Conversations mouse up, and text addLine
-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 |