View Single Post
03/10/23, 06:32 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,979
Originally Posted by sinnereso View Post
## OptionalDependsOn: LibCustomMenu>=680 <<< ive found this in another addon but no idea what the number means... line#?
Check the WIKI for such questions, it explains what the manifes txt file contains and why there are such things like >= version etc. for libraries
https://wiki.esoui.com/Addon_manifest_(.txt)_format
-> https://wiki.esoui.com/Addon_manifes...rmat#DependsOn

https://wiki.esoui.com/Libraries#.23...ned_integer.3E

And about LibCustomMenu:
The description provides examples how to add such contextmenus.

Guild roster - Just add 1 call at e.g. your EVENT_ADD_ON_LOADED.

Lua Code:
  1. if LibCustomMenu ~= nil then
  2.    local function func(rowData)
  3.     ---rowData contains the row's data table of the right clicked guild roster row
  4.     --so get whatever you need from rowData
  5.     --You coudl add rowData to your global variable MyAddon._rowData and the inspect MyAddon._rowData with merTorchbug or zgoo ingame to see what it provides. I think there is a displayName in the rowData and maybe the charatcterName, a memberIndex of that row, etc.
  6.        MyAddon.SavePlayer(rowData.displayName) --only an example, dunno if displayName exists in there
  7.    end
  8.    --category can be any of the categories of the lib do define if teh contetx menu entyr should be added early (at the top of the context menu -> don't do that as all vanilla contetx menu entries should stay there so users do not get confused...) or at the bottom of the context menu.
  9. --[[
  10. category
  11. lib.CATEGORY_EARLY
  12. lib.CATEGORY_PRIMARY
  13. lib.CATEGORY_SECONDARY
  14. lib.CATEGORY_TERTIARY
  15. lib.CATEGORY_QUATERNARY
  16. lib.CATEGORY_LATE
  17. ]]
  18.  
  19.    local category = LibCustomMenu.CATEGORY_LATE
  20.    LibCustomMenu:RegisterGuildRosterContextMenu(myFunc, category)
  21. end
  22.  
  23. For the other context menu at the chat etc. check the description, it works about the same like teh guidl roster.
  24. 1 function needs to be registered which is called as the chat entry is right clicked and you define the callback function of your addon and the category etc.

Last edited by Baertram : 03/10/23 at 06:40 AM.
  Reply With Quote