public
Description: WoW Addon - Food/water macro generator
Homepage: http://www.tekkub.net
Clone URL: git://github.com/tekkub/buffet.git
Click here to lend your support to: buffet and make a donation at www.pledgie.com !
Disable the macro buttons in combat
tekkub (author)
Wed Sep 03 00:39:08 -0700 2008
commit  9b05df8d5c51866c84542e8f9e1e8e1bcbc27b48
tree    7ad07659722a8f74a69d172e3090f71b73e02f5c
parent  f338784b2684460abb4a3a185df7f35f9efc3b44
...
12
13
14
15
16
17
18
19
20
21
22
...
32
33
34
 
35
36
37
38
39
40
 
41
42
43
...
104
105
106
 
 
 
 
 
 
 
107
108
109
...
12
13
14
 
 
 
 
 
15
16
17
...
27
28
29
30
31
32
33
34
35
36
37
38
39
40
...
101
102
103
104
105
106
107
108
109
110
111
112
113
0
@@ -12,11 +12,6 @@ frame:SetScript("OnShow", function()
0
   local title, subtitle = LibStub("tekKonfig-Heading").new(frame, "Buffet", "This panel allows you to quickly create the base macros for Buffet to edit. You can also set the macro text to be used.")
0
 
0
   local function OnClick(self)
0
- if InCombatLockdown() then
0
- Buffet:Print("Cannot create macros in combat.")
0
- return
0
- end
0
-
0
     local id = GetMacroIndexByName(self.name)
0
     if id and id ~= 0 then PickupMacro(id)
0
     elseif GetNumMacros() >= MAX_ACCOUNT_MACROS then Buffet:Print("All global macros in use.")
0
@@ -32,12 +27,14 @@ frame:SetScript("OnShow", function()
0
   hpbutt.tiptext = "Generate a global macro for food, bandages, health potions and health stones."
0
   hpbutt.name = "AutoHP"
0
   hpbutt:SetScript("OnClick", OnClick)
0
+ if InCombatLockdown() then hpbutt:Disable() end
0
 
0
   local mpbutt = tekbutt.new(frame, "TOPLEFT", hpbutt, "TOPRIGHT", GAP, 0)
0
   mpbutt:SetText("MP Macro")
0
   mpbutt.tiptext = "Generate a global macro for water, mana potions and mana stones."
0
   mpbutt.name = "AutoMP"
0
   mpbutt:SetScript("OnClick", OnClick)
0
+ if InCombatLockdown() then mpbutt:Disable() end
0
 
0
   local hpmacrolabel = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
0
   hpmacrolabel:SetText("HP Macro")
0
@@ -104,6 +101,13 @@ frame:SetScript("OnShow", function()
0
   mpeditbox:SetScript("OnEnter", mpbutt:GetScript("OnEnter"))
0
   mpeditbox:SetScript("OnLeave", mpbutt:GetScript("OnLeave"))
0
 
0
+ frame:SetScript("OnEvent", function(self, event)
0
+ if event == "PLAYER_REGEN_DISABLED" then hpbutt:Disable() mpbutt:Disable()
0
+ else hpbutt:Enable() mpbutt:Enable() end
0
+ end)
0
+ frame:RegisterEvent("PLAYER_REGEN_ENABLED")
0
+ frame:RegisterEvent("PLAYER_REGEN_DISABLED")
0
+
0
   frame:SetScript("OnShow", nil)
0
 end)
0
 

Comments

    No one has commented yet.