# HG changeset patch # User rowaasr13 # Date 1484066395 -10800 # Node ID e41de98f6b33a6eb50d617d41b277a54879bc23b # Parent 0a7fd4d73d302fcb300782a5e7061b27a902ddab .MacroText: explicitly set button type, as newer commands could change it to something else; luadoc. diff -r 0a7fd4d73d30 -r e41de98f6b33 OOCDo.lua --- a/OOCDo.lua Tue Jan 10 19:38:52 2017 +0300 +++ b/OOCDo.lua Tue Jan 10 19:39:55 2017 +0300 @@ -18,9 +18,14 @@ 'self:SetAttribute("type", "macro") self:SetAttribute("macrotext", "")' -- post ) +--- Sets button to perform given macro text as-is. +-- Sets button's .type to "macro" and .macrotext to given string verbatim +-- @param command macro text to perform +-- @param command2 same as command, if first argument is "taken" because of : call. function button.MacroText(command, command2) if command == button then command = command2 end if InCombatLockdown() then return end + button:SetAttribute("type", "macro") button:SetAttribute("macrotext", command) end