Guest User

Untitled

a guest
Feb 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1.  
  2. -- helper function to create click-cast macros
  3. local function CreateClickCast(frame, whatType, modifier, button, macroText)
  4. local remappedButton = whatType..button
  5.  
  6.  
  7. if modifier then
  8. modifier = modifier.."-"
  9. else
  10. modifier = ""
  11. end
  12.  
  13. macroText = string.gsub(macroText, "\r", string.char(13))
  14.  
  15. frame:SetAttribute(modifier..whatType.."button"..button, remappedButton)
  16. frame:SetAttribute(modifier.."type-"..remappedButton, "macro")
  17. frame:SetAttribute(modifier.."spell-"..remappedButton, nil)
  18. frame:SetAttribute(modifier.."macro-"..remappedButton, nil)
  19. frame:SetAttribute(modifier.."bag-"..remappedButton, nil)
  20. frame:SetAttribute(modifier.."slot-"..remappedButton, nil)
  21. frame:SetAttribute(modifier.."item-"..remappedButton, nil)
  22. frame:SetAttribute(modifier.."macrotext-"..remappedButton, macroText)
  23. end
Add Comment
Please, Sign In to add comment