Mercurial > wow > oocdo
comparison OOCDo.lua @ 0:7284e8117321 v1
initial version
author | rowaasr13 |
---|---|
date | Sat, 08 Oct 2016 20:33:02 +0300 |
parents | |
children | 56099742e29b |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7284e8117321 |
---|---|
1 -- [AUTOLOCAL START] | |
2 local CreateFrame = CreateFrame | |
3 local InCombatLockdown = InCombatLockdown | |
4 local SecureHandlerWrapScript = SecureHandlerWrapScript | |
5 local print = print | |
6 local type = type | |
7 -- [AUTOLOCAL END] | |
8 | |
9 local frame_name = "OOCDo" | |
10 local button = CreateFrame("Button", frame_name, nil, "SecureActionButtonTemplate,SecureHandlerMouseUpDownTemplate") | |
11 button:SetAttribute("type", "macro") | |
12 button:SetAttribute("macrotext", "") | |
13 SecureHandlerWrapScript( | |
14 button, -- frame | |
15 "OnClick", -- script | |
16 button, -- header | |
17 'return nil, "reset"', -- pre | |
18 'self:SetAttribute("macrotext", "")' -- post | |
19 ) | |
20 | |
21 function button:MacroText(command, command2) | |
22 if command == button then command = command2 end | |
23 if InCombatLockdown() then return end | |
24 button:SetAttribute("macrotext", command) | |
25 end | |
26 | |
27 button.Macro = button.MacroText | |
28 button.T = button.MacroText | |
29 button.M = button.MacroText |