unitframes: try to target focus by name

This commit is contained in:
shagu
2017-06-02 18:01:50 +02:00
parent 29763cf47b
commit 2c6c212c2d
+6 -2
View File
@@ -292,8 +292,11 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
GameTooltip:FadeOut() GameTooltip:FadeOut()
end) end)
f:SetScript("OnClick", function () f:SetScript("OnClick", function ()
if not this.label then return end if not this.label and this.unitname then
pfUI.uf:ClickAction(arg1) TargetByName(this.unitname)
else
pfUI.uf:ClickAction(arg1)
end
end) end)
f.leaderIcon = CreateFrame("Frame", nil, f.hp.bar) f.leaderIcon = CreateFrame("Frame", nil, f.hp.bar)
@@ -441,6 +444,7 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
f.debuffs[i]:SetHeight(f.config.debuffsize) f.debuffs[i]:SetHeight(f.config.debuffsize)
f.debuffs[i]:SetNormalTexture(nil) f.debuffs[i]:SetNormalTexture(nil)
f.debuffs[i]:SetScript("OnEnter", function() f.debuffs[i]:SetScript("OnEnter", function()
if not this:GetParent().label then return end
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT") GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")
if this:GetParent().label == "player" then if this:GetParent().label == "player" then
GameTooltip:SetPlayerBuff(GetPlayerBuff(id-1,"HARMFUL")) GameTooltip:SetPlayerBuff(GetPlayerBuff(id-1,"HARMFUL"))