diff options
author | Eugene Sandulenko | 2014-04-10 06:49:15 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-04-10 06:49:15 +0300 |
commit | b4d06ccfe0dde0d9399616a7c67d7bfea196e43f (patch) | |
tree | 6a42fa1d003267611cd785849e3ae466fe20e564 /engines | |
parent | d991a139f056c52dd15ac2a931bfcca317273f94 (diff) | |
download | scummvm-rg350-b4d06ccfe0dde0d9399616a7c67d7bfea196e43f.tar.gz scummvm-rg350-b4d06ccfe0dde0d9399616a7c67d7bfea196e43f.tar.bz2 scummvm-rg350-b4d06ccfe0dde0d9399616a7c67d7bfea196e43f.zip |
FULLPIPE: Implement ModalMainMenu::handleMessage()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/modal.cpp | 61 | ||||
-rw-r--r-- | engines/fullpipe/modal.h | 8 |
2 files changed, 63 insertions, 6 deletions
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 999bcc4544..46830fce35 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -753,7 +753,7 @@ ModalMainMenu::ModalMainMenu() { _areas.clear(); _lastArea = 0; - _mfield_C = 0; + _hoverAreaId = 0; _mfield_34 = 0; _scene = g_fp->accessScene(SC_MAINMENU); _debugKeyCount = 0; @@ -850,13 +850,70 @@ void ModalMainMenu::update() { _scene->draw(); } +bool ModalMainMenu::handleMessage(ExCommand *message) { + if (message->_messageKind != 17) + return false; + + Common::Point point; + + if (message->_messageNum == 29) { + point.x = message->_x; + point.y = message->_y; + + int numarea = checkHover(point); + + if (numarea >= 0) { + if (numarea == _menuSliderIdx) { + _lastArea = _areas[_menuSliderIdx]; + _sliderOffset = _lastArea->picObjL->_ox - point.x; + + return false; + } + + if (numarea == _musicSliderIdx) { + _lastArea = _areas[_musicSliderIdx]; + _sliderOffset = _lastArea->picObjL->_ox - point.x; + + return false; + } + + _hoverAreaId = _areas[numarea]->picIdL; + } + + return false; + } + + if (message->_messageNum == 30) { + if (_lastArea) + _lastArea = 0; + + return false; + } + + if (message->_messageNum != 36) + return false; + + if (message->_keyCode == 27) + _hoverAreaId = PIC_MNU_CONTINUE_L; + else + enableDebugMenu(message->_keyCode); + + return false; +} + +int ModalMainMenu::checkHover(Common::Point &point) { + warning("STUB: ModalMainMenu::checkHover()"); + + return 0; +} + bool ModalMainMenu::isSaveAllowed() { warning("STUB: ModalMainMenu::isSaveAllowed()"); return true; } -void ModalMainMenu::enableDebugMenu(int objId, char c) { +void ModalMainMenu::enableDebugMenu(char c) { const char deb[] = "DEBUGER"; if (c == deb[_debugKeyCount]) { diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index 1530b6130a..b932b695b1 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -156,7 +156,7 @@ struct MenuArea { class ModalMainMenu : public BaseModalObject { public: Scene *_scene; - int _mfield_C; + int _hoverAreaId; Common::Array<MenuArea *> _areas; int _menuSliderIdx; int _musicSliderIdx; @@ -173,7 +173,7 @@ public: virtual ~ModalMainMenu() {} virtual bool pollEvent() { return true; } - virtual bool handleMessage(ExCommand *message) { return false; } + virtual bool handleMessage(ExCommand *message); virtual bool init(int counterdiff) { return true; } virtual void update(); virtual void saveload() {} @@ -182,8 +182,8 @@ private: bool isSaveAllowed(); void enableDebugMenuButton(); void setSliderPos(); - void enableDebugMenu(int objId, char c); - + void enableDebugMenu(char c); + int checkHover(Common::Point &point); }; class ModalHelp : public BaseModalObject { |