diff options
author | lukaslw | 2014-07-29 04:10:54 +0200 |
---|---|---|
committer | lukaslw | 2014-07-29 04:10:54 +0200 |
commit | 956b98903fe704f0388538741c539567476bd745 (patch) | |
tree | b78d46407e6265a9a6883d6b48ec83c802eb1bd6 /engines | |
parent | 4a022e77f75c69702708dc49de44f9e844569d05 (diff) | |
download | scummvm-rg350-956b98903fe704f0388538741c539567476bd745.tar.gz scummvm-rg350-956b98903fe704f0388538741c539567476bd745.tar.bz2 scummvm-rg350-956b98903fe704f0388538741c539567476bd745.zip |
PRINCE: enableOptions() - update for inventory items
Diffstat (limited to 'engines')
-rw-r--r-- | engines/prince/prince.cpp | 51 | ||||
-rw-r--r-- | engines/prince/prince.h | 2 |
2 files changed, 28 insertions, 25 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index fe2f398b85..3f0527fc02 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -2382,7 +2382,7 @@ void PrinceEngine::rightMouseButton() { _secondHero->freeOldMove(); _interpreter->storeNewPC(0); if (_currentPointerNumber < 2) { - enableOptions(); + enableOptions(true); } else { _currentPointerNumber = 1; changeCursor(1); @@ -2536,38 +2536,41 @@ void PrinceEngine::inventoryLeftMouseButton() { void PrinceEngine::inventoryRightMouseButton() { if (_textSlots[0]._str == nullptr) { - enableOptions(); + enableOptions(false); } } -void PrinceEngine::enableOptions() { +void PrinceEngine::enableOptions(bool checkType) { if (_optionsFlag != 1) { changeCursor(1); _currentPointerNumber = 1; if (_selectedMob != -1) { - if (_mobList[_selectedMob]._type != 0x100) { - Common::Point mousePos = _system->getEventManager()->getMousePos(); - int x1 = mousePos.x - _optionsWidth / 2; - int x2 = mousePos.x + _optionsWidth / 2; - if (x1 < 0) { - x1 = 0; - x2 = _optionsWidth; - } else if (x2 >= kNormalWidth) { - x1 = kNormalWidth - _optionsWidth; - x2 = kNormalWidth; - } - int y1 = mousePos.y - 10; - if (y1 < 0) { - y1 = 0; - } - if (y1 + _optionsHeight >= kNormalHeight) { - y1 = kNormalHeight - _optionsHeight; + if (checkType) { + if (_mobList[_selectedMob]._type == 0x100) { + return; } - _optionsMob = _selectedMob; - _optionsX = x1; - _optionsY = y1; - _optionsFlag = 1; } + Common::Point mousePos = _system->getEventManager()->getMousePos(); + int x1 = mousePos.x - _optionsWidth / 2; + int x2 = mousePos.x + _optionsWidth / 2; + if (x1 < 0) { + x1 = 0; + x2 = _optionsWidth; + } else if (x2 >= kNormalWidth) { + x1 = kNormalWidth - _optionsWidth; + x2 = kNormalWidth; + } + int y1 = mousePos.y - 10; + if (y1 < 0) { + y1 = 0; + } + if (y1 + _optionsHeight >= kNormalHeight) { + y1 = kNormalHeight - _optionsHeight; + } + _optionsMob = _selectedMob; + _optionsX = x1; + _optionsY = y1; + _optionsFlag = 1; } } } diff --git a/engines/prince/prince.h b/engines/prince/prince.h index 64f981cdb6..eef583222f 100644 --- a/engines/prince/prince.h +++ b/engines/prince/prince.h @@ -422,7 +422,7 @@ public: void swapInv(int heroId); void addInvObj(); void makeInvCursor(int itemNr); - void enableOptions(); + void enableOptions(bool checkType); void checkOptions(); void checkInvOptions(); |