mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-24 13:00:50 +00:00
unitframes: ignore non existing partypet events
This commit is contained in:
+9
-6
@@ -842,19 +842,22 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
|
|
||||||
-- hide and return early on unused frames
|
-- hide and return early on unused frames
|
||||||
if not ( pfUI.unlock and pfUI.unlock:IsShown() ) then
|
if not ( pfUI.unlock and pfUI.unlock:IsShown() ) then
|
||||||
-- check existing units or focus frames
|
|
||||||
if unit.unitname and unit.unitname ~= "focus" then
|
if unit.unitname and unit.unitname ~= "focus" then
|
||||||
|
--keep focus and named frames visible
|
||||||
unit:Show()
|
unit:Show()
|
||||||
elseif UnitName(unit.label .. unit.id) then
|
elseif UnitExists(unit.label .. unit.id) then
|
||||||
-- hide group while in raid and option is set
|
-- hide group while in raid and option is set
|
||||||
if pfUI_config["unitframes"]["group"]["hide_in_raid"] == "1" and strsub(unit.label,0,5) == "party" and UnitInRaid("player") then
|
if pfUI_config["unitframes"]["group"]["hide_in_raid"] == "1" and strsub(unit.label,0,5) == "party" and UnitInRaid("player") then
|
||||||
unit:Hide()
|
unit:Hide()
|
||||||
return
|
return
|
||||||
|
|
||||||
-- hide existing but too far away pet
|
-- hide existing but too far away pet and pets of old group members
|
||||||
elseif strsub(unit.label,0,8) == "partypet" and not UnitIsVisible(unit.label .. unit.id) then
|
elseif unit.label == "partypet" then
|
||||||
unit:Hide()
|
if not UnitIsVisible(unit.label .. unit.id) or not UnitExists("party" .. unit.id) then
|
||||||
return
|
unit:Hide()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-- hide self in group if solo or hide in raid is set
|
-- hide self in group if solo or hide in raid is set
|
||||||
elseif unit.fname == "Group0" or unit.fname == "PartyPet0" or unit.fname == "Party0Target" then
|
elseif unit.fname == "Group0" or unit.fname == "PartyPet0" or unit.fname == "Party0Target" then
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ pfUI:RegisterModule("group", function ()
|
|||||||
pfUI.uf.groupscanner:SetScript("OnUpdate", function()
|
pfUI.uf.groupscanner:SetScript("OnUpdate", function()
|
||||||
if ( this.limit or 1) > GetTime() then return else this.limit = GetTime() + .2 end
|
if ( this.limit or 1) > GetTime() then return else this.limit = GetTime() + .2 end
|
||||||
for i=1, 4 do
|
for i=1, 4 do
|
||||||
if UnitExists("party" .. i .. "target") or (pfUI.unlock and pfUI.unlock:IsShown()) then
|
if (UnitExists("party" .. i) and UnitExists("party" .. i .. "target")) or (pfUI.unlock and pfUI.unlock:IsShown()) then
|
||||||
pfUI.uf.group[i].target:Show()
|
pfUI.uf.group[i].target:Show()
|
||||||
else
|
else
|
||||||
pfUI.uf.group[i].target:Hide()
|
pfUI.uf.group[i].target:Hide()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
## Title: |cff33ffccpf|cffffffffUI
|
## Title: |cff33ffccpf|cffffffffUI
|
||||||
## Author: Shagu
|
## Author: Shagu
|
||||||
## Notes: A complete user interface replacement.
|
## Notes: A complete user interface replacement.
|
||||||
## Version: 3.8.4
|
## Version: 3.8.5
|
||||||
## SavedVariables: pfUI_profiles, pfUI_gold
|
## SavedVariables: pfUI_profiles, pfUI_gold
|
||||||
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB
|
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user