From 0146a3c6b6bdb16eef6f46e116b0d9fe9883858f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 26 Jun 2016 07:23:15 -0400 Subject: TITANIC: Added remaining CPetControl methods --- engines/titanic/pet_control/pet_control.h | 80 +++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 21 deletions(-) (limited to 'engines/titanic/pet_control/pet_control.h') diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h index 5e47f3299b..c3afb7862b 100644 --- a/engines/titanic/pet_control/pet_control.h +++ b/engines/titanic/pet_control/pet_control.h @@ -46,13 +46,13 @@ class CPetControl : public CGameObject { DECLARE_MESSAGE_MAP struct PetEventInfo { int _id; - void *_target; + CPetSection *_target; PetEventInfo() : _id(0), _target(nullptr) {} }; private: - int _fieldC0; - int _locked; - int _fieldC8; + int _inputLockCount; + int _areaLockCount; + int _areaChangeType; CPetSection *_sections[7]; CPetConversations _conversations; CPetInventory _inventory; @@ -162,13 +162,6 @@ public: */ void resetRemoteTarget(); - /** - * Resets the Active NPC - */ - void resetActiveNPC(); - - bool fn1(int val); - /** * Set the remote target */ @@ -194,10 +187,6 @@ public: */ void highlightGlyph(int id); - /** - * Returns true if the PET is currently unlocked - */ - bool isUnlocked() const { return _locked == 0; } /** * Returns a game object used by the PET by name from within the @@ -274,7 +263,11 @@ public: */ void moveToHiddenRoom(CTreeItem *item); - void setC8(int val) { _fieldC8 = val; } + /** + * Sets a change for the PET Area's glyphs. Only applicable when + * the Inventory is the active tab + */ + void setAreaChangeType(int changeType) { _areaChangeType = changeType; } /** * Play a sound @@ -297,9 +290,9 @@ public: void summonNPC(const CString &name, int val); /** - * Start a timer + * Start a timer for a Pet Area */ - void startPetTimer(uint timerIndex, uint firstDuration, uint duration, void *target); + void startPetTimer(uint timerIndex, uint firstDuration, uint duration, CPetSection *target); /** * Stop a timer @@ -312,14 +305,59 @@ public: */ CString getFullViewName(); - bool getC0() const { return _fieldC0 > 0; } - void incC0() { ++_fieldC0; } - void decC0() { --_fieldC0; } + /** + * Returns true if all input is currently locked (disabled) + */ + bool isInputLocked() const { return _inputLockCount > 0; } + + /** + * Increments the input locked count + */ + void incInputLocks() { ++_inputLockCount; } + + /** + * Decremenst the input locked count + */ + void decInputLocks() { --_inputLockCount; } + + /** + * Returns true if the PET is currently unlocked + */ + bool isAreaActive() const { return _areaLockCount == 0; } + + /** + * Increment the number of PET area (tab) locks + */ + void incAreaLocks() { ++_areaLockCount; } + + /** + * Decrement the number of PET area (tab) locks + */ + void decAreaLocks() { + _areaLockCount = MAX(_areaLockCount - 1, 0); + } bool isSuccUBusActive() const; /*--- CPetConversations methods ---*/ + /** + * Sets the active NPC + */ + void setActiveNPC(const CString &name) { + _conversations.setActiveNPC(name); + } + + /** + * Resets the Active NPC + */ + void resetActiveNPC(); + + /** + * Resets the conversation dials back to 0 position + */ + void resetDials0() { _conversations.resetDials0(); } + /** * Resets the dial display in the conversation tab to reflect new values */ -- cgit v1.2.3