Originally Posted by sinnereso
## 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:
if LibCustomMenu ~= nil then
local function func(rowData)
---rowData contains the row's data table of the right clicked guild roster row
--so get whatever you need from rowData
--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.
MyAddon.SavePlayer(rowData.displayName) --only an example, dunno if displayName exists in there
end
--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.
--[[
category
lib.CATEGORY_EARLY
lib.CATEGORY_PRIMARY
lib.CATEGORY_SECONDARY
lib.CATEGORY_TERTIARY
lib.CATEGORY_QUATERNARY
lib.CATEGORY_LATE
]]
local category = LibCustomMenu.CATEGORY_LATE
LibCustomMenu:RegisterGuildRosterContextMenu(myFunc, category)
end
For the other context menu at the chat etc. check the description, it works about the same like teh guidl roster.
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.