From 04c32134924939aa00c718ccd8060683316f69c6 Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 24 Mar 2020 17:07:49 +0100 Subject: [PATCH] raid: use regular unitframe visibility function --- modules/raid.lua | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/modules/raid.lua b/modules/raid.lua index 3d402c34..b6ba50d2 100644 --- a/modules/raid.lua +++ b/modules/raid.lua @@ -40,15 +40,8 @@ pfUI:RegisterModule("raid", "vanilla:tbc", function () local function SetRaidIndex(frame, id) frame.id = id frame.label = "raid" - - if frame.SetAttribute and RegisterStateDriver then - frame:SetAttribute("unit", UnitName("raid" .. id)) - frame.visibilitycondition = string.format("[target=%s,exists] show; hide", id > 0 and UnitName("raid" .. id) or "__NONE__") - RegisterStateDriver(frame, 'visibility', frame.visibilitycondition) - else - if id > 0 then frame:Show() else frame:Hide() end - pfUI.uf:RefreshUnit(frame, "all") - end + frame:UpdateVisibility() + pfUI.uf:RefreshUnit(frame, "all") end -- add units to the beginning of their groups