Add item support for action bar with drag-from-inventory and key/click use

Allow picking up consumables from inventory and dropping them onto action bar
slots. Items display their icon or name, can be used via click or hotkey
(1-0,-,=), and cleared with right-click. Adds useItemById to find and use
items from backpack by item ID.
This commit is contained in:
Kelsi 2026-02-06 19:17:35 -08:00
parent 40c016ccdb
commit affb5f4f04
4 changed files with 62 additions and 1 deletions

View file

@ -368,6 +368,7 @@ public:
void sellItemBySlot(int backpackIndex);
void autoEquipItemBySlot(int backpackIndex);
void useItemBySlot(int backpackIndex);
void useItemById(uint32_t itemId);
bool isVendorWindowOpen() const { return vendorWindowOpen; }
const ListInventoryData& getVendorItems() const { return currentVendorItems; }
const ItemQueryResponseData* getItemInfo(uint32_t itemId) const {

View file

@ -134,6 +134,13 @@ private:
public:
static ImVec4 getQualityColor(game::ItemQuality quality);
/// Returns true if the user is currently holding an item (pickup cursor).
bool isHoldingItem() const { return holdingItem; }
/// Returns the item being held (only valid when isHoldingItem() is true).
const game::ItemDef& getHeldItem() const { return heldItem; }
/// Cancel the pickup, returning the item to its original slot.
void returnHeldItem(game::Inventory& inv) { cancelPickup(inv); }
};
} // namespace ui