Thread Tools Display Modes
03-04-09, 02:33 PM   #1
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
ButtonFacade integration

I'm looking to add ButtonFacade support to my addon: Class Buttons. However, after browsing WoWAce for an hour, and coming no closer to when I started, I'm asking for help here.

Does anyone know of any tutorial or demo mod to help me accomplish my goals here?
  Reply With Quote
03-04-09, 03:17 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Did you see this page yet from the download page? http://www.wowace.com/projects/butto...button-facade/
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-04-09, 03:54 PM   #3
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
I have, yes. But no full addon examples were given. I think I may have figured it out though. It appears to have been pretty easy. I just wish such an addon was created for the default WoW action bars. =)
  Reply With Quote
03-04-09, 05:34 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
It was, but never updated.

edit: a ButtonFacade plugin, that is.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-05-09, 09:00 AM   #5
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
It looks like I may have gotten it figured out. For the most part anyway.

A well written addon example would make this whole process a ton easier.
  Reply With Quote
03-05-09, 10:07 AM   #6
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
Hmm, my ButtonFacade integration addon breaks my cooldown & global cooldown graphics. =\
  Reply With Quote
03-05-09, 10:57 AM   #7
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
Here is my code to add support to my ClassButtons addon. The graphics changing works, but I no longer have GlobalCooldown effects on my addon. If I disable this integration addon, the Cooldown effects work just fine.

the .toc: http://www.wowi.pastey.net/109532
the core: http://www.wowi.pastey.net/109534
screenshot: http://img25.imageshack.us/my.php?im...0509085701.jpg

Any ideas about what I'm doing wrong here?
  Reply With Quote
03-05-09, 11:02 AM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Have a look through the ButtonFacade support of other addons for examples. Here - these are separate plugins that add BF support, that should be easy enough to follow.

http://www.wowinterface.com/download..._ItemRack.html
http://www.wowinterface.com/download...tonFacade.html
http://www.wowinterface.com/download...tonFacade.html
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-05-09, 11:20 AM   #9
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
http://www.wowinterface.com/download...tonFacade.html is what I used to get as far as I have. I'm comparing the code in the other two links you gave me now, to see where I went wrong.

Thanks for all your help so far
  Reply With Quote
03-05-09, 12:33 PM   #10
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
Ok, there is defenatly something wrong with the way I am creating my buttons. As you can see, in this screenshot the buttons textures are still extending past the textures of ButtonFacade. And here is a screenshot of the global cooldown flash not working.

Integration addon:
.toc and core.lua

ClassButtons addon:
Here is my XML code to create the button templates: http://www.wowi.pastey.net/109536
and the Lua code to create the buttons and assign all values: http://www.wowi.pastey.net/109537

Last edited by kneeki : 03-05-09 at 12:37 PM.
  Reply With Quote
03-05-09, 02:32 PM   #11
Maul
Ion Engines, Engage!
 
Maul's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 401
This is most likely because the UI now auto-orders the frame levels of elements of a frame in an annoying way (useful to some, not all )

I make my own custom buttons, not using the Blizzard action button template, and each time my buttons are created or updated via configuration, I have to reorder the elements like this -

button:SetFrameLevel(4)
button.iconframe:SetFrameLevel(2)
button.iconframecooldown:SetFrameLevel(3)

"iconframe" is a special frame I made to put the icon texture in and the cooldown model is a part of it.

Basically, you just need to ensure your cooldown model is above your icon texture in frame level. I do remember that right after Blizz made the change, my cooldowns disappeared as well.
__________________

Twitter: @IonMaul | Windows Live: [email protected] | Google Talk: [email protected]
  Reply With Quote
03-05-09, 02:52 PM   #12
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
Mhmm

I've just switched from using my own XML with a copy/paste of blizzard code, to just using Blizzard code. example:
Code:
ClassButton[frame] = CreateFrame("Button", "ClassButton"..frame, UIParent, "SecureActionButtonTemplate, ActionButtonTemplate")
and I have the same results. I also think that the frame levels are the issue for the global cooldown, but for the texture issues, I think my error is here:
Code:
            local t = button:CreateTexture(nil,"BACKGROUND")
                t:SetTexture(GetSpellTexture(CurrentClassButtonsSpells[frameToBuild][i]))
                t:SetAllPoints(button)
                button.texture = t
I've sense tried changing all that to just:
Code:
button:SetNormalTexture(GetSpellTexture(CurrentClassButtonsSpells[frameToBuild][i]))
But then nothing at all is placed in the button, and I'm not given any error message to boot.

<-- frustrated.

[edit] here is a screenshot
  Reply With Quote
03-06-09, 05:15 PM   #13
Antichrist
A Defias Bandit
Join Date: Mar 2009
Posts: 3
Actually not tested, because I got some problems with my own addon...but just copied and pasted from my code...

-- Declare and Initialise
local LBF = LibStub("LibButtonFacade", true)

-- Create a "Group" for your Addon (listed in BF's-Interace)
grp = LBF:Group("WarlocksChoice")

-- Register an Event to be executed if Skin has changed
LBF:RegisterSkinCallback("WarlocksChoice", OnSkin, self)

--Now you can start to create your LUA-Buttons as usual
-- Code missing here for the standard-buttons


-- but every button must be added additionally as ButtonFacade-Button
-- See lines below
txt = frame:CreateTexture(nil)
txt:SetTexture("Path to your texture here")
local btnData = {Normal = txt}
-- where Normal would be similar to SetNormalTexture
-- I was not able to solve this without this line of code
-- otherwise My button would not have any texture. Maybe you find this out

-- Finally now add this Button to BF
grp:AddButton(Button, btnData)



-- After you created all Butttons and added them to BF as well,
-- you have to skin your Button-Group


grp:Skin(WLCConfig.BFSkin, WLCConfig.BFGloss, WLCConfig.BFBackdrop)
-- where WLCConfig.BFSkin, BFGloss and BFBackdrop are saved variables from the last settings done in ButtonFacade

-- These Variables will be save within the OnSkin-Event you
-- already have registered in the first lines of code here

function OnSkin(args, skin, gloss, backdrop, group, _, colors)
WLCConfig.BFSkin = skin
WLCConfig.BFBackdrop = backdrop
WLCConfig.BFGloss = gloss
end


Hope this will help you. Would be great to get a short reply.
Rgds,
Val
  Reply With Quote
03-07-09, 11:36 AM   #14
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
Thanks! I'll try this out and see how it goes =)
  Reply With Quote
03-07-09, 07:43 PM   #15
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
Originally Posted by Maul View Post
This is most likely because the UI now auto-orders the frame levels of elements of a frame in an annoying way (useful to some, not all )

I make my own custom buttons, not using the Blizzard action button template, and each time my buttons are created or updated via configuration, I have to reorder the elements like this -

button:SetFrameLevel(4)
button.iconframe:SetFrameLevel(2)
button.iconframecooldown:SetFrameLevel(3)

"iconframe" is a special frame I made to put the icon texture in and the cooldown model is a part of it.

Basically, you just need to ensure your cooldown model is above your icon texture in frame level. I do remember that right after Blizz made the change, my cooldowns disappeared as well.
I tried doing what you suggested, creating a new IconFrame & Cooldown area, and it worked great!

Although, my frame graphics are still sticking out further than the borders of the ButtonFacade Skins... Weird
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » ButtonFacade integration


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off