Thread Tools Display Modes
Prev Previous Post   Next Post Next
04/06/14, 09:35 AM   #1
Yazilliclick
Join Date: Apr 2014
Posts: 6
Lua Error Help First Addon

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:
  1. local yc = ZO_Object:Subclass()
  2. local eventManager = GetEventManager()
  3.  
  4. function yc:New()
  5.     yc.AddOnName = "YazClock"
  6.     yc.AddOnEventManager()
  7. end
  8.  
  9. function yc:OnUpdate() 
  10. end
  11.  
  12. function yc:OnAddOnLoaded(eventCode, addOnName)
  13.     yc:SetHandler("OnUpdate", function(...) yc:OnUpdate(...) end)
  14. end
  15.  
  16. function yc:AddOnEventManager()
  17.     eventManager:RegisterForEvent(yc.AddOnName .. "_AddOnLoaded", EVENT_ADD_ON_LOADED, function(...) yc:OnAddOnLoaded(...) end)
  18. end
  19.  
  20. 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
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Lua Error Help First Addon


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off