From 8f40dae91de1cc7243f882c05d03686b713687af Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 20 Apr 2014 22:56:38 +0300 Subject: FULLPIPE: Implement ModalQuery::handleMessage() --- engines/fullpipe/modal.cpp | 21 +++++++++++++++++++++ engines/fullpipe/modal.h | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 1569ee981c..2a861be2bc 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -1390,6 +1390,27 @@ void ModalQuery::update() { _cancelBtn->draw(); } +bool ModalQuery::handleMessage(ExCommand *cmd) { + if (cmd->_messageKind == 17) { + if (cmd->_messageNum == 29) { + if (_okBtn->isPointInside(g_fp->_mouseScreenPos.x, g_fp->_mouseScreenPos.y)) { + _queryResult = 1; + + return false; + } + + if (_cancelBtn->isPointInside(g_fp->_mouseScreenPos.x, g_fp->_mouseScreenPos.y)) + _queryResult = 0; + } else if (cmd->_messageNum == 36 && cmd->_keyCode == 27) { + _queryResult = 0; + + return false; + } + } + + return false; +} + void ModalSaveGame::setScene(Scene *sc) { warning("STUB: ModalSaveGame::setScene()"); } diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index 4b16c305aa..1babab989f 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -219,7 +219,7 @@ public: virtual ~ModalQuery(); 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() {} -- cgit v1.2.3