Jump to content
Sign in to follow this  
AurorLock

Developing addons for 1.12

Recommended Posts

Was trying to learn the Ace library, but not even a boilerplate addon loads. Is there a good place to start for development?

 

AuroraLib = AceLibrary("AceAddon-2.0"):new("AceConsole-2.0")
 
function AuroraLib:OnInitialize()
    -- Called when the addon is loaded
    DEFAULT_CHAT_FRAME:AddMessage("AuroraLib: Loaded")
end
 
function AuroraLib:OnEnable()
    -- Called when the addon is enabled
    DEFAULT_CHAT_FRAME:AddMessage("AuroraLib: Loaded")
end
 
function AuroraLib:OnDisable()
    -- Called when the addon is disabled
end

Share this post


Link to post
Share on other sites

I've also found out that the old Ace2 documentation is pretty much hit and miss back when I was playing around with it. Your best bet is to look at how other Addons do it whenever you get stuck.

 

Alternatively, you could give the Ace3 backport a shot. I haven't been able to toy around with it yet, but it looks very promising! And since it is a direct backport of the current Ace3 library, you should be able to use the Ace3 documentation just fine. But again, I haven't tried it at all, so I can't guarantee anything.

Share this post


Link to post
Share on other sites

Problem was I didn't load the lua file from the .toc file xD.

 

So I'm trying to create an addon that will dynamically track a pet's happiness. I'm not sure if there are any events that I can use to monitor the pet's happiness, so I'll probably need to make a timer. I couldn't figure out how BigWig's does their timers, as I'd just plan on showing a frame and updating it on screen like a larger buff icon. Otherwise if you know which event and how to properly register it, that'd be a big step forward for me.

Share this post


Link to post
Share on other sites

UNIT_HAPPINESS

 

Is the event you are looking for.

AuroraLib = AceLibrary("AceAddon-2.0"):new("AceConsole-2.0","AceEvent-2.0")
 
function AuroraLib:OnInitialize()
    -- Called when the addon is loaded
    DEFAULT_CHAT_FRAME:AddMessage("AuroraLib: Loaded")
    self:RegisterEvent("UNIT_HAPPINESS")
end
 
function AuroraLib:UNIT_HAPPINESS()
     DEFAULT_CHAT_FRAME:AddMessage("AuroraLib: Happiness changed")
end

function AuroraLib:OnEnable()
    -- Called when the addon is enabled
    DEFAULT_CHAT_FRAME:AddMessage("AuroraLib: Loaded")
end
 
function AuroraLib:OnDisable()
    -- Called when the addon is disabled
end

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×