unitframes: add pvp flag icon to all frames

This commit is contained in:
shagu
2018-07-07 22:24:59 +02:00
parent 0c1f876c56
commit acd991cf8b
4 changed files with 45 additions and 37 deletions
+1 -1
View File
@@ -783,7 +783,6 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(nil, this, T["Range Check Interval"], C.unitframes, "rangechecki", "dropdown", pfUI.gui.dropdowns.uf_rangecheckinterval)
CreateConfig(nil, this, T["Combopoint Size"], C.unitframes, "combosize")
CreateConfig(nil, this, T["Abbreviate Numbers (4200 -> 4.2k)"], C.unitframes, "abbrevnum", "checkbox")
CreateConfig(nil, this, T["Show PvP Icon"], C.unitframes.player, "showPVP", "checkbox")
CreateConfig(nil, this, T["Enable Energy Ticks"], C.unitframes.player, "energy", "checkbox")
this.setup = true
end
@@ -859,6 +858,7 @@ pfUI:RegisterModule("gui", function ()
-- build config entries
CreateConfig(update[c], this, T["Display Frame"] .. ": " .. t, C.unitframes[c], "visible", "checkbox")
CreateConfig(update[c], this, T["Show PvP-Flag Indicator"], C.unitframes[c], "showPVP", "checkbox")
CreateConfig(update[c], this, T["Enable Mouseover Tooltip"], C.unitframes[c], "showtooltip", "checkbox")
CreateConfig(update[c], this, T["Enable Clickcast"], C.unitframes[c], "clickcast", "checkbox")
CreateConfig(update[c], this, T["Enable Range Fading"], C.unitframes[c], "faderange", "checkbox")
-25
View File
@@ -14,28 +14,6 @@ pfUI:RegisterModule("player", function ()
pfUI.uf.player = pfUI.uf:CreateUnitFrame("Player", nil, C.unitframes.player)
pfUI.uf.player.pvpicon = CreateFrame("Frame", nil, pfUI.uf.player)
pfUI.uf.player.pvpicon:Hide()
pfUI.uf.player.pvpicon:RegisterEvent("UPDATE_FACTION")
pfUI.uf.player.pvpicon:RegisterEvent("UNIT_FACTION")
pfUI.uf.player.pvpicon:SetFrameStrata("HIGH")
pfUI.uf.player.pvpicon:SetWidth(16)
pfUI.uf.player.pvpicon:SetHeight(16)
pfUI.uf.player.pvpicon:SetAlpha(.25)
pfUI.uf.player.pvpicon:SetParent(pfUI.uf.player.hp.bar)
pfUI.uf.player.pvpicon:SetPoint("TOP", pfUI.uf.player.hp.bar, "TOP", 0, -5)
pfUI.uf.player.pvpicon.texture = pfUI.uf.player.pvpicon:CreateTexture(nil,"DIALOG")
pfUI.uf.player.pvpicon.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\pvp")
pfUI.uf.player.pvpicon.texture:SetAllPoints(pfUI.uf.player.pvpicon)
pfUI.uf.player.pvpicon:SetScript("OnEvent", function()
if C.unitframes.player.showPVP == "1" and UnitIsPVP("player") then
pfUI.uf.player.pvpicon:Show()
else
pfUI.uf.player.pvpicon:Hide()
end
end)
pfUI.uf.player:UpdateFrameSize()
pfUI.uf.player:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOM", -75, 125)
UpdateMovable(pfUI.uf.player)
@@ -51,9 +29,6 @@ pfUI:RegisterModule("player", function ()
end
end)
pfUI.uf.player:RegisterEvent("UPDATE_FACTION") -- pvp icon
pfUI.uf.player:RegisterEvent("UNIT_FACTION") -- pvp icon
if C.unitframes.player.energy == "1" then
pfUI.uf.player.power.tick = CreateFrame("Frame", nil, pfUI.uf.player.power.bar)
pfUI.uf.player.power.tick:RegisterEvent("PLAYER_ENTERING_WORLD")