ULTIMA1: Done display after selling weapons

This commit is contained in:
Paul Gilbert 2018-10-04 20:42:03 -07:00 committed by Paul Gilbert
parent a1bda3d5f1
commit e2ddf798c7
5 changed files with 13 additions and 6 deletions

View File

@ -618,6 +618,7 @@ const char *const SRC_NOTHING_HERE = " - nothing here!";
const char *const SRC_NONE_HERE = " - none here!";
const char *const SRC_SOLD = "Sold!";
const char *const SRC_CANT_AFFORD = "Thou canst not afford it!";
const char *const SRC_DONE = "Done!";
const char *const SRC_DROP_PENCE_WEAPON_ARMOR = " Pence,Weapon,Armor:";
const char *const SRC_DROP_PENCE = "Drop pence: ";
const char *const SRC_DROP_WEAPON = "Drop weapon: ";
@ -766,6 +767,7 @@ GameResources::GameResources(Shared::Resources *resManager) : LocalResourceFile(
NONE_HERE = SRC_NONE_HERE;
SOLD = SRC_SOLD;
CANT_AFFORD = SRC_CANT_AFFORD;
DONE = SRC_DONE;
DROP_PENCE_WEAPON_ARMOR = SRC_DROP_PENCE_WEAPON_ARMOR;
DROP_PENCE = SRC_DROP_PENCE;
DROP_WEAPON = SRC_DROP_WEAPON;
@ -897,6 +899,7 @@ void GameResources::synchronize() {
syncString(NONE_HERE);
syncString(SOLD);
syncString(CANT_AFFORD);
syncString(DONE);
syncString(DROP_PENCE_WEAPON_ARMOR);
syncString(DROP_PENCE);
syncString(DROP_WEAPON);

View File

@ -115,6 +115,7 @@ public:
const char *NONE_HERE;
const char *SOLD;
const char *CANT_AFFORD;
const char *DONE;
const char *DROP_PENCE_WEAPON_ARMOR;
const char *DROP_PENCE;
const char *DROP_WEAPON;

View File

@ -98,11 +98,15 @@ void BuySellDialog::draw() {
switch (_mode) {
case SOLD:
s.writeString(getGame()->_res->SOLD, TextPoint(14, 5));
centerText(getGame()->_res->SOLD, 5);
break;
case CANT_AFFORD:
s.writeString(getGame()->_res->CANT_AFFORD, TextPoint(4, 6));
centerText(getGame()->_res->CANT_AFFORD, 5);
break;
case DONE:
centerText(getGame()->_res->DONE, 5);
break;
default:
@ -134,7 +138,7 @@ void BuySellDialog::setMode(BuySell mode) {
break;
}
if (_mode == SOLD || _mode == CANT_AFFORD)
if (_mode == SOLD || _mode == CANT_AFFORD || _mode == DONE)
// Start dialog close countdown
closeShortly();
}

View File

@ -30,7 +30,7 @@ namespace Ultima {
namespace Ultima1 {
namespace U1Dialogs {
enum BuySell { SELECT, BUY, SELL, SOLD, CANT_AFFORD };
enum BuySell { SELECT, BUY, SELL, SOLD, CANT_AFFORD, DONE };
using Shared::CShowMsg;
using Shared::CFrameMsg;

View File

@ -132,8 +132,7 @@ bool Weaponry::CharacterInputMsg(CCharacterInputMsg &msg) {
c.removeWeapon();
// Close the dialog
_game->endOfTurn();
hide();
setMode(DONE);
return true;
}
}