aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-02 08:32:25 -0400
committerPaul Gilbert2016-07-10 16:38:07 -0400
commit947d9e344c2e51c7ad8e4fe1f78fb131cafc921a (patch)
tree076894b5e5091b9557fddad3dcbffbe81118657e
parentefaa86bee4f0183365309056d43b3aa3801f3ddf (diff)
downloadscummvm-rg350-947d9e344c2e51c7ad8e4fe1f78fb131cafc921a.tar.gz
scummvm-rg350-947d9e344c2e51c7ad8e4fe1f78fb131cafc921a.tar.bz2
scummvm-rg350-947d9e344c2e51c7ad8e4fe1f78fb131cafc921a.zip
TITANIC: Implement toggle remote glyph base class
-rw-r--r--engines/titanic/pet_control/pet_remote_glyphs.cpp26
-rw-r--r--engines/titanic/pet_control/pet_remote_glyphs.h37
2 files changed, 63 insertions, 0 deletions
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index 9db3b66c3d..85c4fb8889 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -83,6 +83,20 @@ void CBasicRemoteGlyph::getTooltip(CPetText *text) {
/*------------------------------------------------------------------------*/
+bool CToggleRemoteGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+ CPetGlyph::setup(petControl, owner);
+ if (owner)
+ _gfxElement = getElement(0);
+ return true;
+}
+
+void CToggleRemoteGlyph::draw2(CScreenManager *screenManager) {
+ _gfxElement->setMode(_flag ? MODE_SELECTED : MODE_UNSELECTED);
+ _gfxElement->draw(screenManager);
+}
+
+/*------------------------------------------------------------------------*/
+
bool CTelevisionControlGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
CPetRemoteGlyph::setup(petControl, owner);
setDefaults("3PetTV", petControl);
@@ -137,4 +151,16 @@ void CTelevisionControlGlyph::getTooltip(CPetText *text) {
text->setText("Television control");
}
+/*------------------------------------------------------------------------*/
+
+bool CEntertainmentDeviceGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+ CPetRemoteGlyph::setup(petControl, owner);
+ if (owner) {
+ _gfxElement2 = getElement(1);
+ _gfxElement3 = getElement(2);
+ }
+
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index 1a4ee28f12..8a9cb88e99 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -108,6 +108,29 @@ public:
virtual void getTooltip(CPetText *text);
};
+class CToggleRemoteGlyph : public CPetRemoteGlyph {
+protected:
+ CPetGfxElement *_gfxElement;
+ bool _flag;
+public:
+ CToggleRemoteGlyph() : CPetRemoteGlyph(), _gfxElement(nullptr), _flag(false) {}
+
+ /**
+ * Setup the glyph
+ */
+ virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+ /**
+ * Handles any secondary drawing of the glyph
+ */
+ virtual void draw2(CScreenManager *screenManager);
+
+ /**
+ * Called for mouse button down messages
+ */
+ virtual bool MouseButtonDownMsg(const Point &pt);
+};
+
class CSummonElevatorGlyph : public CBasicRemoteGlyph {
public:
CSummonElevatorGlyph() : CBasicRemoteGlyph(
@@ -154,6 +177,20 @@ public:
virtual void getTooltip(CPetText *text);
};
+class CEntertainmentDeviceGlyph : public CToggleRemoteGlyph {
+public:
+ int _field3C;
+ CPetGfxElement *_gfxElement2, *_gfxElement3;
+public:
+ CEntertainmentDeviceGlyph() : CToggleRemoteGlyph(),
+ _field3C(0), _gfxElement2(nullptr), _gfxElement3(nullptr) {}
+
+ /**
+ * Setup the glyph
+ */
+ virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+};
} // End of namespace Titanic