From a6d03a15c9b305afab75d5b89b9c818249031ec7 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 14 Apr 2016 07:51:23 -0400 Subject: TITANIC: More CMagazine message handlers --- engines/titanic/carry/magazine.cpp | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'engines/titanic/carry') diff --git a/engines/titanic/carry/magazine.cpp b/engines/titanic/carry/magazine.cpp index 20e0b16f5e..ac74da8c71 100644 --- a/engines/titanic/carry/magazine.cpp +++ b/engines/titanic/carry/magazine.cpp @@ -21,6 +21,7 @@ */ #include "titanic/carry/magazine.h" +#include "titanic/npcs/deskbot.h" namespace Titanic { @@ -51,22 +52,41 @@ void CMagazine::load(SimpleFile *file) { } bool CMagazine::UseWithCharMsg(CUseWithCharMsg *msg) { - // todo - return true; + CDeskbot *deskbot = static_cast(msg->_character); + if (deskbot) { + if (deskbot->_field108) { + setVisible(false); + setPosition(Point(1000, 1000)); + CActMsg actMsg("2ndClassUpgrade"); + actMsg.execute("Deskbot"); + } + + return true; + } else { + return CCarry::UseWithCharMsg(msg); + } } bool CMagazine::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) { - // todo return true; } bool CMagazine::VisibleMsg(CVisibleMsg *msg) { - // todo + setVisible(msg->_visible); return true; } bool CMagazine::UseWithOtherMsg(CUseWithOtherMsg *msg) { - // todo + if (msg->_other->getName() == "SwitchOnDeskbot") { + // TODO: other _field108 if + if (false) { + setVisible(false); + setPosition(Point(1000, 1000)); + CActMsg actMsg("2ndClassUpgrade"); + actMsg.execute("Deskbot"); + } + } + return true; } -- cgit v1.2.3