vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --[[---------------------------------------------------------------------------------
2 This is a template for the plugin/module system for Clique.
3  
4 Plugins are typically used to tie Clique to a specific set of unit frames, but
5 can also be used to add functionality to the system through a manner of hooks.
6  
7 Plugins are registered with Clique with a shortname that is used for all slash
8 commands. In addition they are required to have a fullname parameter that is
9 used in all display messages
10 ----------------------------------------------------------------------------------]]
11  
12 -- Create a new plugin for Clique, with the shortname "test"
13 local Plugin = Clique:NewModule("aguf")
14 Plugin.fullname = "ag Unit Frames"
15  
16 -- Plugin:Test() is called anytime the mod tries to enable. It is optional
17 -- but it will be checked if it exists. Will typically be based off some global
18 -- or the state of the addon itself.
19 function Plugin:Test() return aUF end
20  
21 -- Plugin:OnEnable() is called if Plugin:Test() is true, and the mod hasn't been explicitly
22 -- disabled. This is where you should handle all your hooks, etc.
23 function Plugin:OnEnable()
24 aUF.classes.aUFunit.prototype.OnClickOld = aUF.classes.aUFunit.prototype.OnClick
25 aUF.classes.aUFunit.prototype.OnClick = self.OnClick
26 end
27  
28 -- Plugin:OnDisable() is called if the mod is enabled and its being explicitly disabled.
29 -- This function is optional. If it doesn't exist, Plugin:UnregisterAllEvents() and
30 -- Plugin:UnregisterAllHooks().
31 function Plugin:OnDisable()
32 aUF.classes.aUFunit.prototype.OnClick = aUF.classes.aUFunit.prototype.OnClickOld
33 end
34  
35 function Plugin:OnClick(button)
36 if not Clique:OnClick(button, self.unit) then
37 aUF.units[string.gsub(this:GetName(),"aUF","")]:OnClickOld(button)
38 end
39 end