Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BINDING_HEADER_TABPARTY = "Tab Party"
- _G["BINDING_NAME_CLICK TabPartyButton:LeftButton"] = "Cycle Party Members"
- _G["BINDING_NAME_CLICK TabPartyButton:RightButton"] = "Reverse Cycle Party Members"
- local TheButton = CreateFrame("Button", "TabPartyButton", UIParent, "SecureActionButtonTemplate")
- TheButton:SetAttribute("*type1", "target")
- TheButton:SetAttribute("*type2", "target")
- TheButton:SetAttribute("unit", "player")
- SecureHandlerWrapScript(TheButton, "OnClick", TheButton, [[
- if not lastunit then lastunit = 0 end
- local newunit
- repeat
- if button == "RightButton" then
- lastunit = (lastunit + 4) % 3
- else
- lastunit = (lastunit + 1) % 3
- end
- if lastunit == 0 then
- newunit = "player"
- else
- newunit = "party"..lastunit
- end
- until UnitExists(newunit)
- self:SetAttribute("unit", newunit)
- ]])
- --[===[@debug@
- TheButton:RegisterEvent("PLAYER_ENTERING_WORLD")
- --TheButton:SetScript("OnEvent", function(self, event) if event == "PLAYER_ENTERING_WORLD" then self:ShowButton() end end)
- --@end-debug@]===]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement