Got the error to stop.
Had to switch the code up a little.
From this:
Lua Code:
local petButtons = { "PetActionButton", "PossessButton", "ShapeshiftButton" }
hooksecurefunc("PetActionBar_Update", function()
for i = 1, #petButtons do
for j = 1, 12 do
local button = _G[petButtons[i]..j]
button:SetNormalTexture("Interface\\BUTTONS\\UI-Quickslot2")
AddRegionKeys(button)
local icon = button.icon
icon:SetTexCoord(.05, .95, .05, .95)
icon:ClearAllPoints()
icon:SetPoint("TOPLEFT", -1, 1)
icon:SetPoint("BOTTOMRIGHT", 1, -1)
local normalTexture = button.__normalTexture2 or button.__normalTexture
normalTexture:ClearAllPoints()
normalTexture:SetPoint("TOPLEFT", -15, 15)
normalTexture:SetPoint("BOTTOMRIGHT",15, -15)
ColorButton(normalTexture)
end
end
end)
To this:
Lua Code:
hooksecurefunc("PetActionBar_Update", function()
for i = 1, NUM_PET_ACTION_SLOTS, 1 do
local buttonName = _G["PetActionButton"..i]
if buttonName then
buttonName:SetNormalTexture("Interface\\BUTTONS\\UI-Quickslot2")
local iconName = _G["PetActionButton"..i.."Icon"];
iconName:SetTexCoord(.05, .95, .05, .95);
iconName:SetPoint("TOPLEFT", buttonName, -1, 1);
iconName:SetPoint("BOTTOMRIGHT", buttonName, 1, -1);
local buttonOutline = _G["PetActionButton"..i.."NormalTexture2"] or _G["PetActionButton"..i.."NormalTexture"]
buttonOutline:ClearAllPoints()
buttonOutline:SetPoint("TOPLEFT", buttonName, -15, 15)
buttonOutline:SetPoint("BOTTOMRIGHT", buttonName, 15, -15)
if db.misc.classcolor ~= true then
buttonOutline:SetVertexColor(db.actionbars.color.r, db.actionbars.color.g, db.actionbars.color.b)
else
buttonOutline:SetVertexColor((classColor.r * 1.2), (classColor.g * 1.2), (classColor.b * 1.2))
end
end
end
end);
hooksecurefunc("PossessBar_UpdateState", function()
for i = 1, NUM_POSSESS_SLOTS do
local buttonName = _G["PossessButton"..i]
if buttonName then
buttonName:SetNormalTexture("Interface\\BUTTONS\\UI-Quickslot2")
local iconName = _G["PossessButton"..i.."Icon"];
iconName:SetTexCoord(.05, .95, .05, .95);
iconName:SetPoint("TOPLEFT", buttonName, -1, 1);
iconName:SetPoint("BOTTOMRIGHT", buttonName, 1, -1);
local buttonOutline = _G["PossessButton"..i.."NormalTexture2"] or _G["PossessButton"..i.."NormalTexture"]
buttonOutline:ClearAllPoints()
buttonOutline:SetPoint("TOPLEFT", buttonName, -15, 15)
buttonOutline:SetPoint("BOTTOMRIGHT", buttonName, 15, -15)
if db.misc.classcolor ~= true then
buttonOutline:SetVertexColor(db.actionbars.color.r, db.actionbars.color.g, db.actionbars.color.b)
else
buttonOutline:SetVertexColor((classColor.r * 1.2), (classColor.g * 1.2), (classColor.b * 1.2))
end
end
end
end);
hooksecurefunc("StanceBar_UpdateState", function()
for i = 1, NUM_STANCE_SLOTS do
local buttonName = _G["StanceButton"..i]
if buttonName then
buttonName:SetNormalTexture("Interface\\BUTTONS\\UI-Quickslot2")
local iconName = _G["StanceButton"..i.."Icon"];
iconName:SetTexCoord(.05, .95, .05, .95);
iconName:SetPoint("TOPLEFT", buttonName, -1, 1);
iconName:SetPoint("BOTTOMRIGHT", buttonName, 1, -1);
local buttonOutline = _G["StanceButton"..i.."NormalTexture2"] or _G["StanceButton"..i.."NormalTexture"]
buttonOutline:ClearAllPoints()
buttonOutline:SetPoint("TOPLEFT", buttonName, -15, 15)
buttonOutline:SetPoint("BOTTOMRIGHT", buttonName, 15, -15)
if db.misc.classcolor ~= true then
buttonOutline:SetVertexColor(db.actionbars.color.r, db.actionbars.color.g, db.actionbars.color.b)
else
buttonOutline:SetVertexColor((classColor.r * 1.2), (classColor.g * 1.2), (classColor.b * 1.2))
end
end
end
end);
I'm sure its not as efficant as Phanx's code but this way I do not get errors (yet) also not sure why but the petstancebutton needs for i=1, NUM_SLOTS
, 1 do which the other 2 do not, and the ShapeshiftButton needed to be switched to StanceButton.
Coke