Sounds good. If you ever get to change the menu system, maybe you could also make it a bit easier for addons to change the behavior of an existing entry.
In the current system this is the simplest way I could come up with to change the primary action of the craft bag item actions for AGS' direct selling feature
Lua Code:
local oAddSlotAction = ZO_InventorySlotActions.AddSlotAction
local currentInventorySlot
ZO_PreHook("ZO_InventorySlot_DiscoverSlotActionsFromActionList", function(inventorySlot, slotActions) currentInventorySlot = inventorySlot end)
-- prepare AddSlotAction in order to redirect the action
ZO_InventorySlotActions.AddSlotAction = function(slotActions, actionStringId, actionCallback, actionType, visibilityFunction, options)
if(actionStringId == SI_ITEM_ACTION_REMOVE_ITEMS_FROM_CRAFT_BAG and TRADING_HOUSE:IsAtTradingHouse()) then
if(self:IsItemAlreadyBeingPosted(currentInventorySlot)) then
actionStringId = SI_TRADING_HOUSE_REMOVE_PENDING_POST
actionCallback = function()
self:ClearPendingItem()
ZO_InventorySlot_OnMouseEnter(currentInventorySlot)
end
else
actionStringId = SI_TRADING_HOUSE_ADD_ITEM_TO_LISTING
actionCallback = function() TryInitiatingItemPost(currentInventorySlot) end
end
actionType = "primary"
end
oAddSlotAction(slotActions, actionStringId, actionCallback, actionType, visibilityFunction, options)
end