Quantcast
WoWInterface - View Single Post - Taint Classic
Thread: Taint Classic
View Single Post
10-22-19, 01:22 PM   #1
glupikreten
An Aku'mai Servant
Join Date: Apr 2009
Posts: 37
Taint Classic

Can someone please tell me why this script gives error below:

Code:
10x [ADDON_ACTION_BLOCKED] AddOn 'xVerminz' tried to call the protected function 'TargetFrameToT:Show()'.
!BugGrabber\BugGrabber.lua:519: in function <!BugGrabber\BugGrabber.lua:519>
[C]: in function `Show'
FrameXML\TargetFrame.lua:910: in function <FrameXML\TargetFrame.lua:905>
[C]: in function `TargetofTarget_Update'
FrameXML\TargetFrame.lua:420: in function `TargetFrame_OnUpdate'
[string "*:OnUpdate"]:1: in function <[string "*:OnUpdate"]:1>

Locals:
InCombatSkipped
Code:
-------------------------------------------
-- ADD BORDER TO BUFFS AND DEBUFFS ON TARGET FRAME
-------------------------------------------

DebuffTypeColor = { };
DebuffTypeColor["none"]		= { r = 0.80, g = 0, b = 0 };
DebuffTypeColor["Magic"]	= { r = 0.20, g = 0.60, b = 1.00 };
DebuffTypeColor["Curse"]	= { r = 0.60, g = 0.00, b = 1.00 };
DebuffTypeColor["Disease"]	= { r = 0.60, g = 0.40, b = 0 };
DebuffTypeColor["Poison"]	= { r = 0.00, g = 0.60, b = 0 };
DebuffTypeColor[""]			= DebuffTypeColor["none"];

borderBuff = "Interface\\AddOns\\xVerminz\\media\\textureOverlay"
borderDebuff = "Interface\\AddOns\\xVerminz\\media\\textureDebuff"
font = "Interface\\AddOns\\xVerminz\\media\\fontAtari.ttf"

local function SkinTarget()
	if TargetFrame:IsShown() then
		numBuffs = 0
		for i=1, MAX_TARGET_BUFFS do
			if( select(3, UnitBuff("target", i)) ) then
				numBuffs = numBuffs + 1
			end
		end

		numDebuffs = 0
		for i=1, MAX_TARGET_DEBUFFS do
			if( select(3, UnitDebuff("target", i)) ) then
				numDebuffs = numDebuffs + 1
			end
		end
		
		for i=1, numBuffs do
			local frame = _G["TargetFrameBuff"..i]
			local frameBorder = _G["TargetFrameBuff"..i.."Border"];
			local frameCount = _G["TargetFrameBuff"..i.."Count"];
			if (frameBorder~=nil) then frameBorder:Hide() end
			
			if (frameCount~=nil) then
				frameCount:SetFont(font, 10, 'THINOUTLINE')
				frameCount:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 2)
			end

			if (frame~=nil) then
				frame:CreateBeautyBorder(6)
				frame:SetBeautyBorderTexture(borderBuff)
				frame:SetScale(1.3);
			end
		end

		for i=1, numDebuffs do
			local frame = _G["TargetFrameDebuff"..i]
			local frameBorder = _G["TargetFrameDebuff"..i.."Border"];
			local frameCount = _G["TargetFrameDebuff"..i.."Count"];
			if (frameBorder~=nil) then frameBorder:Hide() end

			if (frameCount~=nil) then
				frameCount:SetFont(font, 10, 'THINOUTLINE')
				frameCount:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 2)
			end

			if ( select(4, UnitDebuff("target", i)) ) then
				color = DebuffTypeColor[select(4, UnitDebuff("target", i))];
			else
				color = DebuffTypeColor["none"];
			end

			if (frame~=nil) then
				frame:CreateBeautyBorder(6)
				frame:SetBeautyBorderTexture(borderDebuff)
				frame:SetBeautyBorderColor(color.r, color.g, color.b)
				frame:SetScale(1.3);
			end
		end
	end
end

local function SkinPet()
	if PetFrame:IsShown() then
		numBuffs = 0
		for i=1, MAX_TARGET_BUFFS do
			if( select(3, UnitBuff("pet", i)) ) then
				numBuffs = numBuffs + 1
			end
		end

		numDebuffs = 0
		for i=1, MAX_TARGET_BUFFS do
			if( select(3, UnitDebuff("pet", i)) ) then
				numDebuffs = numDebuffs + 1
			end
		end
		
		for i=1, numBuffs do
			local frame = _G["PetFrameBuff"..i]
			local frameBorder = _G["PetFrameBuff"..i.."Border"];
			local frameCount = _G["PetFrameBuff"..i.."Count"];
			if (frameBorder~=nil) then frameBorder:Hide() end
			
			if (frameCount~=nil) then
				frameCount:SetFont(font, 10, 'THINOUTLINE')
				frameCount:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 2)
			end

			if (frame~=nil) then
				frame:CreateBeautyBorder(4)
				frame:SetBeautyBorderTexture(borderBuff)
			end
		end

		for i=1, numDebuffs do
			local frame = _G["PetFrameDebuff"..i]
			local frameBorder = _G["PetFrameDebuff"..i.."Border"];
			local frameCount = _G["PetFrameBuff"..i.."Count"];
			if (frameBorder~=nil) then frameBorder:Hide() end
			
			if (frameCount~=nil) then
				frameCount:SetFont(font, 10, 'THINOUTLINE')
				frameCount:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 2)
			end

			if ( select(4, UnitDebuff("pet", i)) ) then
				color = DebuffTypeColor[select(4, UnitDebuff("target", i))];
			else
				color = DebuffTypeColor["none"];
			end

			if (frame~=nil) then
				frame:CreateBeautyBorder(4)
				frame:SetBeautyBorderTexture(borderDebuff)
				frame:SetBeautyBorderColor(color.r, color.g, color.b)
			end
		end
	end
end

local function SkinFocus()
	-- if FocusFrame:IsShown() then
	-- 	numDebuffs = 0
	-- 	for i=1, MAX_FOCUS_DEBUFFS do
	-- 		if( select(3, UnitDebuff("focus", i)) ) then
	-- 			numDebuffs = numDebuffs + 1
	-- 		end
	-- 	end
	
	-- 	for i=1, numDebuffs do
	-- 		local frame = _G["FocusFrameDebuff"..i]
	-- 		-- frame:Hide()
	-- 		frame:SetScale(1.2);
	-- 		frame:CreateBeautyBorder(4)
	--   	end
	-- end
end

hooksecurefunc("TargetFrame_UpdateAuras", SkinTarget)
hooksecurefunc("PlayerFrame_Update", SkinPet)
  Reply With Quote