changeset 0:7284e8117321 v1

initial version
author rowaasr13
date Sat, 08 Oct 2016 20:33:02 +0300
parents
children d5e5eee5b216
files OOCDo.lua OOCDo.toc
diffstat 2 files changed, 37 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OOCDo.lua	Sat Oct 08 20:33:02 2016 +0300
@@ -0,0 +1,29 @@
+-- [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
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OOCDo.toc	Sat Oct 08 20:33:02 2016 +0300
@@ -0,0 +1,8 @@
+## Interface: 70000
+
+## Title: "Out-of-combat Do" macro button
+## Version: v1
+## Notes: A helper to use dynamic macros out-of-combat
+## Author: Oleg "Rowaa[SR13]" Volkov
+
+OOCDo.lua
\ No newline at end of file