unitframes: unify onclick function

This commit is contained in:
shagu
2017-02-03 18:18:06 +01:00
parent c0d33cd024
commit 6c030db720
5 changed files with 108 additions and 207 deletions
+1 -8
View File
@@ -31,14 +31,7 @@ pfUI:RegisterModule("pet", function ()
end)
pfUI.uf.pet:SetScript("OnClick", function ()
local _, playerClass = UnitClass("player");
if arg1 == "RightButton" then
ToggleDropDownMenu(1, nil, PetFrameDropDown, "cursor")
elseif ( CursorHasItem() and playerClass == "HUNTER" ) then
DropItemOnUnit("pet");
else
TargetUnit("pet")
end
pfUI.uf:ClickAction(arg1)
end)
pfUI.uf.pet:RegisterEvent("PLAYER_ENTERING_WORLD")