Lua Code:
local _,class = UnitClass('player')
local xoffset, yoffset = 8,0
local function createBar(bid,id)
local f = CreateFrame("Frame", "zzABar"..bid, UIParent, "SecureHandlerStateTemplate",id)
f:SetWidth(1)
f:SetHeight(1)
f:SetPoint("CENTER")
f:SetAttribute('_onstate-page', [[
print(newstate)
self:SetAttribute('actionpage', newstate)
control:ChildUpdate('actionpage', newstate)
]])
if(class == "WARRIOR") then
print("war")
RegisterStateDriver(f, "page", "[bonusbar:1] 7;[bonusbar:2] 8;[bonusbar:3] 9;1")
end
local lastbutton = f
for i = 1, 12 do
local b = CreateFrame("CheckButton", "$PARENTActionButton"..i, f, "SecureActionButtonTemplate ActionButtonTemplate",i)
b:SetWidth(32)
b:SetHeight(32)
b:SetPoint("TOPLEFT", lastbutton, "TOPRIGHT", xoffset, yoffset)
lastbutton = b
ActionButton_OnLoad(b)
b:SetAttribute('action--base',i)
b:SetAttribute('showgrid', 1)
b:SetAttribute('_childupdate-actionpage', [[
local offset = (message -1) * 12 + self:GetAttribute('action--base')
self:SetAttribute('action', self:GetAttribute('action--base'))
print(message, offset, self:GetAttribute('action--base'))
]])
b:SetScript("OnAttributeChanged",ActionButton_UpdateAction)
b:SetAttribute('action', i)
end
end
I try to have a bar that switches automaticly. The code above works but I get taints over and over.
Code:
4/30 18:55:05.677 An action was blocked in combat because of taint from zz_Actionbuttons - zzABar1ActionButton1:Show()
4/30 18:55:05.677 Interface\FrameXML\ActionButton.lua:246 ActionButton_Update()
4/30 18:55:05.677 Interface\FrameXML\ActionButton.lua:484 ActionButton_OnEvent()
4/30 18:55:05.677 Interface\FrameXML\ActionButton.lua:105
But I have no clue what I should do to make my code secure.
Someone got an easy example how this works ? Looked at BT and Dominos but thats a little above my skills