mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
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:
parent
40c016ccdb
commit
affb5f4f04
4 changed files with 62 additions and 1 deletions
|
|
@ -4147,6 +4147,17 @@ void GameHandler::useItemBySlot(int backpackIndex) {
|
|||
}
|
||||
}
|
||||
|
||||
void GameHandler::useItemById(uint32_t itemId) {
|
||||
if (itemId == 0) return;
|
||||
for (int i = 0; i < inventory.getBackpackSize(); i++) {
|
||||
const auto& slot = inventory.getBackpackSlot(i);
|
||||
if (!slot.empty() && slot.item.itemId == itemId) {
|
||||
useItemBySlot(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameHandler::handleLootResponse(network::Packet& packet) {
|
||||
if (!LootResponseParser::parse(packet, currentLoot)) return;
|
||||
lootWindowOpen = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue