Quantcast WoWInterface - View Single Post - SecureHandlerAttributeTemplate optimization
View Single Post
03-23-19, 08:11 PM   #10
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 114
I am using rActionbar atm, and do meet the overridebar update problem as you mentioned. But I need the button grids stay shown.
It is so weired that these code below actually work properly on vehicle buttons for rActionbar. Maybe it just need an update.
Lua Code:
  1. local AttributeChangedFrame = CreateFrame("Frame", nil, UIParent, "SecureHandlerAttributeTemplate")
  2. for i = 1, 12 do
  3.     local name = "ActionButton"..i
  4.     AttributeChangedFrame:SetFrameRef(name, _G[name])
  5. end
  6.  
  7. AttributeChangedFrame:Execute([[
  8.     buttons = table.new()
  9.     for i = 1, 12 do
  10.         buttons[i] = self:GetFrameRef("ActionButton"..i)
  11.     end
  12. ]])
  13. AttributeChangedFrame:SetAttribute("_onattributechanged", ([[
  14.     if HasOverrideActionBar() or HasVehicleActionBar() then
  15.         for i = 1, 12 do
  16.             buttons[i]:SetAttribute("state", newstate)
  17.         end
  18.     end
  19. ]]))
  20. RegisterStateDriver(AttributeChangedFrame, "visibility", "[overridebar][vehicleui][possessbar][shapeshift] show; hide")

Last edited by siweia : 03-24-19 at 03:07 AM.
  Reply With Quote