diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/window.cpp | 16 | ||||
-rw-r--r-- | engines/hdb/window.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/hdb/window.cpp b/engines/hdb/window.cpp index 041bceb1f6..ba7575c688 100644 --- a/engines/hdb/window.cpp +++ b/engines/hdb/window.cpp @@ -384,6 +384,22 @@ void Window::drawInventory() { } } +void Window::checkInvSelect(int x, int y) { + if (x >= _invWinInfo.x && x < _invWinInfo.x + _invWinInfo.width && y >= _invWinInfo.y && y < _invWinInfo.y + _invWinInfo.height) { + int xc = (x - _invWinInfo.x) / kInvItemSpaceX; + int yc = (y - _invWinInfo.y) / kInvItemSpaceY; + if (yc * kInvItemPerLine + xc > g_hdb->_ai->getInvAmount()) + return; + + _invWinInfo.selection = yc * kInvItemPerLine + xc; + + // If this is a weapon, choose it + warning("STUB: checkInvSelect: ChooseWeapon() required"); + + warning("STUB: checkInvSelect: Play SND_POP"); + } +} + void Window::textOut(const char *text, int x, int y, int timer) { TOut *t = new TOut; diff --git a/engines/hdb/window.h b/engines/hdb/window.h index b2d2a3eb4b..27e37420d2 100644 --- a/engines/hdb/window.h +++ b/engines/hdb/window.h @@ -100,6 +100,7 @@ public: int getInvSelect() { return _invWinInfo.selection; } + void checkInvSelect(int x, int y); // TextOut functions void textOut(const char *text, int x, int y, int timer); |