mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Add inventory-to-bank deposit on right-click
When the bank is open, right-clicking a backpack or bag item now deposits it into the bank via CMSG_AUTOBANK_ITEM instead of trying to equip/use it. Bank deposit takes priority over vendor sell and auto-equip actions.
This commit is contained in:
parent
e220ce888d
commit
2ab5cf5eb6
1 changed files with 10 additions and 3 deletions
|
|
@ -1402,13 +1402,20 @@ void InventoryScreen::renderItemSlot(game::Inventory& inventory, const game::Ite
|
|||
}
|
||||
}
|
||||
|
||||
// Right-click: vendor sell (if vendor mode) or auto-equip/use
|
||||
// Right-click: bank deposit (if bank open), vendor sell (if vendor mode), or auto-equip/use
|
||||
if (ImGui::IsItemClicked(ImGuiMouseButton_Right) && !holdingItem && gameHandler_) {
|
||||
LOG_INFO("Right-click slot: kind=", (int)kind,
|
||||
" backpackIndex=", backpackIndex,
|
||||
" bagIndex=", bagIndex, " bagSlotIndex=", bagSlotIndex,
|
||||
" vendorMode=", vendorMode_);
|
||||
if (vendorMode_ && kind == SlotKind::BACKPACK && backpackIndex >= 0) {
|
||||
" vendorMode=", vendorMode_,
|
||||
" bankOpen=", gameHandler_->isBankOpen());
|
||||
if (gameHandler_->isBankOpen() && kind == SlotKind::BACKPACK && backpackIndex >= 0) {
|
||||
// Deposit backpack item into bank: bag=0xFF, slot=23+index
|
||||
gameHandler_->depositItem(0xFF, static_cast<uint8_t>(23 + backpackIndex));
|
||||
} else if (gameHandler_->isBankOpen() && kind == SlotKind::BACKPACK && isBagSlot) {
|
||||
// Deposit bag item into bank: bag=19+bagIndex, slot=slotIndex
|
||||
gameHandler_->depositItem(static_cast<uint8_t>(19 + bagIndex), static_cast<uint8_t>(bagSlotIndex));
|
||||
} else if (vendorMode_ && kind == SlotKind::BACKPACK && backpackIndex >= 0) {
|
||||
gameHandler_->sellItemBySlot(backpackIndex);
|
||||
} else if (vendorMode_ && kind == SlotKind::BACKPACK && isBagSlot) {
|
||||
gameHandler_->sellItemInBag(bagIndex, bagSlotIndex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue