View Single Post
Unread 01-05-13, 08:17 PM   #16
semlar
A Molten Giant
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 636
Okay for real this time, THIS one should work with everything. Probably.
Lua Code:
  1. local oSetAttribute = getmetatable(ActionButton1).__index.SetAttribute
  2. hooksecurefunc(getmetatable(ActionButton1).__index, 'SetAttribute', function(self, attribute)
  3.     if attribute ~= 'showgrid' or GetCVar('alwaysShowActionBars') ~= '0' then return end
  4.     oSetAttribute(self, 'showgrid', GetCursorInfo() and 1 or 0)
  5.     if not HasAction(self.action) then self:Hide() end
  6. end)

I added a check for the cvar too so it should honor the setting.
semlar is offline   Reply With Quote