Originally Posted by unLeashed3k
Is there any type of documentation on all these [no clue what they are] controls?
What I truly need is a method to try all these functions and controls within an basic/universal example program. I'm extremely frustrated because I believe I'm looking at how everything works completely backwards.
Looking at http://wiki.esoui.com/Userdata_in_100007_API I can't figure out what they return (or contain). Are these all objects? If so, how do I look at them? Every function I use on them returns nil or an error (userdata).
Edit: How about that. Getting output now of ZO_MapPin1 through 50. Now to figure out how to map the globals to what they really are.
|
Controls are objects.
http://wiki.esoui.com/Controls
Working code:
Lua Code:
EVENT_MANAGER:RegisterForEvent("QuestOffers", EVENT_ADD_ON_LOADED,
function(event, addonName)
if (addonName):find("^ZO_") then return end
EVENT_MANAGER:UnregisterForEvent("QuestOffers", event)
local time_between_alerts = 5000 --in milliseconds
local lastDescription, nextAlert
ZO_PreHookHandler(COMPASS.container, "OnUpdate",
function(self)
local now = GetFrameTimeMilliseconds()
if now < COMPASS.nextLabelUpdateTime then
return true
end
--do not show alerts when boss bar is active
if BOSS_BAR.control:IsHidden() then
for i = 1, self:GetNumCenterOveredPins() do
local description, pinTypeId = self:GetCenterOveredPinInfo(i)
if pinTypeId == MAP_PIN_TYPE_QUEST_OFFER and (lastDescription ~= description or nextAlert < now) then
CENTER_SCREEN_ANNOUNCE:DisplayMessage(CSA_EVENT_SMALL_TEXT, SOUNDS.QUEST_FOCUSED, "Quest offer: " .. ZO_ERROR_COLOR:Colorize(description))
lastDescription = description
nextAlert = now + time_between_alerts
end
end
end
end)
end)