mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-10 12:55:24 +00:00
ULTIMA8: Fix Crusader ammo count in pickup notifications
This commit is contained in:
parent
2cf11a6b76
commit
01500eb23f
@ -67,7 +67,7 @@ void CruPickupAreaGump::addPickup(const Item *item, bool showCount) {
|
||||
continue;
|
||||
if (pug->getShapeNo() == shapeno) {
|
||||
// Already a notification for this object, update it
|
||||
pug->updateForNewItem(item, showCount);
|
||||
pug->updateForNewItem(item);
|
||||
return;
|
||||
}
|
||||
int32 x, y;
|
||||
|
@ -52,7 +52,10 @@ CruPickupGump::CruPickupGump(const Item *item, int y, bool showCount) : Gump(0,
|
||||
const WeaponInfo *weaponInfo = item->getShapeInfo()->_weaponInfo;
|
||||
if (weaponInfo) {
|
||||
_itemShapeNo = item->getShape();
|
||||
_q = item->getQuality();
|
||||
if (item->getShapeInfo()->_family == ShapeInfo::SF_CRUAMMO)
|
||||
_q = 1;
|
||||
else
|
||||
_q = item->getQuality();
|
||||
_itemName = weaponInfo->_name;
|
||||
_gumpShapeNo = weaponInfo->_displayGumpShape;
|
||||
_gumpFrameNo = weaponInfo->_displayGumpFrame;
|
||||
@ -123,7 +126,7 @@ void CruPickupGump::InitGump(Gump *newparent, bool take_focus) {
|
||||
itemgump->Move(ITEM_AREA_WIDTH / 2 - itemframe->_width / 2, _dims.height() / 2 - itemframe->_height / 2);
|
||||
}
|
||||
|
||||
void CruPickupGump::updateForNewItem(const Item *item, bool showCount) {
|
||||
void CruPickupGump::updateForNewItem(const Item *item) {
|
||||
assert(item);
|
||||
assert(item->getShape() == _itemShapeNo);
|
||||
TextWidget *oldtext = dynamic_cast<TextWidget *>(FindGump(&FindByIndex<COUNT_TEXT_INDEX>));
|
||||
@ -132,7 +135,8 @@ void CruPickupGump::updateForNewItem(const Item *item, bool showCount) {
|
||||
oldtext->Close();
|
||||
}
|
||||
|
||||
_showCount = showCount;
|
||||
// Always show count for repeat objects.
|
||||
_showCount = true;
|
||||
|
||||
// If we're updating the existing count, add 1 or special-case credits
|
||||
if (_itemShapeNo == 0x4ed)
|
||||
|
@ -57,8 +57,8 @@ public:
|
||||
return _q;
|
||||
}
|
||||
|
||||
//! Update for a second item pickup - generally just replace existing count text.
|
||||
void updateForNewItem(const Item *item, bool showCount);
|
||||
//! Update for a second item pickup - updates existing count text.
|
||||
void updateForNewItem(const Item *item);
|
||||
void addCountText();
|
||||
|
||||
bool loadData(Common::ReadStream *rs, uint32 version);
|
||||
|
@ -194,7 +194,7 @@ int16 MainActor::addItemCru(Item *item, bool showtoast) {
|
||||
item->callUsecodeEvent_combine();
|
||||
item->moveToContainer(this);
|
||||
if (showtoast)
|
||||
pickupArea->addPickup(item, true);
|
||||
pickupArea->addPickup(item, false);
|
||||
return 1;
|
||||
} else {
|
||||
// already have this, add some ammo.
|
||||
@ -203,7 +203,7 @@ int16 MainActor::addItemCru(Item *item, bool showtoast) {
|
||||
ammo->setQuality(q + 1);
|
||||
ammo->callUsecodeEvent_combine();
|
||||
if (showtoast)
|
||||
pickupArea->addPickup(item, true);
|
||||
pickupArea->addPickup(item, false);
|
||||
item->destroy();
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user