Just an update:
I got my wanted behaviour now by removing the item's context menu entries.
If you remove the context menu entry the ralting keybind will be automatically removed too.
I did this by pre-hooking the contexnt menu actions ZO_InventorySlotActions, function "AddSlotAction":
Lua Code:
--======== RIGHT CLICK / CONTEXT MENU ==========================================
--Pre Hook the right click/context menu addition of items
ZO_PreHook(ZO_InventorySlotActions, "AddSlotAction", preAddSlotAction)
The function called:
Lua Code:
--Pre Hook function for adding right click/context menu entries.
--Attention: Will be executed on mouse enter on a slot in inventories
--AND if you open the context menu by a mouse righ-click
--To distinguish these two "events" you can use: if self.m_contextMenuMode == true then
--true: Context-menu is open, false: Only mouse hoevered over the item
local function preAddSlotAction(self, actionStringId, ...)
--------------------------------------------------------------------------------
--Get the parent control and bag + slotIndex
local parentControl
--Chracter equipment, or normal slot?
if (not ZO_Character:IsHidden()) then
parentControl = self.m_inventorySlot
else
parentControl = self.m_inventorySlot:GetParent()
end
--No parent found? Abort
if parentControl == nil then return false end
local bag
local slotIndex
--gotta do this in case deconstruction, or player equipment
local dataEntry = parentControl.dataEntry
--case to handle equiped items
if(not dataEntry) then
bagId = parentControl.bagId
slotIndex = parentControl.slotIndex
else
bagId = dataEntry.data.bagId
slotIndex = dataEntry.data.slotIndex
end
--case to handle list dialog, list dialog uses index instead of slotIndex and bag instead of bagId...?
if(dataEntry and not bagId and not slotIndex) then
bagId = parentControl.dataEntry.data.bag
slotIndex = parentControl.dataEntry.data.index
end
--------------------------------------------------------------------------------
--CHECKING THE CONTEXT MENU ENTRIES HERE:
--If you want to hide this context-menu entry you need to return TRUE, otherwise FALSE
--Destroy item?
if actionStringId == SI_ITEM_ACTION_DESTROY then
--Only execute if context menu is visible?
if self.m_contextMenuMode == false then
return
end
--This here will hide the "Destroy" contetx-menu entry and the keybinding in the keybind stip as well!
return true
--Add item to crafting station, improvement, enchanting table
elseif actionStringId == SI_ITEM_ACTION_ADD_TO_CRAFT or actionStringId == SI_ITEM_ACTION_RESEARCH then
--This here will hide the "Add to craft" and "Research" context-menu entries and the keybindings as well!
return true
--Trade an item, mark item as junk, attach item to mail, sell item
elseif actionStringId == SI_ITEM_ACTION_TRADE_ADD or actionStringId == SI_ITEM_ACTION_MARK_AS_JUNK
or actionStringId == SI_ITEM_ACTION_MAIL_ATTACH or actionStringId == SI_ITEM_ACTION_SELL
--sell in guild shop
or actionStringId == SI_TRADING_HOUSE_ADD_ITEM_TO_LISTING then
--Is item marked with any of the FCOItemSaver icons? Then don't show the actionStringId in the contextmenu
--This here will hide the "Add to trade", "Add to mail", "Mark as Junk", "Sell" and "Add to sell list" context-menu entries and the keybindings as well!
return true
--Equip an item
elseif actionStringId == SI_ITEM_ACTION_EQUIP then
--This here will hide the "Equip" context-menu entries and the keybindings as well!
return true
--Unequip an item
elseif actionStringId == SI_ITEM_ACTION_UNEQUIP then
--Only execute if context menu is visible?
if self.m_contextMenuMode == false then
return
end
--Only for character items
if( bag ~= nil and slotIndex ~= nil and bag == BAG_WORN) then
--Update the character window after item was unequipped
zo_callLater(function() checkMyCharacterWindowNowFunction(bag, slotIndex) end, 200)
end
return
--Debugging: Gives you the action string Id if you hover an item
else
d("actionStringId: " .. actionStringId .. " = " .. GetString(actionStringId))
end
end
If you return true the context-menu entry and the relating keybinding will be hidden.
If you return false the context-menu entry and the relating keybinding will be shown/kept.
If you just return (nil) nothing will be changed. Maybe the same as returning false.