Advertisement
Guest User

Untitled

a guest
May 28th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. BINDING_HEADER_TABPARTY = "Tab Party"
  2. _G["BINDING_NAME_CLICK TabPartyButton:LeftButton"] = "Cycle Party Members"
  3. _G["BINDING_NAME_CLICK TabPartyButton:RightButton"] = "Reverse Cycle Party Members"
  4.  
  5. local TheButton = CreateFrame("Button", "TabPartyButton", UIParent, "SecureActionButtonTemplate")
  6. TheButton:SetAttribute("*type1", "target")
  7. TheButton:SetAttribute("*type2", "target")
  8. TheButton:SetAttribute("unit", "player")
  9. SecureHandlerWrapScript(TheButton, "OnClick", TheButton,  [[
  10. if not lastunit then lastunit = 0 end
  11. local newunit
  12. repeat
  13.     if button == "RightButton" then
  14.         lastunit = (lastunit + 4) % 3
  15.     else
  16.         lastunit = (lastunit + 1) % 3
  17.     end
  18.     if lastunit == 0 then
  19.         newunit = "player"
  20.     else
  21.         newunit = "party"..lastunit
  22.     end
  23. until UnitExists(newunit)
  24. self:SetAttribute("unit", newunit)
  25. ]])
  26.  
  27. --[===[@debug@
  28. TheButton:RegisterEvent("PLAYER_ENTERING_WORLD")
  29. --TheButton:SetScript("OnEvent", function(self, event) if event == "PLAYER_ENTERING_WORLD" then self:ShowButton() end end)
  30. --@end-debug@]===]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement