The problem you had with the party frames not reshowing was due to a logic error:
lua Code:
RaidPartyHandler:SetAttribute("_onstate-unitexists", [[
if raidhideparty == 1 and newstate then
GrimPartyMain:Hide()
end
if raidhideparty ~= 1 and newstate then
GrimPartyMain:Show()
end
]]);
Should be:
lua Code:
RaidPartyHandler:SetAttribute("_onstate-unitexists", [[
if raidhideparty == 1 and newstate then
GrimPartyMain:Hide()
else
GrimPartyMain:Show()
end
]]);
If you want to use the other method I posted just now, then you only need to create 'GrimPartyMain' and then use this to apply the user setting:
lua Code:
if GetCVarBool("hidePartyInRaid") then
RegisterStateDriver(GrimPartyMain, "visibility", "[@raid1,exists]hide;show");
else
UnregisterStateDriver(GrimPartyMain, "visibility");
GrimPartyMain:Show();
end
As for the arena problem, the reason the party frames are hiding is because when you are in an arena you really are in a raid, so there's really no bug occurring there. If you wish the party frames to remain shown you need to force the hiding behavior off when entering an arena instance and reapply the user setting when leaving; try watching for PLAYER_ENTERING_WORLD and grab instance type with
IsInInstance().