From 6d75390e8418f1969aae8c4643021432562f0329 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Sat, 29 Jun 2019 00:41:21 +0530 Subject: HDB: Add checkInvSelect() --- engines/hdb/window.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'engines/hdb/window.cpp') 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; -- cgit v1.2.3