View Single Post
Old 01-05-13, 09:37 AM   #13
laukond
A Cliff Giant
Join Date: Dec 2011
Posts: 79
Lua Code:
  1. local function ActuallyHideGrid(barName)
  2.     for i=1, NUM_MULTIBAR_BUTTONS do
  3.         local button = _G[barName.."Button"..i]
  4.         button:SetAttribute("showgrid",0)
  5.         for i,region in pairs({button:GetRegions()}) do
  6.             if region.GetTexture and region:GetTexture() then
  7.                 region:SetAlpha(0)
  8.             end
  9.         end
  10.     end
  11. end
  12. ActuallyHideGrid("MultiBarBottomLeft")
  13. ActuallyHideGrid("MultiBarBottomRight")
  14. ActuallyHideGrid("MultiBarRight")
  15. ActuallyHideGrid("MultiBarLeft")

This did not work for me. It would bug out one button every time I tried, and if I tried moving the spell on that button it would show all grids.


Lua Code:
  1. hooksecurefunc(getmetatable(ActionButton1).__index, 'SetAttribute', function(self, attribute)
  2.     if attribute ~= 'showgrid' then return end
  3.     self:SetAttribute('showgrid',0)
  4.     if not HasAction(self.action) then
  5.         self:Hide()
  6.     end
  7. end)

This on the other hand worked very well, BUT the problem is it is impossible to put at spell from the spellbook etc. down to the Action Bar, since the textures never appear.
So if there could be added a condition to only hide when not dragging anything (such as a macro, ability, trinket, etc.) then it would work very well :-)
laukond is offline   Reply With Quote