Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-30-12, 11:11 AM   #1
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
secure actionbutton taints again :(

Lua Code:
  1. local _,class = UnitClass('player')
  2. local xoffset, yoffset = 8,0
  3.  
  4. local function createBar(bid,id)
  5.     local f = CreateFrame("Frame", "zzABar"..bid, UIParent, "SecureHandlerStateTemplate",id)
  6.     f:SetWidth(1)
  7.     f:SetHeight(1)
  8.     f:SetPoint("CENTER")
  9.     f:SetAttribute('_onstate-page', [[
  10.         print(newstate)
  11.         self:SetAttribute('actionpage', newstate)
  12.         control:ChildUpdate('actionpage', newstate)
  13.     ]])
  14.     if(class == "WARRIOR") then
  15.         print("war")
  16.         RegisterStateDriver(f, "page", "[bonusbar:1] 7;[bonusbar:2] 8;[bonusbar:3] 9;1")
  17.     end
  18.    
  19.     local lastbutton = f
  20.     for i = 1, 12 do
  21.         local b = CreateFrame("CheckButton", "$PARENTActionButton"..i, f, "SecureActionButtonTemplate ActionButtonTemplate",i)
  22.         b:SetWidth(32)
  23.         b:SetHeight(32)
  24.         b:SetPoint("TOPLEFT", lastbutton, "TOPRIGHT", xoffset, yoffset)
  25.         lastbutton = b
  26.         ActionButton_OnLoad(b)
  27.         b:SetAttribute('action--base',i)
  28.         b:SetAttribute('showgrid', 1)
  29.         b:SetAttribute('_childupdate-actionpage', [[
  30.             local offset = (message -1) * 12 + self:GetAttribute('action--base')
  31.             self:SetAttribute('action', self:GetAttribute('action--base'))
  32.             print(message, offset, self:GetAttribute('action--base'))
  33.         ]])
  34.         b:SetScript("OnAttributeChanged",ActionButton_UpdateAction)
  35.         b:SetAttribute('action', i)
  36.  
  37.     end
  38. 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
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » secure actionbutton taints again :(


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off