Originally Posted by Layback_
Hi kurapica.iga,
Thank you for your advice
What about the borders for debuffs?
As you know some debuffs have a different border colors based on their types (like red or blue).
Would this be considered on BuffButton_OnLoad or SetTexture functions?
|
Well, I make some problem, write it again :
Lua Code:
local original_SetVertexColor -- Keep a copy so it won't trigger the hook again
hooksecurefunc("BuffButton_OnLoad", function(self)
-- the self is aura button
-- For cut icon
local icon = _G[self:GetName() .. "Icon"] -- miss this
hooksecurefunc(icon, "SetTexture", function(self, path)
if path then
-- Cut the icon
self:SetTexCoord(0.06, 0.94, 0.06, 0.94)
end
end)
-- For the debuff border color
local debuffSlot = _G[self:GetName().."Border"]
if not original_SetVertexColor then original_SetVertexColor = debuffSlot.SetVertexColor end
hooksecurefunc(debuffSlot, "SetVertexColor", function(self, r, g, b)
-- You can only use original_SetVertexColor to change border color
-- debuffSlot:SetVertexColor(1, 0, 0) wrong, it'll cause Infinite loop
original_SetVertexColor(debuffSlot, 1, 0, 0) -- that's okay
end)
-- do other skin job
end)
Don't try to replace the methods directly, it'll cause taint error.