View Single Post
03/10/23, 03:16 PM   #9
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Well Ive never used a callback and trying to understand what that even is still but ive made progress.. with this ive got the menu item then when clicked drops an error stating it was expecting a function instead of nil..

I have this nagging feeling the AddMenuContext function should up up in the ONLOAD part tbh.

What you see below particularly the last function thats mostly comented out is more or less all I want it to do.

Code:
ONLOAD()
if LibCustomMenu ~= nil then
		local function func(rowData)
		      MyAddon.AddMenuContext(rowData.playerName)
		end
		local category = LibCustomMenu.CATEGORY_LATE
		LibCustomMenu:RegisterGuildRosterContextMenu(MyAddon.AddMenuContext, category)
	end

function MyAddon.AddMenuContext(playerName) <<<<<< this is adding the menu item but error clicking in guild menu
	AddCustomMenuItem("MyAddon Save",  MyAddon.SavePlayerContext(playerName))
end

function MyAddon.SavePlayerContext(playerName) <<<<<<<<<its not liking this section at all yet
	--local playerToBeSaved = playerName
        --MyAddon.savedVariables.savedPlayer = playerToBeSaved
	--df("|c6666FF[MyAddon]|r Saving: %s", playerToBeSaved)
end

Last edited by sinnereso : 03/10/23 at 03:23 PM.
  Reply With Quote