I want to be able to hide the default Blizzard PlayerFrame and TargetFrame, and everything associated with it (combo points, runes and stuff like that -don't know if theres more than this).
Following piece of code does the trick to both show and hide the PlayerFrame and TargetFrame, but stuff like combo points and runes are still visible on the screen when the player and target frame is hidden.
--show or hide blizzard default PlayerFrame and TargetFrame
if _G.SimpleHUD_savedVars["Blizzard_PlayerFrame_visible"] then
if not PlayerFrame:IsVisible() then
PlayerFrame:SetScript("OnEvent", PlayerFrame_OnEvent);
PlayerFrame:Show();
TargetFrame:SetScript("OnEvent", TargetFrame_OnEvent);
TargetFrame:Show();
end
else
PlayerFrame:SetScript("OnEvent", nil);
PlayerFrame:Hide();
TargetFrame:SetScript("OnEvent", nil);
TargetFrame:Hide();
end
What should I add to make sure anything associated disappears when hiding the frames, and also important, -comes back fully functional when the frames should be shown?
There are dozens of addons that hide those things, both dedicated "hide Blizzard frames" addons and most unit frame addons. Have you looked at any of them to see what they are doing that you aren't?
local function Toggle(frame, hide)
if hide then
frame:SetAttribute("unit", frame.unit);
RegisterUnitWatch(frame);
else
frame:SetAttribute("unit", nil);
RegisterUnitWatch(frame);
frame:Hide();
end
end
local function Blizzard_PlayerFrame_visible(enable)
_G.SimpleHUD_savedVars["Blizzard_PlayerFrame_visible"] = enable or nil
Toggle(TargetFrame, enable)
Toggle(PlayerFrames, enable)
end
local f = CreateFrame("CheckButton", "TargetFrameTestToggle", UIParent, "InterfaceOptionsCheckButtonTemplate")
_G[f:GetName() .. 'Text']:SetText("Hide Default Frames")
f:SetPoint("CENTER")
f:SetChecked(_G.SimpleHUD_savedVars["Blizzard_PlayerFrame_visible"])
f:SetScript("OnClick", function(self) Blizzard_PlayerFrame_visible(self:GetChecked()) end)
This is en ample built using your variable... It should work.
I want to be able to hide the default Blizzard PlayerFrame and TargetFrame, and everything associated with it (combo points, runes and stuff like that -don't know if theres more than this).
Following piece of code does the trick to both show and hide the PlayerFrame and TargetFrame, but stuff like combo points and runes are still visible on the screen when the player and target frame is hidden.
What should I add to make sure anything associated disappears when hiding the frames, and also important, -comes back fully functional when the frames should be shown?
This is en ample built using your variable... It should work.