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("test")
14 Plugin.fullname = "Test Plugin for Clique"
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()
20 return IsAddOnLoaded("PerfectRaid")
21 end
22  
23 -- Plugin:OnEnable() is called if Plugin:Test() is true, and the mod hasn't been explicitly
24 -- disabled. This is where you should handle all your hooks, etc.
25 function Plugin:OnEnable()
26 self:Debug("Enabling a module \"%s\" for %s", self.name, self.fullname)
27 PerfectRaidCustomClick = self.OnClick
28 end
29  
30 -- Plugin:OnDisable() is called if the mod is enabled and its being explicitly disabled.
31 -- This function is optional. If it doesn't exist, Plugin:UnregisterAllEvents() and
32 -- Plugin:UnregisterAllHooks().
33 function Plugin:OnDisable()
34 PerfectRaidCustomClick = nil
35 end
36  
37 -- Below this line begins any custom code to make the plugin work
38 function Plugin.OnClick(button, unit)
39 if not Clique:OnClick(button, unit) then
40 if button == "LeftButton" then
41 TargetUnit(unit)
42 elseif button == "RightButton" then
43 Clique:UnitMenu(unit)
44 end
45 end
46 end