mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-10 04:43:26 +00:00
STARK: Fix incorrect title for inventory items in the action menu
Fixes #1567.
This commit is contained in:
parent
ea90258819
commit
afb8f4e2f3
@ -36,16 +36,17 @@ class XRCReadStream;
|
||||
namespace Resources {
|
||||
|
||||
/**
|
||||
* The top level element of the game resource tree.
|
||||
* A character string resource.
|
||||
*
|
||||
* Contains all the levels.
|
||||
* String resources are used by scripts to change the title
|
||||
* of items.
|
||||
*/
|
||||
class String : public Object {
|
||||
public:
|
||||
static const Type::ResourceType TYPE = Type::kString;
|
||||
|
||||
String(Object *parent, byte subType, uint16 index, const Common::String &name);
|
||||
virtual ~String();
|
||||
~String() override;
|
||||
|
||||
protected:
|
||||
void printData() override;
|
||||
|
@ -53,10 +53,10 @@ static const int kAutoCloseDelay = 200;
|
||||
|
||||
ActionMenu::ActionMenu(Gfx::Driver *gfx, Cursor *cursor) :
|
||||
Window(gfx, cursor),
|
||||
_inventory(nullptr),
|
||||
_item(nullptr),
|
||||
_itemDescription(nullptr),
|
||||
_fromInventory(false),
|
||||
_itemDescription(nullptr),
|
||||
_item(nullptr),
|
||||
_inventory(nullptr),
|
||||
_autoCloseTimeRemaining(kAutoCloseDisabled) {
|
||||
|
||||
_background = StarkStaticProvider->getUIElement(StaticProvider::kActionMenuBg);
|
||||
@ -91,7 +91,12 @@ void ActionMenu::open(Resources::ItemVisual *item, const Common::Point &itemRela
|
||||
_itemRelativePos = itemRelativePos;
|
||||
_item = item;
|
||||
_fromInventory = item->getSubType() == Resources::Item::kItemInventory;
|
||||
_itemDescription->setText(StarkGameInterface->getItemTitleAt(item, itemRelativePos));
|
||||
|
||||
if (_fromInventory) {
|
||||
_itemDescription->setText(StarkGameInterface->getItemTitle(item));
|
||||
} else {
|
||||
_itemDescription->setText(StarkGameInterface->getItemTitleAt(item, itemRelativePos));
|
||||
}
|
||||
|
||||
_cursor->setMouseHint("");
|
||||
|
||||
|
@ -47,8 +47,8 @@ static const int kAutoCloseDelay = 200;
|
||||
InventoryWindow::InventoryWindow(Gfx::Driver *gfx, Cursor *cursor, ActionMenu *actionMenu) :
|
||||
Window(gfx, cursor),
|
||||
_actionMenu(actionMenu),
|
||||
_selectedInventoryItem(-1),
|
||||
_firstVisibleSlot(0),
|
||||
_selectedInventoryItem(-1),
|
||||
_autoCloseTimeRemaining(kAutoCloseDisabled) {
|
||||
// The window has the same size as the game window
|
||||
_position = Common::Rect(Gfx::Driver::kGameViewportWidth, Gfx::Driver::kGameViewportHeight);
|
||||
|
Loading…
x
Reference in New Issue
Block a user