From ee99a9d36732178121283126409bcf3c41897fe1 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 1 Jan 2017 15:50:06 +0100 Subject: [PATCH] group: reliably hide group members --- modules/group.lua | 77 +++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/modules/group.lua b/modules/group.lua index a01c46b3..bd60ad08 100644 --- a/modules/group.lua +++ b/modules/group.lua @@ -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