diff options
-rw-r--r-- | engines/hdb/window.cpp | 25 | ||||
-rw-r--r-- | engines/hdb/window.h | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/engines/hdb/window.cpp b/engines/hdb/window.cpp index b0b66b6627..606cf78b71 100644 --- a/engines/hdb/window.cpp +++ b/engines/hdb/window.cpp @@ -134,6 +134,31 @@ void Window::closeDialog() { } } +bool Window::checkDialogClose(int x, int y) { + if (!_dialogInfo.active) + return false; + + if (x >= _dialogInfo.x && x < _dialogInfo.x + _dialogInfo.width && y >= _dialogInfo.y && y < _dialogInfo.y + _dialogInfo.height) { + closeDialog(); + return true; + } + + // If Cinematics are on, we need to timeout instead of get a click + if (g_hdb->_ai->cinematicsActive()) { + if (_dialogDelay < g_hdb->getTimeSlice()) { + closeDialog(); + _dialogDelay = 0; + return true; + } + } + + return false; +} + +void Window::drawBorder() { + +} + void Window::setDialogDelay(int delay) { _dialogDelay = g_system->getMillis() + 1000 * delay; } diff --git a/engines/hdb/window.h b/engines/hdb/window.h index 60a2e667a5..fa478e7352 100644 --- a/engines/hdb/window.h +++ b/engines/hdb/window.h @@ -57,6 +57,7 @@ public: void openDialog(const char *title, int tileIndex, const char *string, int more, const char *luaMore); void closeDialog(); + bool checkDialogClose(int x, int y); void setDialogDelay(int delay); uint32 getDialogDelay() { return _dialogDelay; |