mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-17 10:10:50 +00:00
group: refine some events for performance
This commit is contained in:
+32
-25
@@ -13,18 +13,16 @@ pfUI:RegisterModule("group", function ()
|
|||||||
pfUI.uf.group = CreateFrame("Button","pfGroup",UIParent)
|
pfUI.uf.group = CreateFrame("Button","pfGroup",UIParent)
|
||||||
pfUI.uf.group:Hide()
|
pfUI.uf.group:Hide()
|
||||||
|
|
||||||
pfUI.uf.group:RegisterEvent("PARTY_MEMBERS_CHANGED")
|
pfUI.uf.group:RegisterEvent("RAID_TARGET_UPDATE")
|
||||||
pfUI.uf.group:RegisterEvent("PARTY_LEADER_CHANGED")
|
pfUI.uf.group:RegisterEvent("PARTY_LEADER_CHANGED")
|
||||||
|
pfUI.uf.group:RegisterEvent("PARTY_LOOT_METHOD_CHANGED")
|
||||||
|
|
||||||
|
pfUI.uf.group:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
|
pfUI.uf.group:RegisterEvent("PARTY_MEMBERS_CHANGED")
|
||||||
pfUI.uf.group:RegisterEvent("PARTY_MEMBER_ENABLE")
|
pfUI.uf.group:RegisterEvent("PARTY_MEMBER_ENABLE")
|
||||||
pfUI.uf.group:RegisterEvent("PARTY_MEMBER_DISABLE")
|
pfUI.uf.group:RegisterEvent("PARTY_MEMBER_DISABLE")
|
||||||
pfUI.uf.group:RegisterEvent("PARTY_LOOT_METHOD_CHANGED")
|
|
||||||
pfUI.uf.group:RegisterEvent("UNIT_FACTION")
|
|
||||||
pfUI.uf.group:RegisterEvent("UNIT_AURA")
|
|
||||||
pfUI.uf.group:RegisterEvent("UNIT_PET")
|
|
||||||
pfUI.uf.group:RegisterEvent("VARIABLES_LOADED")
|
|
||||||
pfUI.uf.group:RegisterEvent("RAID_ROSTER_UPDATE")
|
pfUI.uf.group:RegisterEvent("RAID_ROSTER_UPDATE")
|
||||||
pfUI.uf.group:RegisterEvent("GROUP_ROSTER_UPDATE")
|
pfUI.uf.group:RegisterEvent("GROUP_ROSTER_UPDATE")
|
||||||
pfUI.uf.group:RegisterEvent("RAID_TARGET_UPDATE")
|
|
||||||
|
|
||||||
pfUI.uf.group:SetScript("OnEvent", function()
|
pfUI.uf.group:SetScript("OnEvent", function()
|
||||||
PartyMemberBackground:Hide()
|
PartyMemberBackground:Hide()
|
||||||
@@ -35,6 +33,33 @@ pfUI:RegisterModule("group", function ()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if event == "RAID_TARGET_UPDATE" or event == "PLAYER_ENTERING_WORLD" then
|
||||||
|
local raidIcon = GetRaidTargetIndex("party" .. i)
|
||||||
|
if raidIcon 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" 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" 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
|
if GetNumPartyMembers() >= i then
|
||||||
pfUI.uf.group[i]:Show()
|
pfUI.uf.group[i]:Show()
|
||||||
if UnitIsConnected("party"..i) or not UnitName("party"..i) then
|
if UnitIsConnected("party"..i) or not UnitName("party"..i) then
|
||||||
@@ -42,24 +67,6 @@ pfUI:RegisterModule("group", function ()
|
|||||||
else
|
else
|
||||||
pfUI.uf.group[i]:SetAlpha(.25)
|
pfUI.uf.group[i]:SetAlpha(.25)
|
||||||
end
|
end
|
||||||
|
|
||||||
local raidIcon = GetRaidTargetIndex("party" .. i)
|
|
||||||
if raidIcon then
|
|
||||||
SetRaidTargetIconTexture(pfUI.uf.group[i].hp.raidIcon.texture, raidIcon)
|
|
||||||
pfUI.uf.group[i].hp.raidIcon:Show()
|
|
||||||
end
|
|
||||||
if UnitIsPartyLeader("party"..i) then
|
|
||||||
pfUI.uf.group[i].hp.leaderIcon:Show()
|
|
||||||
else
|
|
||||||
pfUI.uf.group[i].hp.leaderIcon:Hide()
|
|
||||||
end
|
|
||||||
|
|
||||||
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
|
|
||||||
else
|
else
|
||||||
if pfUI.uf.group[i] then
|
if pfUI.uf.group[i] then
|
||||||
pfUI.uf.group[i]:Hide()
|
pfUI.uf.group[i]:Hide()
|
||||||
|
|||||||
Reference in New Issue
Block a user