So i have a taint issue. After going into a pet battle my target frame becomes tainted and any time i change targets in combat after a petbattle it fires taint errors. The problem is with the new FrameLocks.lua
my code hides and locks out the original bliz targetframe. This new framelocks.lua does this...
Lua Code:
----------Local helper functions---------------
local function initiateFrame(frame)
local frameName = frame:GetName();
if ( not frameName or frameName == "" ) then
GMError("Frames controlled by FrameLocks must have names.");
end
if ( BASE_STATES[frameName] ) then
return;
end
BASE_STATES[frameName] = frame:IsShown() and "shown" or "hidden";
assert(frame.originalShow ~= frame.Show); --Make sure we didn't already set up this frame.
frame.originalShow = frame.Show;
frame.originalHide = frame.Hide;
frame.Show = SmartShow;
frame.Hide = SmartHide;
end
local function updateFrameByState(frame)
initiateFrame(frame);
local frameName = frame:GetName();
if ( not frameName or frameName == "" ) then
GMError("Frames controlled by FrameLocks must have names.");
end
for i=1, #FRAMELOCK_STATE_PRIORITIES do
local lock = FRAMELOCK_STATE_PRIORITIES[i];
if ( ACTIVE_FRAMELOCKS[lock] ) then
local desiredState = FRAMELOCK_STATES[lock][frameName];
if ( desiredState == "hidden" ) then
frame:originalHide();
return;
elseif ( desiredState == "shown" ) then
frame:originalShow();
return;
end
end
end
--If we got to here, no lock is in place, so use the base state.
if ( BASE_STATES[frameName] == "shown" ) then
frame:originalShow();
else
frame:originalHide();
end
end
I think the taint is created because my addon cancels the orignal hide and show functions via
Lua Code:
function addon:HideFrame(reference)
local frame = type(reference) == 'string' and _G[reference] or reference
if type(frame) ~= 'table' then return end
frame.Show = DoNothing
frame:Hide()
end
and this is the actual hiding of it...
Lua Code:
--[[-----------------------------------------------------------------------------
Configure Bliz Target Frame
-------------------------------------------------------------------------------]]
function addon:ConfigureBlizTargetFrame()
if addon.settings.hideBlizTargetFrame then
addon:HideFrame('TargetFrame') -- come back to this and put in unregisters but watch out for buffs :)
else
TargetFrame.Show = TargetFrame:Show()
TargetFrame:RegisterEvent("PLAYER_TARGET_CHANGED")
TargetFrame:RegisterEvent("UNIT_HEALTH")
TargetFrame:RegisterEvent("UNIT_LEVEL")
TargetFrame:RegisterEvent("UNIT_FACTION")
TargetFrame:RegisterEvent("UNIT_CLASSIFICATION_CHANGED")
TargetFrame:RegisterEvent("UNIT_AURA")
TargetFrame:RegisterEvent("PLAYER_FLAGS_CHANGED")
TargetFrame:RegisterEvent("PLAYER_FOCUS_CHANGED")
if UnitExists("target") then TargetFrame:Show() end
end
end
addon.RegisterEvent("TargetFrame-Prime", 'PLAYER_LOGIN', function(self, event)
addon.UnregisterEvent(self, event)
addon:ConfigureBlizTargetFrame()
end)
Any ideas for turning the framelock.lua off?