Commit 1a62c760 authored by Ivaria's avatar Ivaria
Browse files

Fixed hiding of standard Blizzard UI frames (e.g. party, raid)

parent c1ac90fc
......@@ -393,11 +393,47 @@ local VUHDO_FIX_EVENTS = {
--
local sEventsPerFrame = {};
local sFrameHideParents = {};
local sFrameOrigParents = {};
--
local function VUHDO_hideFrame(aFrame)
if not sFrameHideParents[aFrame:GetName()] then
local tFrameParent = CreateFrame("Frame");
tFrameParent:Hide();
sFrameHideParents[aFrame:GetName()] = tFrameParent;
end
if not sFrameOrigParents[aFrame:GetName()] then
sFrameOrigParents[aFrame:GetName()] = aFrame:GetParent();
aFrame:SetParent(sFrameHideParents[aFrame:GetName()]);
end
end
--
local function VUHDO_showFrame(aFrame)
if sFrameOrigParents[aFrame:GetName()] then
aFrame:SetParent(sFrameOrigParents[aFrame:GetName()]);
aFrame:Show();
sFrameOrigParents[aFrame:GetName()] = nil;
end
end
--
local function VUHDO_unregisterAndSaveEvents(anIsHide, ...)
local tFrame;
for tCnt = 1, select('#', ...) do
......@@ -416,15 +452,16 @@ local function VUHDO_unregisterAndSaveEvents(anIsHide, ...)
end
tFrame:UnregisterAllEvents();
if anIsHide then tFrame:Hide(); end
if anIsHide then
VUHDO_hideFrame(tFrame);
end
end
end
end
--
local function VUHDO_registerOriginalEvents(anIsShow, ...)
local tFrame;
......@@ -444,7 +481,9 @@ local function VUHDO_registerOriginalEvents(anIsShow, ...)
tFrame:RegisterAllEvents();
end
if anIsShow then tFrame:Show(); end
if anIsShow then
VUHDO_showFrame(tFrame);
end
end
end
end
......@@ -495,7 +534,7 @@ local function VUHDO_hideBlizzParty()
function()
if not InCombatLockdown() then
for tCnt = 1, 4 do
_G["PartyMemberFrame" .. tCnt]:Hide();
VUHDO_hideFrame(_G["PartyMemberFrame" .. tCnt]);
end
end
end
......@@ -507,7 +546,7 @@ local function VUHDO_hideBlizzParty()
VUHDO_unregisterAndSaveEvents(false,
tPartyFrame, _G["PartyMemberFrame" .. tCnt .. "HealthBar"], _G["PartyMemberFrame" .. tCnt .. "ManaBar"]
);
tPartyFrame:Hide();
VUHDO_hideFrame(tPartyFrame);
end
if (CompactPartyFrame ~= nil and CompactPartyFrame:IsVisible()) then
......@@ -528,7 +567,7 @@ local function VUHDO_showBlizzParty()
function()
if not InCombatLockdown() then
for tCnt = 1, 4 do
_G["PartyMemberFrame" .. tCnt]:Show();
VUHDO_showFrame(_G["PartyMemberFrame" .. tCnt]);
end
end
end
......@@ -541,7 +580,7 @@ local function VUHDO_showBlizzParty()
tPartyFrame, _G["PartyMemberFrame" .. tCnt .. "HealthBar"], _G["PartyMemberFrame" .. tCnt .. "ManaBar"]);
if (UnitExists("party" .. tCnt)) then
tPartyFrame:Show();
VUHDO_showFrame(tPartyFrame);
end
end
else
......@@ -562,10 +601,9 @@ end
--
local function VUHDO_showBlizzPlayer()
VUHDO_registerOriginalEvents(false, PlayerFrame, PlayerFrameHealthBar, PlayerFrameManaBar);
PlayerFrame:Show();
VUHDO_showFrame(PlayerFrame);
if "DEATHKNIGHT" == VUHDO_PLAYER_CLASS then
VUHDO_registerOriginalEvents(RuneFrame);
RuneFrame:Show();
VUHDO_registerOriginalEvents(true, RuneFrame);
end
end
......@@ -582,7 +620,8 @@ end
--
local function VUHDO_showBlizzTarget()
VUHDO_registerOriginalEvents(false, TargetFrame, TargetFrameHealthBar, TargetFrameManaBar, TargetFrameToT, FocusFrameToT);
VUHDO_registerOriginalEvents(true, TargetFrame, TargetFrameToT, FocusFrameToT);
VUHDO_registerOriginalEvents(false, TargetFrameHealthBar, TargetFrameManaBar);
ComboFrame:SetPoint("TOPRIGHT", "TargetFrame", "TOPRIGHT", -44, -9);
end
......@@ -610,7 +649,7 @@ end
--
local function VUHDO_showBlizzFocus()
VUHDO_registerOriginalEvents(false, FocusFrame);
VUHDO_registerOriginalEvents(true, FocusFrame);
end
......
......@@ -10,6 +10,7 @@ Known issues:
Bugfixes:
-- Fixed hiding of standard Blizzard UI frames (e.g. party, raid)
Improvements:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment