Skip to content

Commit

Permalink
PRINCE: Options menu outside of inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslw committed Jun 22, 2014
1 parent ca7554d commit e3b5c0e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion engines/prince/option_text.h
Expand Up @@ -59,7 +59,7 @@ const char optionsTextDE[7][17] = {
"Wegnehmen",
"Benutzen",
"\x84""ffnen/Sto\x7f""en",
"Schlie\x7""en/Ziehen",
"Schlie\x7f""en/Ziehen",
"Ansprechen"
};

Expand Down
27 changes: 20 additions & 7 deletions engines/prince/prince.cpp
Expand Up @@ -1355,8 +1355,11 @@ void PrinceEngine::drawScreen() {
playNextFrame();

if (!_inventoryBackgroundRemember) {
_selectedMob = hotspot(_graph->_frontScreen, _mobList);
if (!_optionsFlag) {
_selectedMob = hotspot(_graph->_frontScreen, _mobList);
}
showTexts(_graph->_frontScreen);
checkOptions();
} else {
_inventoryBackgroundRemember = false;
}
Expand Down Expand Up @@ -1597,7 +1600,13 @@ void PrinceEngine::drawInvItems() {
}
}

void PrinceEngine::inventoryLeftButton() {
void PrinceEngine::rightMouseButton() {
if (_currentPointerNumber < 2) {
enableOptions();
}
}

void PrinceEngine::inventoryLeftMouseButton() {
if (_optionsFlag == 1) {
//check_opt
if (_selectedMob != 0) {
Expand Down Expand Up @@ -1695,7 +1704,7 @@ void PrinceEngine::inventoryLeftButton() {
_optionsMob = 0;
}

void PrinceEngine::inventoryRightButton() {
void PrinceEngine::inventoryRightMouseButton() {
enableOptions();
}

Expand Down Expand Up @@ -1776,7 +1785,7 @@ void PrinceEngine::checkOptions() {
};
uint16 textW = getTextWidth(optText.c_str());
uint16 textX = _optionsX + _optionsWidth / 2 - textW / 2;
_font->drawString(_graph->_screenForInventory, optText, textX, textY, textW, optionsColor);
_font->drawString(_graph->_frontScreen, optText, textX, textY, textW, optionsColor);
textY += _optionsStep;
}
}
Expand Down Expand Up @@ -1879,7 +1888,7 @@ void PrinceEngine::displayInventory() {
break;
}

if (!_optionsFlag) { // test this
if (!_optionsFlag) {
_selectedMob = hotspot(_graph->_screenForInventory, _invMobList);
}

Expand All @@ -1897,12 +1906,13 @@ void PrinceEngine::displayInventory() {
case Common::EVENT_MOUSEMOVE:
break;
case Common::EVENT_LBUTTONDOWN:
inventoryLeftButton();
inventoryLeftMouseButton();
break;
case Common::EVENT_RBUTTONDOWN:
inventoryRightButton();
inventoryRightMouseButton();
break;
case Common::EVENT_LBUTTONUP:
break;
case Common::EVENT_RBUTTONUP:
break;
case Common::EVENT_QUIT:
Expand Down Expand Up @@ -1944,9 +1954,12 @@ void PrinceEngine::mainLoop() {
case Common::EVENT_MOUSEMOVE:
break;
case Common::EVENT_LBUTTONDOWN:
break;
case Common::EVENT_RBUTTONDOWN:
rightMouseButton();
break;
case Common::EVENT_LBUTTONUP:
break;
case Common::EVENT_RBUTTONUP:
break;
case Common::EVENT_QUIT:
Expand Down
6 changes: 4 additions & 2 deletions engines/prince/prince.h
Expand Up @@ -336,8 +336,10 @@ class PrinceEngine : public Engine {
void enableOptions();
void checkOptions();
void checkInvOptions();
void inventoryLeftButton();
void inventoryRightButton();

void rightMouseButton();
void inventoryLeftMouseButton();
void inventoryRightMouseButton();

int testAnimNr;
int testAnimFrame;
Expand Down

0 comments on commit e3b5c0e

Please sign in to comment.