Hey,
Trying my first addon and getting an error I haven't been able to solve. Probably something simple and stupid.
user:/AddOns/YazClock/YazClock.lua:13: function expected instead of nil
stack traceback:
user:/AddOns/YazClock/YazClock.lua:13: in function 'yc:OnAddOnLoaded'
user:/AddOns/YazClock/YazClock.lua:17: in function '(anonymous)'
|
YazClock.lua
Lua Code:
local yc = ZO_Object:Subclass()
local eventManager = GetEventManager()
function yc:New()
yc.AddOnName = "YazClock"
yc.AddOnEventManager()
end
function yc:OnUpdate()
end
function yc:OnAddOnLoaded(eventCode, addOnName)
yc:SetHandler("OnUpdate", function(...) yc:OnUpdate(...) end)
end
function yc:AddOnEventManager()
eventManager:RegisterForEvent(yc.AddOnName .. "_AddOnLoaded", EVENT_ADD_ON_LOADED, function(...) yc:OnAddOnLoaded(...) end)
end
yc:New()
YazClock.xml
Code:
<GuiXml>
<Controls>
<TopLevelControl name="YazClock" mouseEnabled="true" movable="true">
<Dimensions x="200" y="42" />
<Anchor point="CENTER" />
<Controls>
<Label name="$(parent)TimeDisplay" font="ZoFontGame" color="CFDCBD" wrapmode="ELLIPSIS" verticalalignment="CENTER" text="Counter: ">
<AnchorFill />
</Label>
</Controls>
</TopLevelControl>
</Controls>
</GuiXml>
Any help appreciated. If somebody wanted to give hints or code towards moving control creation into the lua and saving position between loads as those are my next steps that'd be great but I think I can figure that out eventually