diff options
author | Paul Gilbert | 2016-08-28 11:29:23 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-28 11:29:23 -0400 |
commit | 56c2ef9efc966286eefa451eba6f5acb1f58886f (patch) | |
tree | 6f856e9e387c9e61c53ad3df71fd2e808cc6306e /engines/titanic/gfx/slider_button.cpp | |
parent | 1dcfe25808164c5f2540662028862ac8a0e56831 (diff) | |
download | scummvm-rg350-56c2ef9efc966286eefa451eba6f5acb1f58886f.tar.gz scummvm-rg350-56c2ef9efc966286eefa451eba6f5acb1f58886f.tar.bz2 scummvm-rg350-56c2ef9efc966286eefa451eba6f5acb1f58886f.zip |
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/gfx/slider_button.cpp')
-rw-r--r-- | engines/titanic/gfx/slider_button.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/engines/titanic/gfx/slider_button.cpp b/engines/titanic/gfx/slider_button.cpp index 0633158e97..b3dbbed08f 100644 --- a/engines/titanic/gfx/slider_button.cpp +++ b/engines/titanic/gfx/slider_button.cpp @@ -24,6 +24,14 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CSliderButton, CSTButton) + ON_MESSAGE(MouseButtonUpMsg) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(MouseDragMoveMsg) + ON_MESSAGE(StatusChangeMsg) + ON_MESSAGE(EnterViewMsg) +END_MESSAGE_MAP() + CSliderButton::CSliderButton() : CSTButton(), _field114(0), _field118(0), _field11C(0) { } @@ -48,4 +56,39 @@ void CSliderButton::load(SimpleFile *file) { CSTButton::load(file); } +bool CSliderButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) { + _pos1 = msg->_mousePos; + CStatusChangeMsg changeMsg; + changeMsg.execute(this); + return true; +} + +bool CSliderButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + _pos1 = msg->_mousePos; + return true; +} + +bool CSliderButton::MouseDragMoveMsg(CMouseDragMoveMsg *msg) { + _pos1 = msg->_mousePos; + if (_field118) { + CStatusChangeMsg changeMsg; + changeMsg.execute(this); + } + + return true; +} + +bool CSliderButton::StatusChangeMsg(CStatusChangeMsg *msg) { + CStatusChangeMsg changeMsg; + changeMsg._oldStatus = _currentStatus; + _currentStatus = (_pos1.y - _bounds.top) / _field11C; + changeMsg._newStatus = _currentStatus; + changeMsg.execute(_actionTarget); + return true; +} + +bool CSliderButton::EnterViewMsg(CEnterViewMsg *msg) { + return true; +} + } // End of namespace Titanic |