Having issues with secure handling, i got things to work so far as far as hiding the raid frames based on the blizz options and it being done securely so there is no taint. A few issues though... when you zone the party frames show up again, and when the frames are hidden and you leave a raid they stay hidden until i /reload. Im sure something can be added to what i have fix this.. here is what i have... anyone have any ideas?
lua Code:
local RaidPartyHandler = CreateFrame("Frame", "RaidPartyHandler", UIParent, "SecureHandlerStateTemplate");
SecureHandler_OnLoad(RaidPartyHandler);
GrimUI.RaidPartyHandler = RaidPartyHandler
GrimPartyMain = CreateFrame("Frame", nil, RaidPartyHandler);
GrimUI.GrimPartyMain = GrimPartyMain
RaidPartyHandler:SetFrameRef("GrimPartyMain", GrimPartyMain);
RaidPartyHandler:Execute([[
GrimPartyMain = self:GetFrameRef("GrimPartyMain");
]]);
RaidPartyHandler:Execute("raidhideparty = " .. tostring(GetCVar("hidePartyInRaid"))); -- hook to Blizzard option for party raid hide frames
RaidPartyHandler:SetAttribute("_onstate-unitexists", [[
if raidhideparty == 1 and newstate then
GrimPartyMain:Hide()
end
if raidhideparty ~= 1 and newstate then
GrimPartyMain:Show()
end
]]);
RaidPartyHandler:SetAttribute("unit", "raid1");
RegisterUnitWatch(RaidPartyHandler, true);
RaidPartyHandler:SetAttribute("state-unitexists", UnitExists("raid1"));