GetAllNameplates() example

lib:GetAllNameplates()

local function WorkOnAllNameplates()
	local frames = {LibNameplate:GetAllNameplates()}
	local pName
	for i, frame in ipairs(frames) do 
		pName = LibNameplate:GetName(frame)
		print(frame.."'s name is "..pName..".")
	end
end

NOTE: The above example creates a new table every time the function runs. Your plugin's memory usage may skyrocket if the function's called too rapidly. The below example doesn't have the table problem.

local WorkOnAllNameplates
do
	local pName
	function WorkOnAllNameplates(frame, ...)
		if not frame then
			return
		end
		pName = LibNameplate:GetName(frame)
		print(frame.."'s name is ".. pName ..".")
		return WorkOnAllNameplates(...)
	end
end
...
	WorkOnAllNameplates(LibNameplate:GetAllNameplates())

Comments

Posts Quoted:
Reply
Clear All Quotes