View Single Post
12-01-11, 03:37 AM   #12
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
tukz moves the full ExtaActionBarFrame. That seems to be an option aswell.

Here is the implementation I'm going to try with rActionBarStyler. I'm secure hooking the SetTexture function of the button.style object because I do not want that.
lua Code:
  1. --get the addon namespace
  2.   local addon, ns = ...
  3.  
  4.   --get the config values
  5.   local cfg = ns.cfg
  6.   local barcfg = cfg.bars.extrabar
  7.  
  8.   if not barcfg.disable then
  9.  
  10.     local num = 1
  11.  
  12.     local bar = CreateFrame("Frame","rABS_ExtraActionBar",UIParent,"SecureHandlerStateTemplate")
  13.     bar:SetWidth(barcfg.buttonsize*num+barcfg.buttonspacing*(num-1))
  14.     bar:SetHeight(barcfg.buttonsize)
  15.     bar:SetPoint(barcfg.pos.a1,barcfg.pos.af,barcfg.pos.a2,barcfg.pos.x,barcfg.pos.y)
  16.     bar:SetHitRectInsets(-cfg.barinset, -cfg.barinset, -cfg.barinset, -cfg.barinset)
  17.     bar:SetScale(barcfg.barscale)
  18.  
  19.     cfg.applyDragFunctionality(bar,barcfg.userplaced,barcfg.locked)
  20.    
  21.     ExtraActionBarFrame:SetParent(bar)
  22.     ExtraActionBarFrame:EnableMouse(false)
  23.    
  24.     local txt = "Interface\Addons" --debug
  25.     print(string.sub(txt,1,9)) --debug
  26.  
  27.     local disableTexture = function(style, texture)
  28.       if string.sub(texture,1,9) == "Interface" then
  29.         style:SetTexture("")--disable button style texture
  30.       end
  31.     end
  32.  
  33.     for i=1, num do
  34.       local button = _G["ExtraActionButton"..i]
  35.       if not button then return end
  36.       if button.style then
  37.         print(button.style:GetTexture()) --debug
  38.         button.style:SetTexture("")
  39.         hooksecurefunc(button.style, "SetTexture", disableTexture)
  40.       end
  41.       button:SetSize(barcfg.buttonsize, barcfg.buttonsize)
  42.       button:ClearAllPoints()
  43.       if i == 1 then
  44.         button:SetPoint("BOTTOMLEFT", bar, 0,0)
  45.       else
  46.         local previous = _G["ExtraActionButton"..i-1]
  47.         button:SetPoint("LEFT", previous, "RIGHT", barcfg.buttonspacing, 0)
  48.       end
  49.     end
  50.  
  51.   end --disable
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 12-01-11 at 04:30 AM.
  Reply With Quote