view OOCDo.lua @ 2:56099742e29b v2

oops, dot address should be default or it will be broken
author rowaasr13
date Sat, 08 Oct 2016 23:59:48 +0300
parents 7284e8117321
children 0a7fd4d73d30
line wrap: on
line source
-- [AUTOLOCAL START]
local CreateFrame = CreateFrame
local InCombatLockdown = InCombatLockdown
local SecureHandlerWrapScript = SecureHandlerWrapScript
local print = print
local type = type
-- [AUTOLOCAL END]

local frame_name = "OOCDo"
local button = CreateFrame("Button", frame_name, nil, "SecureActionButtonTemplate,SecureHandlerMouseUpDownTemplate")
button:SetAttribute("type", "macro")
button:SetAttribute("macrotext", "")
SecureHandlerWrapScript(
   button,     -- frame
   "OnClick",  -- script
   button,     -- header
   'return nil, "reset"',               -- pre
   'self:SetAttribute("macrotext", "")' -- post
)

function button.MacroText(command, command2)
   if command == button then command = command2 end
   if InCombatLockdown() then return end
   button:SetAttribute("macrotext", command)
end

button.Macro = button.MacroText
button.T = button.MacroText
button.M = button.MacroText