Send things to reagent bank in PreClick
mbattersby opened this issue ยท 1 comments
ArkInventory does something clever, they send things to the reagent bank using a PreClick handler and so they don't have to do all that annoying messing around with the Blizzard bank frame and it's selectedTab so that the OnClick handler works.
It's basically this, which I am stunned works:
function LiteBagItemButton:PreClick(inputButton)
if InCombatLockdown() or not self:HasItem() then
return
end
if LiteBagReagentBankPanel:IsShown() then
UseContainerItem(self:GetBagID(), self:GetID(), nil, true)
end
end
Edit: I think this has a downside that if the item does not go into the reagent bank, the OnClick handler will put it into the regular bank which isn't currently visible.