View Single Post
03/26/20, 09:45 AM   #6
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
Hey Baertram,

thanks for the detailed info!
I've tested this without zo_callLater but then the menu entry not appears

For the auction house I've got it woking with this code:
Lua Code:
  1. function ESOFarmBuddy.TradingHouseContextMenu(searchResultSlot, button)
  2.     if button == MOUSE_BUTTON_INDEX_RIGHT then
  3.         local inventorySlot = ZO_InventorySlot_GetInventorySlotComponents(searchResultSlot)
  4.         local tradingHouseIndex = ZO_Inventory_GetSlotIndex(inventorySlot)
  5.         if tradingHouseIndex ~= nil then
  6.             local itemLink = GetTradingHouseSearchResultItemLink(tradingHouseIndex)
  7.  
  8.             zo_callLater(
  9.                     function()
  10.                         AddCustomMenuItem(GetString(ESOFB_MENU_TRACK), function() ESOFarmBuddy.TrackItemFromLink(itemLink) end, MENU_ADD_OPTION_LABEL)
  11.                         ShowMenu()
  12.                     end
  13.             , 4)
  14.         end
  15.     end
  16. end
  17.  
  18. SecurePostHook("ZO_TradingHouse_OnSearchResultClicked", ESOFarmBuddy.TradingHouseContextMenu)

It also works together with your WishList AddOn



Many thanks for your help Baertram I've learned a lot about the UI in ESO.

Keldor
  Reply With Quote