aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNipun Garg2019-06-29 00:41:21 +0530
committerEugene Sandulenko2019-09-03 17:17:04 +0200
commit6d75390e8418f1969aae8c4643021432562f0329 (patch)
tree99e2e812f303420c52bd566f3a7191d9706dec33 /engines
parent4a8ce49968e3a316bcdacfab0925622292fb7e24 (diff)
downloadscummvm-rg350-6d75390e8418f1969aae8c4643021432562f0329.tar.gz
scummvm-rg350-6d75390e8418f1969aae8c4643021432562f0329.tar.bz2
scummvm-rg350-6d75390e8418f1969aae8c4643021432562f0329.zip
HDB: Add checkInvSelect()
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/window.cpp16
-rw-r--r--engines/hdb/window.h1
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);