diff options
-rw-r--r-- | engines/xeen/character.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/dialogs_error.cpp | 14 | ||||
-rw-r--r-- | engines/xeen/dialogs_error.h | 2 | ||||
-rw-r--r-- | engines/xeen/locations.cpp | 26 | ||||
-rw-r--r-- | engines/xeen/locations.h | 27 | ||||
-rw-r--r-- | engines/xeen/party.cpp | 6 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/worldofxeen_menu.cpp | 1 |
7 files changed, 45 insertions, 33 deletions
diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp index b2cf11d0cb..fb9d7e9cd5 100644 --- a/engines/xeen/character.cpp +++ b/engines/xeen/character.cpp @@ -1048,7 +1048,7 @@ bool Character::noActions() { case DRUNK: { Common::String msg = Common::String::format(Res.IN_NO_CONDITION, _name.c_str()); ErrorScroll::show(Party::_vm, msg, - Party::_vm->_mode == 17 ? WT_2 : WT_NONFREEZED_WAIT); + Party::_vm->_mode == 17 ? WT_LOC_WAIT : WT_NONFREEZED_WAIT); return true; } default: diff --git a/engines/xeen/dialogs_error.cpp b/engines/xeen/dialogs_error.cpp index 7582f17986..954d973cd2 100644 --- a/engines/xeen/dialogs_error.cpp +++ b/engines/xeen/dialogs_error.cpp @@ -49,12 +49,14 @@ void ErrorDialog::execute(const Common::String &msg, ErrorWaitType waitType) { events.clearEvents(); break; - case WT_3: - if (w._enabled || _vm->_mode == MODE_17) { - warning("TODO: sub_26D8F"); + + case WT_ANIMATED_WAIT: + if (windows[11]._enabled || _vm->_mode == MODE_17) { + g_vm->_locations->wait(); break; } // fall through + case WT_NONFREEZED_WAIT: do { events.updateGameCounter(); @@ -65,9 +67,11 @@ void ErrorDialog::execute(const Common::String &msg, ErrorWaitType waitType) { break; } while (!_vm->shouldQuit() && !_buttonValue); break; - case WT_2: - warning("TODO: sub_26D8F"); + + case WT_LOC_WAIT: + g_vm->_locations->wait(); break; + default: break; } diff --git a/engines/xeen/dialogs_error.h b/engines/xeen/dialogs_error.h index 3657cd01be..577b7d70d4 100644 --- a/engines/xeen/dialogs_error.h +++ b/engines/xeen/dialogs_error.h @@ -29,7 +29,7 @@ namespace Xeen { enum ErrorWaitType { WT_FREEZE_WAIT = 0, WT_NONFREEZED_WAIT = 1, - WT_2 = 2, WT_3 = 3 }; + WT_LOC_WAIT = 2, WT_ANIMATED_WAIT = 3 }; class ErrorDialog : public ButtonContainer { private: diff --git a/engines/xeen/locations.cpp b/engines/xeen/locations.cpp index dbfd437ea6..7a7fedee7d 100644 --- a/engines/xeen/locations.cpp +++ b/engines/xeen/locations.cpp @@ -385,14 +385,14 @@ void BankLocation::depositWithdrawl(PartyBank whereId) { (whereId == WHERE_BANK && !party._bankGold && consType == CONS_GOLD) || (whereId == WHERE_PARTY && !party._gems && consType == CONS_GEMS) || (whereId == WHERE_PARTY && !party._gold && consType == CONS_GOLD)) { - party.notEnough(consType, whereId, WHERE_BANK, WT_2); + party.notEnough(consType, whereId, WHERE_BANK, WT_LOC_WAIT); } else { windows[35].writeString(Res.AMOUNT); int amount = NumericInput::show(_vm, 35, 10, 77); if (amount) { if (consType == CONS_GEMS) { - if (party.subtract(CONS_GEMS, amount, whereId, WT_2)) { + if (party.subtract(CONS_GEMS, amount, whereId, WT_LOC_WAIT)) { if (whereId == WHERE_BANK) { party._gems += amount; } else { @@ -400,7 +400,7 @@ void BankLocation::depositWithdrawl(PartyBank whereId) { } } } else { - if (party.subtract(CONS_GOLD, amount, whereId, WT_2)) { + if (party.subtract(CONS_GOLD, amount, whereId, WT_LOC_WAIT)) { if (whereId == WHERE_BANK) { party._gold += amount; } else { @@ -587,7 +587,7 @@ Character *TavernLocation::doOptions(Character *c) { case Common::KEYCODE_d: // Drink if (!c->noActions()) { - if (party.subtract(CONS_GOLD, 1, WHERE_PARTY, WT_2)) { + if (party.subtract(CONS_GOLD, 1, WHERE_PARTY, WT_LOC_WAIT)) { sound.stopSound(); sound.playSound("gulp.voc"); _v21 = 1; @@ -645,8 +645,8 @@ Character *TavernLocation::doOptions(Character *c) { if (YesNo::show(_vm, false, true)) { if (party._food >= _v22) { - ErrorScroll::show(_vm, Res.FOOD_PACKS_FULL, WT_2); - } else if (party.subtract(CONS_GOLD, _v23, WHERE_PARTY, WT_2)) { + ErrorScroll::show(_vm, Res.FOOD_PACKS_FULL, WT_LOC_WAIT); + } else if (party.subtract(CONS_GOLD, _v23, WHERE_PARTY, WT_LOC_WAIT)) { party._food = _v22; sound.stopSound(); sound.playSound(_isDarkCc ? "thanks2.voc" : "thankyou.voc", 1); @@ -733,7 +733,7 @@ Character *TavernLocation::doOptions(Character *c) { drawButtons(&windows[0]); windows[10].update(); wait(); - } else if (party.subtract(CONS_GOLD, 1, WHERE_PARTY, WT_2)) { + } else if (party.subtract(CONS_GOLD, 1, WHERE_PARTY, WT_LOC_WAIT)) { sound.stopSound(); sound.playSound(_isDarkCc ? "thanks2.voc" : "thankyou.voc", 1); @@ -893,7 +893,7 @@ Character *TempleLocation::doOptions(Character *c) { break; case Common::KEYCODE_d: - if (_donation && party.subtract(CONS_GOLD, _donation, WHERE_PARTY, WT_2)) { + if (_donation && party.subtract(CONS_GOLD, _donation, WHERE_PARTY, WT_LOC_WAIT)) { sound.stopSound(); sound.playSound("coina.voc", 1); _dayOfWeek = (_dayOfWeek + 1) / 10; @@ -918,7 +918,7 @@ Character *TempleLocation::doOptions(Character *c) { break; case Common::KEYCODE_h: - if (_healCost && party.subtract(CONS_GOLD, _healCost, WHERE_PARTY, WT_2)) { + if (_healCost && party.subtract(CONS_GOLD, _healCost, WHERE_PARTY, WT_LOC_WAIT)) { c->_magicResistence._temporary = 0; c->_energyResistence._temporary = 0; c->_poisonResistence._temporary = 0; @@ -945,7 +945,7 @@ Character *TempleLocation::doOptions(Character *c) { break; case Common::KEYCODE_u: - if (_uncurseCost && party.subtract(CONS_GOLD, _uncurseCost, WHERE_PARTY, WT_2)) { + if (_uncurseCost && party.subtract(CONS_GOLD, _uncurseCost, WHERE_PARTY, WT_LOC_WAIT)) { for (int idx = 0; idx < 9; ++idx) { c->_weapons[idx]._bonusFlags &= ~ITEMFLAG_CURSED; c->_armor[idx]._bonusFlags &= ~ITEMFLAG_CURSED; @@ -1078,7 +1078,7 @@ Character *TrainingLocation::doOptions(Character *c) { sound.playSound(name); } else if (!c->noActions()) { - if (party.subtract(CONS_GOLD, (c->_level._permanent * c->_level._permanent) * 10, WHERE_PARTY, WT_2)) { + if (party.subtract(CONS_GOLD, (c->_level._permanent * c->_level._permanent) * 10, WHERE_PARTY, WT_LOC_WAIT)) { _drawFrameIndex = 0; sound.stopSound(); sound.playSound(_isDarkCc ? "prtygd.voc" : "trainin2.voc", 1); @@ -2352,6 +2352,10 @@ void LocationManager::drawAnim(bool flag) { _location->drawAnim(flag); } +int LocationManager::wait() { + return _location ? _location->wait() : 0; +} + /*------------------------------------------------------------------------*/ bool LocationMessage::show(int portrait, const Common::String &name, diff --git a/engines/xeen/locations.h b/engines/xeen/locations.h index 7331760d5b..2df4b9240d 100644 --- a/engines/xeen/locations.h +++ b/engines/xeen/locations.h @@ -62,11 +62,6 @@ protected: void drawWindow(); /** - * Waits for a brief pause, checking for any key or mouse events - */ - int wait(); - - /** * Generates the display text for the location, for a given character */ virtual Common::String createLocationText(Character &ch) { return ""; } @@ -98,6 +93,11 @@ public: * Draws the animated parts */ void drawAnim(bool flag); + + /** + * Waits for a brief pause, checking for any key or mouse events + */ + int wait(); }; class BankLocation : public BaseLocation { @@ -368,19 +368,24 @@ public: LocationManager(); /** - * Show a given location, and return any result - */ + * Show a given location, and return any result + */ int doAction(LocationAction actionId); /** - * Returns true if a town location (bank, blacksmith, etc.) is currently active - */ + * Returns true if a town location (bank, blacksmith, etc.) is currently active + */ bool isActive() const; /** - * Draws a currently active town location's animation - */ + * Draws a currently active town location's animation + */ void drawAnim(bool flag); + + /** + * Calls the waiting for any currently active town location + */ + int wait(); }; } // End of namespace Xeen diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index f6bd5ca7fc..8f6e6d3d8e 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -869,11 +869,11 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int changeTime(takeVal); break; case 34: - if (!subtract(CONS_GOLD, takeVal, WHERE_PARTY, WT_3)) + if (!subtract(CONS_GOLD, takeVal, WHERE_PARTY, WT_ANIMATED_WAIT)) return true; break; case 35: - if (!subtract(CONS_GEMS, takeVal, WHERE_PARTY, WT_3)) + if (!subtract(CONS_GEMS, takeVal, WHERE_PARTY, WT_ANIMATED_WAIT)) return true; break; case 37: @@ -958,7 +958,7 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int ps._level._permanent -= takeVal; break; case 65: - if (!subtract(CONS_FOOD, takeVal, WHERE_PARTY, WT_3)) + if (!subtract(CONS_FOOD, takeVal, WHERE_PARTY, WT_ANIMATED_WAIT)) return true; break; case 69: diff --git a/engines/xeen/worldofxeen/worldofxeen_menu.cpp b/engines/xeen/worldofxeen/worldofxeen_menu.cpp index 5b08c1adec..90d362910e 100644 --- a/engines/xeen/worldofxeen/worldofxeen_menu.cpp +++ b/engines/xeen/worldofxeen/worldofxeen_menu.cpp @@ -73,7 +73,6 @@ void WorldOfXeenMenu::execute() { firstTime = false; events.setCursor(0); events.showCursor(); - warning("TODO: Read existing save file"); } showTitles1(title1Sprites); |