aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2018-03-25 19:38:17 -0400
committerPaul Gilbert2018-03-25 19:38:46 -0400
commit04a9b3348be3bb51fd600e3aa6394e8e8f066a82 (patch)
treecfa7b76880ebe4d3361b3128ab9215cdbe9032c6 /engines
parentb4fcb24c67ee90b8f88f0ff699f75ec0cd3f02fe (diff)
downloadscummvm-rg350-04a9b3348be3bb51fd600e3aa6394e8e8f066a82.tar.gz
scummvm-rg350-04a9b3348be3bb51fd600e3aa6394e8e8f066a82.tar.bz2
scummvm-rg350-04a9b3348be3bb51fd600e3aa6394e8e8f066a82.zip
XEEN: Fix leaving the deposit/withdrawl sub-dialog in the bank
Diffstat (limited to 'engines')
-rw-r--r--engines/xeen/locations.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/engines/xeen/locations.cpp b/engines/xeen/locations.cpp
index 7934c05ddf..b81c87e2b3 100644
--- a/engines/xeen/locations.cpp
+++ b/engines/xeen/locations.cpp
@@ -342,6 +342,7 @@ void BankLocation::depositWithdrawl(PartyBank whereId) {
Party &party = *g_vm->_party;
Sound &sound = *g_vm->_sound;
Windows &windows = *g_vm->_windows;
+ Window &w = windows[35];
int gold, gems;
if (whereId == WHERE_BANK) {
@@ -363,26 +364,24 @@ void BankLocation::depositWithdrawl(PartyBank whereId) {
XeenEngine::printMil(gold).c_str(),
XeenEngine::printMil(gems).c_str());
- windows[35].open();
- windows[35].writeString(msg);
- drawButtons(&windows[35]);
- windows[35].update();
+ w.open();
+ w.writeString(msg);
+ drawButtons(&w);
+ w.update();
sound.stopSound();
File voc("coina.voc");
ConsumableType consType = CONS_GOLD;
do {
- switch (wait()) {
- case Common::KEYCODE_o:
+ wait();
+ if (_buttonValue == Common::KEYCODE_o) {
consType = CONS_GOLD;
- break;
- case Common::KEYCODE_e:
+ } else if (_buttonValue == Common::KEYCODE_e) {
consType = CONS_GEMS;
+ } else if (_buttonValue == Common::KEYCODE_ESCAPE) {
break;
- case Common::KEYCODE_ESCAPE:
- break;
- default:
+ } else {
continue;
}
@@ -392,7 +391,7 @@ void BankLocation::depositWithdrawl(PartyBank whereId) {
(whereId == WHERE_PARTY && !party._gold && consType == CONS_GOLD)) {
party.notEnough(consType, whereId, WHERE_BANK, WT_LOC_WAIT);
} else {
- windows[35].writeString(Res.AMOUNT);
+ w.writeString(Res.AMOUNT);
int amount = NumericInput::show(_vm, 35, 10, 77);
if (amount) {
@@ -426,16 +425,19 @@ void BankLocation::depositWithdrawl(PartyBank whereId) {
sound.playSound(voc);
msg = Common::String::format(Res.GOLD_GEMS_2, Res.DEPOSIT_WITHDRAWL[whereId],
XeenEngine::printMil(gold).c_str(), XeenEngine::printMil(gems).c_str());
- windows[35].writeString(msg);
- windows[35].update();
+ w.writeString(msg);
+ w.update();
}
- } while (!g_vm->shouldExit() && _buttonValue != Common::KEYCODE_ESCAPE);
+ } while (!g_vm->shouldExit());
for (uint idx = 0; idx < _buttons.size(); ++idx)
_buttons[idx]._sprites = &_icons1;
_buttons[0]._value = Common::KEYCODE_d;
_buttons[1]._value = Common::KEYCODE_w;
_buttons[2]._value = Common::KEYCODE_ESCAPE;
+
+ w.close();
+ clearEvents();
}
/*------------------------------------------------------------------------*/