Fixed access of inventory in HoF while cursor is not visible.

svn-id: r31081
This commit is contained in:
Johannes Schickel 2008-03-09 09:58:05 +00:00
parent 353e5a7896
commit 3a83cf654e
3 changed files with 8 additions and 1 deletions

@ -572,7 +572,9 @@ int KyraEngine_v2::processButtonList(Button *buttonList, uint16 inputFlag) {
}
int KyraEngine_v2::buttonInventory(Button *button) {
//XXX test if cursor is shown
if (!_screen->isMouseShown())
return 0;
int inventorySlot = button->index - 6;
uint16 item = _mainCharacter.inventory[inventorySlot];

@ -2300,6 +2300,10 @@ void Screen::showMouse() {
_mouseLockCount--;
}
bool Screen::isMouseShown() const {
return (_mouseLockCount == 0);
}
void Screen::setShapePages(int page1, int page2) {
debugC(9, kDebugLevelScreen, "Screen::setShapePages(%d, %d)", page1, page2);
_shapePages[0] = _pagePtrs[page1];

@ -182,6 +182,7 @@ public:
void hideMouse();
void showMouse();
void setMouseCursor(int x, int y, byte *shape);
bool isMouseShown() const;
// rect handling
virtual int getRectSize(int w, int h);