mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 05:50:50 +00:00
unitframes: skip events on uninitialized frames
This commit is contained in:
+14
-12
@@ -715,6 +715,20 @@ function pfUI.uf.OnShow()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function pfUI.uf.OnEvent()
|
function pfUI.uf.OnEvent()
|
||||||
|
-- update indicators
|
||||||
|
if event == "PARTY_LEADER_CHANGED" or
|
||||||
|
event == "PARTY_LOOT_METHOD_CHANGED" or
|
||||||
|
event == "PARTY_MEMBERS_CHANGED" or
|
||||||
|
event == "RAID_TARGET_UPDATE" or
|
||||||
|
event == "RAID_ROSTER_UPDATE" or
|
||||||
|
event == "PLAYER_UPDATE_RESTING"
|
||||||
|
then
|
||||||
|
pfUI.uf:RefreshIndicators(this)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- abort on broken unitframes (e.g focus)
|
||||||
|
if not this.label then return end
|
||||||
|
|
||||||
-- update regular frames
|
-- update regular frames
|
||||||
if event == "PLAYER_ENTERING_WORLD" then
|
if event == "PLAYER_ENTERING_WORLD" then
|
||||||
pfUI.uf:RefreshUnit(this, "all")
|
pfUI.uf:RefreshUnit(this, "all")
|
||||||
@@ -734,7 +748,6 @@ function pfUI.uf.OnEvent()
|
|||||||
pfUI.uf:RefreshUnit(this, "all")
|
pfUI.uf:RefreshUnit(this, "all")
|
||||||
elseif this.label == "pet" and event == "UNIT_HAPPINESS" then
|
elseif this.label == "pet" and event == "UNIT_HAPPINESS" then
|
||||||
pfUI.uf:RefreshUnit(this)
|
pfUI.uf:RefreshUnit(this)
|
||||||
|
|
||||||
-- UNIT_XXX Events
|
-- UNIT_XXX Events
|
||||||
elseif arg1 and arg1 == this.label .. this.id then
|
elseif arg1 and arg1 == this.label .. this.id then
|
||||||
if event == "UNIT_PORTRAIT_UPDATE" or event == "UNIT_MODEL_CHANGED" then
|
if event == "UNIT_PORTRAIT_UPDATE" or event == "UNIT_MODEL_CHANGED" then
|
||||||
@@ -749,17 +762,6 @@ function pfUI.uf.OnEvent()
|
|||||||
pfUI.uf:RefreshUnit(this)
|
pfUI.uf:RefreshUnit(this)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- update indicators
|
|
||||||
if event == "PARTY_LEADER_CHANGED" or
|
|
||||||
event == "PARTY_LOOT_METHOD_CHANGED" or
|
|
||||||
event == "PARTY_MEMBERS_CHANGED" or
|
|
||||||
event == "RAID_TARGET_UPDATE" or
|
|
||||||
event == "RAID_ROSTER_UPDATE" or
|
|
||||||
event == "PLAYER_UPDATE_RESTING"
|
|
||||||
then
|
|
||||||
pfUI.uf:RefreshIndicators(this)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function pfUI.uf.OnUpdate()
|
function pfUI.uf.OnUpdate()
|
||||||
|
|||||||
Reference in New Issue
Block a user