Originally Posted by Baertram
Thx for the input.
I think the function RespondToDestroyRequest is not working as it is private. But I'll test it.
Edit: As I assumed it will raise an error because the function is private.
|
I just took it from their callback. Not sure what "private" means here. Perhaps it can only be called from certain places, like dialog button callback.
Anyway, here's how you can hide "Destroy" action, should you want it. Change allowDestroyItem() to something useful, this one forbids destroying stacks of 2 items for illustration:
Lua Code:
local function allowDestroyItem(inventorySlot)
local stackSize = GetSlotStackSize(ZO_Inventory_GetBagAndIndex(inventorySlot))
return stackSize ~= 2
end
local function preAddSlotAction(self, actionStringId, ...)
if actionStringId == SI_ITEM_ACTION_DESTROY then
return not allowDestroyItem(self.m_inventorySlot)
end
end
ZO_PreHook(ZO_InventorySlotActions, "AddSlotAction", preAddSlotAction)
Edit 2: deleted malfunctioning code from my first attempt, this is much simpler and at least doesn't break putting items in bank