aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-28 23:30:43 -0400
committerPaul Gilbert2016-07-15 19:16:51 -0400
commit703bb288c17e207f083e75facc750f5c8c30a09e (patch)
tree5948855f96c2358a62cf73b3036f4823d784953b /engines/titanic/core
parent063fd5c26a10a665e1cf1acb78696807d18dea8c (diff)
downloadscummvm-rg350-703bb288c17e207f083e75facc750f5c8c30a09e.tar.gz
scummvm-rg350-703bb288c17e207f083e75facc750f5c8c30a09e.tar.bz2
scummvm-rg350-703bb288c17e207f083e75facc750f5c8c30a09e.zip
TITANIC: Finished Deskbot message handlers
Diffstat (limited to 'engines/titanic/core')
-rw-r--r--engines/titanic/core/game_object.cpp22
-rw-r--r--engines/titanic/core/game_object.h25
-rw-r--r--engines/titanic/core/tree_item.h7
3 files changed, 45 insertions, 9 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 00a7328443..eaf1dfe9a8 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -26,6 +26,7 @@
#include "titanic/core/room_item.h"
#include "titanic/npcs/true_talk_npc.h"
#include "titanic/pet_control/pet_control.h"
+#include "titanic/star_control/star_control.h"
#include "titanic/support/files_manager.h"
#include "titanic/support/screen_manager.h"
#include "titanic/support/video_surface.h"
@@ -624,6 +625,10 @@ void CGameObject::petDisplayMsg(const CString &msg) const {
pet->displayMessage(msg);
}
+void CGameObject::displayMessage(const CString &msg) const {
+ petDisplayMsg(msg);
+}
+
CGameObject *CGameObject::getMailManFirstObject() const {
CMailMan *mailMan = getMailMan();
return mailMan ? mailMan->getFirstObject() : nullptr;
@@ -720,6 +725,12 @@ void CGameObject::dec54() {
getGameManager()->dec54();
}
+void CGameObject::petAddRoom(int roomNum) {
+ CPetControl *petControl = getPetControl();
+ if (petControl)
+ petControl->addRoom(roomNum);
+}
+
void CGameObject::lockMouse() {
CGameManager *gameMan = getGameManager();
gameMan->lockInputHandler();
@@ -827,6 +838,17 @@ CMailMan *CGameObject::getMailMan() const {
return dynamic_cast<CMailMan *>(getDontSaveChild(CMailMan::_type));
}
+CStarControl *CGameObject::getStarControl() const {
+ CStarControl *starControl = static_cast<CStarControl *>(getDontSaveChild(CStarControl::_type));
+ if (!starControl) {
+ CViewItem *view = getGameManager()->getView();
+ if (view)
+ starControl = starControl = static_cast<CStarControl *>(view->findChildInstanceOf(CStarControl::_type));
+ }
+
+ return starControl;
+}
+
CTreeItem *CGameObject::getDontSaveChild(ClassDef *classDef) const {
CProjectItem *root = getRoot();
if (!root)
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index f389815a99..22c62a809d 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -35,9 +35,13 @@ namespace Titanic {
enum Find { FIND_GLOBAL = 1, FIND_ROOM = 2, FIND_PET = 4, FIND_MAILMAN = 8 };
enum Found { FOUND_NONE = 0, FOUND_GLOBAL = 1, FOUND_ROOM = 2, FOUND_PET = 3, FOUND_MAILMAN = 4 };
-class CVideoSurface;
+class CMailMan;
+class CMusicRoom;
+class CRoomItem;
+class CStarControl;
class CMouseDragStartMsg;
class CTrueTalkNPC;
+class CVideoSurface;
class OSMovie;
class CGameObject : public CNamedItem {
@@ -125,6 +129,11 @@ protected:
void dec54();
/**
+ * Adds a room to the room list
+ */
+ void petAddRoom(int roomNum);
+
+ /**
* Locks/hides the mouse
*/
void lockMouse();
@@ -195,11 +204,16 @@ protected:
int compareRoomNameTo(const CString &name);
/**
- * Display a message in the PET
- */
+ * Display a message in the PET
+ */
void petDisplayMsg(const CString &msg) const;
/**
+ * Display a message
+ */
+ void displayMessage(const CString &msg) const;
+
+ /**
* Gets the first object under the system MailMan
*/
CGameObject *getMailManFirstObject() const;
@@ -309,6 +323,11 @@ protected:
CMailMan *getMailMan() const;
/**
+ * Returns the star control
+ */
+ CStarControl *getStarControl() const;
+
+ /**
* Returns a child of the Dont Save area of the project of the given class
*/
CTreeItem *getDontSaveChild(ClassDef *classDef) const;
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index fd7586b819..c0d37d14d0 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -24,19 +24,14 @@
#define TITANIC_TREE_ITEM_H
#include "titanic/core/message_target.h"
+#include "titanic/support/simple_file.h"
namespace Titanic {
class CGameManager;
-class CDontSaveFileItem;
-class CMailMan;
-class CMessage;
-class CMusicRoom;
class CNamedItem;
-class CPetControl;
class CProjectItem;
class CScreenManager;
-class CRoomItem;
class CViewItem;
class CTreeItem: public CMessageTarget {