WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Taint Classic (https://www.wowinterface.com/forums/showthread.php?t=57628)

glupikreten 10-22-19 01:22 PM

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)


myrroddin 10-22-19 01:56 PM

I see at least 4 variables that are not local.
  1. DebuffTypeColor
  2. borderBuff
  3. numBuffs
  4. color

Run your code through this application: https://www.wowinterface.com/downloa...OTANADDON.html

Kanegasi 10-22-19 03:58 PM

What you're doing to DebuffTypeColor is causing the taint. That is Blizzard's table and the very first line of your code is basically deleting it. Changing the values could also taint it. An example of this is the blue shaman addon, which touches the RAID_CLASS_COLORS table, which taints all the raid frames.

glupikreten 10-23-19 05:08 AM

Thank you ...

I just have no explanation why i left half of them not local :(... except i am noob obviously.


All times are GMT -6. The time now is 12:26 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI