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("oocclicks")
14 Plugin.fullname = "Out of Combat Clicks"
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 local OOC_CLICKS = "Out-of-combat"
20  
21 function Plugin:OnEnable()
22 Clique.db.char[OOC_CLICKS] = Clique.db.char[OOC_CLICKS] or {}
23 end
24  
25 function Plugin:_OnClick(button, unit)
26 unit = unit or Clique.unit
27  
28 self:LevelDebug(3, "_OnClick hook being called")
29 if not UnitAffectingCombat("player") and not UnitAffectingCombat(unit) and UnitHealth(unit) then
30 Clique.set = OOC_CLICKS
31 return true
32 end
33 end