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("blizzraid")
14 Plugin.fullname = "Blizzard Raid 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()
20 return RaidPullout_Update and not IsAddOnLoaded("EasyRaid")
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:Hook("RaidPullout_Update", "SetClicks")
27 self:Hook("RaidPulloutButton_OnClick", "OnClick")
28 end
29  
30 function Plugin:SetClicks(frame)
31 self.hooks.RaidPullout_Update.orig(frame)
32  
33 if not frame then frame = this end
34 for i=1,NUM_RAID_PULLOUT_FRAMES do
35 --ChatFrame1:AddMessage(string.format("Setting clicks on %d frames within %s", frame.numPulloutButtons, frame:GetName()))
36  
37 for j=1, frame.numPulloutButtons do
38 local button = getglobal(frame:GetName().."Button"..j.."ClearButton");
39 --ChatFrame1:AddMessage(string.format("Registering clicks on %s", button:GetName()))
40 button:RegisterForClicks("LeftButtonUp", "RightButtonUp", "MiddleButtonUp", "Button4Up", "Button5Up")
41 end
42 end
43 end
44  
45 function Plugin:OnClick()
46 local button = arg1
47 local unit = this.unit
48 if not Clique:OnClick(button, unit) then
49 self.hooks.RaidPulloutButton_OnClick.orig(this)
50 end
51 end