View Single Post
12-05-11, 12:06 PM   #24
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
p3lim is right. /run ExtraActionBarFrame:GetParent():GetName() reveils it.

This is what I'm using atm. The frame at the darkmoonfaerie is funny. But maybe the vehicle button 1 is actionbutton 121 aswell.

This is my current implementation. Still needs testing. Not sure if the event hooking is actually required (and the show/hide may even cause trouble in combat)

lua Code:
  1. --get the addon namespace
  2.     local addon, ns = ...
  3.     --get the config values
  4.     local cfg = ns.cfg
  5.     local barcfg = cfg.bars.extrabar
  6.     if barcfg and not barcfg.disable then
  7.      
  8.       --holder frame
  9.       local bar = CreateFrame("Frame","rABS_ExtraActionBar",UIParent,"SecureHandlerStateTemplate")
  10.       bar:SetSize(barcfg.buttonsize,barcfg.buttonsize)
  11.       bar:SetPoint(barcfg.pos.a1,barcfg.pos.af,barcfg.pos.a2,barcfg.pos.x,barcfg.pos.y)
  12.       bar:SetHitRectInsets(-cfg.barinset, -cfg.barinset, -cfg.barinset, -cfg.barinset)
  13.       bar:SetScale(barcfg.barscale)
  14.       cfg.applyDragFunctionality(bar,barcfg.userplaced,barcfg.locked)
  15.      
  16.       --the frame
  17.       local f = ExtraActionBarFrame
  18.       f:SetParent(bar)
  19.       f:ClearAllPoints()
  20.       f:SetPoint("CENTER", 0, 0)
  21.       f.ignoreFramePositionManager = true
  22.      
  23.       --the button
  24.       local b = ExtraActionButton1
  25.       b:SetSize(barcfg.buttonsize,barcfg.buttonsize)
  26.       bar.button = b
  27.      
  28.       --style texture
  29.       local s = b.style
  30.       s:SetTexture(nil)
  31.       local disableTexture = function(style, texture)
  32.         if not texture then return end
  33.         if string.sub(texture,1,9) == "Interface" then
  34.           style:SetTexture(nil) --bzzzzzzzz
  35.         end
  36.       end
  37.       hooksecurefunc(s, "SetTexture", disableTexture)
  38.      
  39.       --register the event, make sure the damn button shows up
  40.       bar:RegisterEvent("UPDATE_EXTRA_ACTIONBAR")
  41.       bar:RegisterEvent("PLAYER_REGEN_ENABLED")
  42.       bar:SetScript("OnEvent", function(self, event, ...)
  43.         if (HasExtraActionBar()) then
  44.           self:Show()
  45.           self.button:Show()
  46.         else
  47.           self:Hide()
  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-06-11 at 05:43 AM.
  Reply With Quote