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