group: reliably hide group members

This commit is contained in:
shagu
2017-01-01 15:50:06 +01:00
parent 22312b602b
commit ee99a9d367
+38 -39
View File
@@ -35,46 +35,45 @@ pfUI:RegisterModule("group", function ()
for i=1, 4 do
if pfUI_config.unitframes.group.hide_in_raid == "1" and UnitInRaid("player") then
pfUI.uf.group[i]:Hide()
return
end
if event == "RAID_TARGET_UPDATE" or event == "PLAYER_ENTERING_WORLD" or event == "PARTY_MEMBERS_CHANGED" then
local raidIcon = GetRaidTargetIndex("party" .. i)
if raidIcon and UnitExists("party" .. i) then
SetRaidTargetIconTexture(pfUI.uf.group[i].hp.raidIcon.texture, raidIcon)
pfUI.uf.group[i].hp.raidIcon:Show()
else
pfUI.uf.group[i].hp.raidIcon:Hide()
end
end
if event == "PARTY_LEADER_CHANGED" or event == "PLAYER_ENTERING_WORLD" or event == "PARTY_MEMBERS_CHANGED" then
if UnitIsPartyLeader("party"..i) then
pfUI.uf.group[i].hp.leaderIcon:Show()
else
pfUI.uf.group[i].hp.leaderIcon:Hide()
end
end
if event == "PARTY_LOOT_METHOD_CHANGED" or event == "PLAYER_ENTERING_WORLD" or event == "PARTY_MEMBERS_CHANGED" then
local _, lootmaster = GetLootMethod()
if lootmaster and pfUI.uf.group[i].id == lootmaster then
pfUI.uf.group[i].hp.lootIcon:Show()
else
pfUI.uf.group[i].hp.lootIcon:Hide()
end
end
if GetNumPartyMembers() >= i then
pfUI.uf.group[i]:Show()
if UnitIsConnected("party"..i) or not UnitName("party"..i) then
pfUI.uf.group[i]:SetAlpha(1)
else
pfUI.uf.group[i]:SetAlpha(.25)
end
else
if pfUI.uf.group[i] then
pfUI.uf.group[i]:Hide()
if event == "RAID_TARGET_UPDATE" or event == "PLAYER_ENTERING_WORLD" or event == "PARTY_MEMBERS_CHANGED" then
local raidIcon = GetRaidTargetIndex("party" .. i)
if raidIcon and UnitExists("party" .. i) then
SetRaidTargetIconTexture(pfUI.uf.group[i].hp.raidIcon.texture, raidIcon)
pfUI.uf.group[i].hp.raidIcon:Show()
else
pfUI.uf.group[i].hp.raidIcon:Hide()
end
end
if event == "PARTY_LEADER_CHANGED" or event == "PLAYER_ENTERING_WORLD" or event == "PARTY_MEMBERS_CHANGED" then
if UnitIsPartyLeader("party"..i) then
pfUI.uf.group[i].hp.leaderIcon:Show()
else
pfUI.uf.group[i].hp.leaderIcon:Hide()
end
end
if event == "PARTY_LOOT_METHOD_CHANGED" or event == "PLAYER_ENTERING_WORLD" or event == "PARTY_MEMBERS_CHANGED" then
local _, lootmaster = GetLootMethod()
if lootmaster and pfUI.uf.group[i].id == lootmaster then
pfUI.uf.group[i].hp.lootIcon:Show()
else
pfUI.uf.group[i].hp.lootIcon:Hide()
end
end
if GetNumPartyMembers() >= i then
pfUI.uf.group[i]:Show()
if UnitIsConnected("party"..i) or not UnitName("party"..i) then
pfUI.uf.group[i]:SetAlpha(1)
else
pfUI.uf.group[i]:SetAlpha(.25)
end
else
if pfUI.uf.group[i] then
pfUI.uf.group[i]:Hide()
end
end
end
end