Skip to content

Commit

Permalink
TITANIC: Implemented some stubbed methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Aug 28, 2016
1 parent 01327b5 commit f114f9e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion engines/titanic/carry/carry.h
Expand Up @@ -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;
Expand All @@ -59,6 +58,7 @@ class CCarry : public CGameObject {
bool _enterFrameSet;
int _visibleFrame;
public:
CString _string1;
int _fieldE0;
Point _origPos;
CString _fullViewName;
Expand Down
3 changes: 1 addition & 2 deletions engines/titanic/npcs/bellbot.cpp
Expand Up @@ -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<CCarry *>(msg->_item)->_string1 = "Bellbot";
return true;
}

Expand Down
3 changes: 2 additions & 1 deletion engines/titanic/pet_control/pet_control.cpp
Expand Up @@ -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;
}

Expand Down
10 changes: 5 additions & 5 deletions engines/titanic/pet_control/pet_load_save.h
Expand Up @@ -37,11 +37,6 @@ class CPetLoadSave : public CPetGlyph {
*/
Rect getSlotBounds(int index);

/**
* Highlight one of the slots
*/
void highlightSlot(int index);

/**
* Called when savegame slot highlight changes or the view is reset
*/
Expand All @@ -67,6 +62,11 @@ class CPetLoadSave : public CPetGlyph {
* Reset the slot names list
*/
void resetSlots();

/**
* Highlight one of the slots
*/
void highlightSlot(int index);
public:
/**
* Setup the glyph
Expand Down
20 changes: 17 additions & 3 deletions engines/titanic/pet_control/pet_save.cpp
Expand Up @@ -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 {

Expand Down Expand Up @@ -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

0 comments on commit f114f9e

Please sign in to comment.