From f114f9e8c5c9e663ef1eea268dbc2d2287c6b646 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 28 Aug 2016 19:10:29 -0400 Subject: TITANIC: Implemented some stubbed methods --- engines/titanic/carry/carry.h | 2 +- engines/titanic/npcs/bellbot.cpp | 3 +-- engines/titanic/pet_control/pet_control.cpp | 3 ++- engines/titanic/pet_control/pet_load_save.h | 10 +++++----- engines/titanic/pet_control/pet_save.cpp | 20 +++++++++++++++++--- 5 files changed, 26 insertions(+), 12 deletions(-) (limited to 'engines/titanic') diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h index fb5519e290..06e446a1b5 100644 --- a/engines/titanic/carry/carry.h +++ b/engines/titanic/carry/carry.h @@ -44,7 +44,6 @@ class CCarry : public CGameObject { bool EnterViewMsg(CEnterViewMsg *msg); bool PassOnDragStartMsg(CPassOnDragStartMsg *msg); protected: - CString _string1; int _fieldDC; CString _string3; CString _string4; @@ -59,6 +58,7 @@ protected: bool _enterFrameSet; int _visibleFrame; public: + CString _string1; int _fieldE0; Point _origPos; CString _fullViewName; diff --git a/engines/titanic/npcs/bellbot.cpp b/engines/titanic/npcs/bellbot.cpp index ac6881a45c..0170491270 100644 --- a/engines/titanic/npcs/bellbot.cpp +++ b/engines/titanic/npcs/bellbot.cpp @@ -135,8 +135,7 @@ bool CBellBot::MovieEndMsg(CMovieEndMsg *msg) { } bool CBellBot::Use(CUse *msg) { - error("TODO: Figure out what msg->_item points to"); - // msg->_item = "Bellbot"; + dynamic_cast(msg->_item)->_string1 = "Bellbot"; return true; } diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp index d7016da02e..a0f8fab267 100644 --- a/engines/titanic/pet_control/pet_control.cpp +++ b/engines/titanic/pet_control/pet_control.cpp @@ -359,7 +359,8 @@ bool CPetControl::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { } bool CPetControl::TimerMsg(CTimerMsg *msg) { - warning("TODO: CPetControl::CTimerMsg"); + if (_timers[msg->_actionVal]._target) + _timers[msg->_actionVal]._target->timerExpired(msg->_actionVal); return true; } diff --git a/engines/titanic/pet_control/pet_load_save.h b/engines/titanic/pet_control/pet_load_save.h index dd1c907ef1..26ddec0ff9 100644 --- a/engines/titanic/pet_control/pet_load_save.h +++ b/engines/titanic/pet_control/pet_load_save.h @@ -37,11 +37,6 @@ private: */ Rect getSlotBounds(int index); - /** - * Highlight one of the slots - */ - void highlightSlot(int index); - /** * Called when savegame slot highlight changes or the view is reset */ @@ -67,6 +62,11 @@ protected: * Reset the slot names list */ void resetSlots(); + + /** + * Highlight one of the slots + */ + void highlightSlot(int index); public: /** * Setup the glyph diff --git a/engines/titanic/pet_control/pet_save.cpp b/engines/titanic/pet_control/pet_save.cpp index b5e16736bc..9305759117 100644 --- a/engines/titanic/pet_control/pet_save.cpp +++ b/engines/titanic/pet_control/pet_save.cpp @@ -22,6 +22,7 @@ #include "titanic/pet_control/pet_save.h" #include "titanic/pet_control/pet_control.h" +#include "titanic/core/project_item.h" namespace Titanic { @@ -58,15 +59,28 @@ void CPetSave::getTooltip(CPetText *text) { } void CPetSave::highlightSave(int index) { - warning("TODO: CPetSave::highlightSave"); + if (index >= 0) + _slotNames[index].showCursor(-2); } void CPetSave::unhighlightSave(int index) { - warning("TODO: CPetSave::unhighlightSave"); + if (index >= 0) + _slotNames[index].hideCursor(); } void CPetSave::execute() { - warning("TODO: CPetSave::execute"); + CPetControl *pet = getPetControl(); + if (_savegameSlotNum >= 0) { + highlightSlot(-1); + CProjectItem *project = pet ? pet->getRoot() : nullptr; + + if (project) { + project->saveGame(_savegameSlotNum, _slotNames[_savegameSlotNum].getText()); + pet->displayMessage(""); + } + } else if (pet) { + pet->displayMessage("You must select a game to save first."); + } } } // End of namespace Titanic -- cgit v1.2.3