unitframes: options to hide raid, loot and leader icon

This commit is contained in:
shagu
2019-04-19 16:13:08 +02:00
parent 8642efab86
commit 96256a59e5
3 changed files with 64 additions and 16 deletions
+33
View File
@@ -202,6 +202,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "player", "visible", "1")
pfUI:UpdateConfig("unitframes", "player", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "player", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "player", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "player", "looticon", "1")
pfUI:UpdateConfig("unitframes", "player", "portrait", "bar")
pfUI:UpdateConfig("unitframes", "player", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "player", "width", "200")
@@ -245,6 +248,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "target", "visible", "1")
pfUI:UpdateConfig("unitframes", "target", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "target", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "target", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "target", "looticon", "1")
pfUI:UpdateConfig("unitframes", "target", "portrait", "bar")
pfUI:UpdateConfig("unitframes", "target", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "target", "width", "200")
@@ -289,6 +295,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "focus", "visible", "1")
pfUI:UpdateConfig("unitframes", "focus", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "focus", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "focus", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "focus", "looticon", "1")
pfUI:UpdateConfig("unitframes", "focus", "portrait", "bar")
pfUI:UpdateConfig("unitframes", "focus", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "focus", "width", "120")
@@ -332,6 +341,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "group", "visible", "1")
pfUI:UpdateConfig("unitframes", "group", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "group", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "group", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "group", "looticon", "1")
pfUI:UpdateConfig("unitframes", "group", "portrait", "off")
pfUI:UpdateConfig("unitframes", "group", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "group", "width", "164")
@@ -376,6 +388,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "grouptarget", "visible", "1")
pfUI:UpdateConfig("unitframes", "grouptarget", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "grouptarget", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "grouptarget", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "grouptarget", "looticon", "1")
pfUI:UpdateConfig("unitframes", "grouptarget", "portrait", "off")
pfUI:UpdateConfig("unitframes", "grouptarget", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "grouptarget", "width", "120")
@@ -419,6 +434,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "grouppet", "visible", "1")
pfUI:UpdateConfig("unitframes", "grouppet", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "grouppet", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "grouppet", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "grouppet", "looticon", "1")
pfUI:UpdateConfig("unitframes", "grouppet", "portrait", "off")
pfUI:UpdateConfig("unitframes", "grouppet", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "grouppet", "width", "100")
@@ -462,6 +480,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "raid", "visible", "1")
pfUI:UpdateConfig("unitframes", "raid", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "raid", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "raid", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "raid", "looticon", "1")
pfUI:UpdateConfig("unitframes", "raid", "portrait", "off")
pfUI:UpdateConfig("unitframes", "raid", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "raid", "width", "50")
@@ -505,6 +526,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "ttarget", "visible", "1")
pfUI:UpdateConfig("unitframes", "ttarget", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "ttarget", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "ttarget", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "ttarget", "looticon", "1")
pfUI:UpdateConfig("unitframes", "ttarget", "portrait", "bar")
pfUI:UpdateConfig("unitframes", "ttarget", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "ttarget", "width", "100")
@@ -548,6 +572,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "pet", "visible", "1")
pfUI:UpdateConfig("unitframes", "pet", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "pet", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "pet", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "pet", "looticon", "1")
pfUI:UpdateConfig("unitframes", "pet", "portrait", "bar")
pfUI:UpdateConfig("unitframes", "pet", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "pet", "width", "100")
@@ -591,6 +618,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "ptarget", "visible", "0")
pfUI:UpdateConfig("unitframes", "ptarget", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "ptarget", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "ptarget", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "ptarget", "looticon", "1")
pfUI:UpdateConfig("unitframes", "ptarget", "portrait", "bar")
pfUI:UpdateConfig("unitframes", "ptarget", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "ptarget", "width", "100")
@@ -634,6 +664,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "fallback", "visible", "1")
pfUI:UpdateConfig("unitframes", "fallback", "showPVP", "0")
pfUI:UpdateConfig("unitframes", "fallback", "raidicon", "1")
pfUI:UpdateConfig("unitframes", "fallback", "leadericon", "1")
pfUI:UpdateConfig("unitframes", "fallback", "looticon", "1")
pfUI:UpdateConfig("unitframes", "fallback", "portrait", "bar")
pfUI:UpdateConfig("unitframes", "fallback", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
pfUI:UpdateConfig("unitframes", "fallback", "width", "200")
+28 -16
View File
@@ -1102,36 +1102,48 @@ function pfUI.uf:RefreshUnit(unit, component)
-- Raid Icon
if unit.raidIcon and ( component == "all" or component == "raidIcon" ) then
local raidIcon = GetRaidTargetIndex(unitstr)
if raidIcon and UnitName(unitstr) then
SetRaidTargetIconTexture(unit.raidIcon.texture, raidIcon)
unit.raidIcon:Show()
else
if unit.config.raidicon == "0" then
unit.raidIcon:Hide()
else
local raidIcon = GetRaidTargetIndex(unitstr)
if raidIcon and UnitName(unitstr) then
SetRaidTargetIconTexture(unit.raidIcon.texture, raidIcon)
unit.raidIcon:Show()
else
unit.raidIcon:Hide()
end
end
end
-- Leader Icon
if unit.leaderIcon and ( component == "all" or component == "leaderIcon" ) then
if GetNumPartyMembers() == 0 and GetNumRaidMembers() == 0 then
if unit.config.leadericon == "0" then
unit.leaderIcon:Hide()
elseif UnitIsPartyLeader(unitstr) then
unit.leaderIcon:Show()
else
unit.leaderIcon:Hide()
if GetNumPartyMembers() == 0 and GetNumRaidMembers() == 0 then
unit.leaderIcon:Hide()
elseif UnitIsPartyLeader(unitstr) then
unit.leaderIcon:Show()
else
unit.leaderIcon:Hide()
end
end
end
-- Loot Icon
if unit.lootIcon and ( component == "all" or component == "lootIcon" ) then
-- no third return value here.. but leaving this as a hint
local method, group, raid = GetLootMethod()
local name = group and UnitName(group == 0 and "player" or "party"..group) or raid and UnitName("raid"..raid) or nil
if name and name == UnitName(unitstr) then
unit.lootIcon:Show()
else
if unit.config.looticon == "0" then
unit.lootIcon:Hide()
else
-- no third return value here.. but leaving this as a hint
local method, group, raid = GetLootMethod()
local name = group and UnitName(group == 0 and "player" or "party"..group) or raid and UnitName("raid"..raid) or nil
if name and name == UnitName(unitstr) then
unit.lootIcon:Show()
else
unit.lootIcon:Hide()
end
end
end
+3
View File
@@ -1497,6 +1497,9 @@ pfUI:RegisterModule("gui", 20400, function ()
CreateConfig(U[c], T["Status Bar Texture"], C.unitframes[c], "bartexture", "dropdown", pfUI.gui.dropdowns.uf_bartexture)
CreateConfig(U[c], T["UnitFrame Spacing"], C.unitframes[c], "pspace")
CreateConfig(U[c], T["Show PvP-Flag"], C.unitframes[c], "showPVP", "checkbox")
CreateConfig(U[c], T["Show Raid Mark"], C.unitframes[c], "raidicon", "checkbox")
CreateConfig(U[c], T["Show Loot Icon"], C.unitframes[c], "looticon", "checkbox")
CreateConfig(U[c], T["Show Leader Icon"], C.unitframes[c], "leadericon", "checkbox")
CreateConfig(U[c], T["Display Class Buffs"], C.unitframes[c], "buff_indicator", "checkbox")
CreateConfig(U[c], T["Healthbar"], nil, nil, "header")