Quantcast
Download
(4 Kb)
Download
Updated: 10-31-16 03:32 PM
Pictures
File Info
Compatibility:
Return to Karazhan (7.1.0)
Updated:10-31-16 03:32 PM
Created:12-27-08 08:46 PM
Downloads:76,608
Favorites:319
MD5:
Categories:Action Bar Mods, Buff, Debuff, Spell
7.1.0

rButtonTemplate  Popular! (More than 5000 hits)

Version: 710.20161031
by: zork [More]


Intro

rButtonTemplate is a framework to theme Blizzard action, aura and item buttons. It does nothing on its own, needs a theme.
API documentation
https://github.com/zorker/rothui/blo...late/README.me (Check the themes for examples)
Quick-Links
rActionBar, rActionBar_Default, rActionBar_Zork, rBuffFrame, rBuffFrame_Default, rBuffFrame_Zork, rButtonTemplate, rButtonTemplate_Default, rButtonTemplate_Zork
Git
https://github.com/zorker/rothui/tre...ButtonTemplate

Optional Files (20)
File Name
Version
Size
Author
Date
Type
1.0-2016112001
4kB
11-19-16 07:31 PM
Addon
710.20161117
14kB
11-17-16 11:42 AM
Addon
700.20161004
23kB
10-04-16 06:24 AM
Addon
1.3
80kB
11-29-10 02:09 PM
Addon
1.0
22kB
11-14-10 06:23 PM
Addon
1.2
24kB
11-09-10 02:59 PM
Addon
1.0
3kB
11-05-10 09:22 AM
Addon
rev3
6kB
07-06-10 06:25 PM
Addon
1.0
8kB
04-25-10 01:32 PM
Patch
1.0
2kB
12-06-09 12:47 PM
Addon
1.0
3kB
08-18-09 11:37 AM
Addon
1.0
10kB
07-06-09 12:02 PM
Addon
v1
16kB
06-17-09 06:57 PM
Addon
v1.3
18kB
02-19-09 12:10 PM
Addon
001
21kB
01-23-09 03:24 AM
Addon
1.0
5kB
01-22-09 09:38 AM
Addon
003
6kB
01-20-09 08:16 PM
Patch
001
15kB
01-20-09 03:59 PM
Addon
001
10kB
01-20-09 03:58 PM
Addon
0.1
7kB
01-17-09 10:12 AM
Addon


Archived Files (26)
File Name
Version
Size
Author
Date
710.20161027
4kB
zork
10-27-16 12:37 PM
700.20161009
4kB
zork
10-09-16 02:21 PM
700.20161004
4kB
zork
10-04-16 06:21 AM
60000.01
24kB
zork
10-24-14 07:47 PM
50400.01
24kB
zork
09-16-13 04:44 AM
50200.01
24kB
zork
03-04-13 05:37 PM
50100.01
24kB
zork
11-28-12 01:27 PM
50001.07
24kB
zork
11-21-12 12:24 PM
50001.06
24kB
zork
09-21-12 02:19 PM
40300.06
23kB
zork
02-16-12 03:14 PM
40300.05
23kB
zork
02-15-12 04:59 PM
40300.04
23kB
zork
01-20-12 12:51 PM
40300.03
23kB
zork
12-04-11 05:16 PM
40300.02
23kB
zork
11-30-11 01:45 PM
40300.01
23kB
zork
11-30-11 12:35 PM
4.007
23kB
zork
06-29-11 03:40 PM
4.006
23kB
zork
04-28-11 11:40 AM
4.005
23kB
zork
02-09-11 01:55 PM
4.004
23kB
zork
10-17-10 07:16 AM
4.003
18kB
zork
10-16-10 06:03 AM
4.001
18kB
zork
10-15-10 03:40 PM
100812
18kB
zork
08-12-10 03:11 PM
005
18kB
zork
08-02-09 06:42 AM
004-2
17kB
zork
04-18-09 08:28 PM
003
17kB
zork
01-20-09 04:04 PM
002
12kB
zork
01-17-09 07:20 AM


Post A Reply Comment Options
Unread 11-19-16, 11:34 AM  
gmarco
A Chromatic Dragonspawn
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 190
File comments: 100
Uploads: 33
Great !

So it is fine in this way until you don't change the addons names (rFilter and rButtonTemplate)

Thanks so much Zork, not only for the great addons but also for the patience in answering all these questions

Really appreciated.
/bow
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Report comment to moderator  
Reply With Quote
Unread 11-19-16, 10:47 AM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1632
File comments: 3612
Uploads: 118
If nothing else is specified addons are loading in alphabetical order. It just so happens that the rButtonTemplate addons are loaded before rFilter.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
Last edited by zork : 11-19-16 at 10:51 AM.
Report comment to moderator  
Reply With Quote
Unread 11-19-16, 08:50 AM  
gmarco
A Chromatic Dragonspawn
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 190
File comments: 100
Uploads: 33
Hi Zork,

As long as the addon is referenced in the optionalDeps it will work
As I wrote in the previous post ... is it possible it works the same without this ?

Actually I have in my rFilter_GM:

Lua Code:
  1. ## Interface: 70100
  2. ## Author: zork
  3. ## Title: rFilter_Gm
  4. ## Notes: Layout and optional theme for rFilter
  5. ## RequiredDeps: rLib, rFilter
  6. ## OptionalDeps: rButtonTemplate
  7.  
  8. init.lua
  9. buff.lua
  10. debuff.lua
  11. cooldown.lua
  12. theme.lua

But I see the rfilter button skinned in the right way with rButtonTemplate_layout actually in use (but not here referenced).

Any idea ? It is supposed to work this way ?

As I said before in this way I don't need to hard encode the names of any rButtonTemplate_* layout.

Only now I realize that you could mean the addon that should in OptionalDeps is simply "rButtonTemplate" and not its template ?

Another thing is this:
I think you have to set this:
The actionbutton config variable name is just a name
If the variable name we used is always the same because you choose a name and all use this, a player can use an rFilter_layout and have it skinned by another person's rButtonTemplate_layout.
This because in the toc files there isn't any hardcoded references to the template to use as OptionalDeps.

Sorry about the long post.

Ciaoooo and thanks.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Last edited by gmarco : 11-19-16 at 09:04 AM.
Report comment to moderator  
Reply With Quote
Unread 11-19-16, 04:43 AM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1632
File comments: 3612
Uploads: 118
The actionbutton config variable name is just a name. Use the one you have referenced in your optionalDeps. You can give it a more generic name if you want. As long as the addon is referenced in the optionalDeps it will work. You can have both your theme addons as optional deps. Both using the same actionbutton config variable name. Depending on which button theme you activate it will use the desired action button theme to style your buttons.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
Last edited by zork : 11-19-16 at 04:44 AM.
Report comment to moderator  
Reply With Quote
Unread 11-18-16, 11:30 PM  
gmarco
A Chromatic Dragonspawn
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 190
File comments: 100
Uploads: 33
Hi Zork, everything works as expected



In this way it works nicely but I have to hardcoded somethings:

rFilter_Gm/rFilter_Gm.toc:
## OptionalDeps: rButtonTemplate, rButtonTemplate_Gm_rs




rFilter_Gm/theme.lua:
--check if the button template addon and the action button config theme is available
if not rButtonTemplate or not rButtonTemplate_Gm_rs_ActionButtonConfig then return end

-----------------------------
-- Actionbutton Config
-----------------------------

--load the default button theme
local actionButtonConfig = rLib.CopyTable(rButtonTemplate_Gm_rs_ActionButtonConfig)




rButtonTemplate_Gm_sr/theme.lua:
-----------------------------
-- actionButtonConfig
-----------------------------
local actionButtonConfig = {}
--make it global
rButtonTemplate_Gm_rs_ActionButtonConfig = actionButtonConfig





Now I see that I can change this and everything continue to works:

rFilter_Gm/rFilter_Gm.toc:
## OptionalDeps: rButtonTemplate

Hardcoded OptionalDep "rButtonTemplate_Gm_rs" removed.


rFilter_Gm/theme.lua:
--check if the button template addon and the action button config theme is available
if not rButtonTemplate or not rButtonTemplate_rFilter_ActionButtonConfig then return end

-----------------------------
-- Actionbutton Config
-----------------------------

--load the default button theme
local actionButtonConfig = rLib.CopyTable(rButtonTemplate_rFilter_ActionButtonConfig)




rButtonTemplate_Gm_sr/theme.lua:
-----------------------------
-- actionButtonConfig
-----------------------------
local actionButtonConfig = {}
--make it global for rFilter
rButtonTemplate_rFilter_ActionButtonConfig = actionButtonConfig




In this way I can export a "generic" global rButtonTemplate_rFilter_ActionButtonConfig in every rButtonTemplate_* without have to change anything else.

Is this correct ?


Thanks again Zork.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Report comment to moderator  
Reply With Quote
Unread 11-18-16, 01:17 AM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1632
File comments: 3612
Uploads: 118
Yes you forgot sth.

This condition has to become false:
https://github.com/zorker/rothui/blo.../theme.lua#L11

And to make that work you need to make your actionbutton config become a global variable in your button theme.
https://github.com/zorker/rothui/blo.../theme.lua#L43
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
Last edited by zork : 11-18-16 at 03:45 AM.
Report comment to moderator  
Reply With Quote
Unread 11-18-16, 01:08 AM  
gmarco
A Chromatic Dragonspawn
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 190
File comments: 100
Uploads: 33
Hi Zork,

sorry for the delay in feedback but I was so busy to merge the latest changes yesterday

I have a problem with the new rFilter and rButtonTemplate.



As you see the rFilter button is not skinned.

I made the following things:

1) Updated and merging the r* addons from latest github

2) make an rFilter_Gm based on your sample.

Lua Code:
  1. # Interface: 70100
  2. ## Author: zork
  3. ## Title: rFilter_Gm
  4. ## Notes: Layout and optional theme for rFilter
  5. ## RequiredDeps: rLib, rFilter
  6. ## OptionalDeps: rButtonTemplate, rButtonTemplate_Gm_rs
  7.  
  8. init.lua
  9. buff.lua
  10. debuff.lua
  11. cooldown.lua
  12. theme.lua

3) Added the buffs I want to check in rFilter_Gm/buff.lua:

Lua Code:
  1. if L.C.playerClass == "DRUID" then
  2.    
  3.     -- guardian ----------------------------------------------------------------------------------------
  4.     ---- Guardiano di Elune
  5.     local button = rFilter:CreateBuff(213680,"player",42,{"CENTER",0,-300},"[spec:3][combat]show;hide",{0,1},true,"player")
  6.     if button then table.insert(L.buffs,button) end
  7.  
  8.     ---- Marchio di Ursol
  9.     local button = rFilter:CreateBuff(192083,"player",42,{"CENTER",50,-300},"[spec:3][combat]show;hide",{0,1},true,"player")
  10.     if button then table.insert(L.buffs,button) end
  11.  
  12.     ---- Vello di Ferro
  13.     local button = rFilter:CreateBuff(192081,"player",42,{"CENTER",100,-300},"[spec:3][combat]show;hide",{0,1},true,"player")
  14.     if button then table.insert(L.buffs,button) end
  15.  
  16.  
  17.         --- [ other code]
  18.  
  19.  
  20. end


... finished ...

Should I have to references somethings in rButtonTemplate_Gm_rs as well ?
Probably it is missing me.

Thanks as usual for your patience.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Last edited by gmarco : 11-18-16 at 01:09 AM.
Report comment to moderator  
Reply With Quote
Unread 11-17-16, 07:38 AM  
gmarco
A Chromatic Dragonspawn
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 190
File comments: 100
Uploads: 33
Zork,
you are a monster

I'll check "all" changes (and they are a lot asap when I'll be in home later

Thanks again for now. Your work is really appreciated.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Report comment to moderator  
Reply With Quote
Unread 11-17-16, 02:07 AM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1632
File comments: 3612
Uploads: 118
You need the dependency. You want to access a variable defined by that addon. You need to make sure it is loaded before you access it. If you check your button layouts they all have dependencies.

But I get your point. You want to add buffs debuffs without having to rely on a button theme. This would spawn the button with the default button theme.

I will think about it. Should be no problem to implement since I just need a condition for this line:
https://github.com/zorker/rothui/blo...tions.lua#L123

I will probably shift from having a config for rFilter to having a layout with an optional theme for rFilter.

That way in a later layout you will be able to do sth like this:

Lua Code:
  1. local button = rFilter:CreateBuff(...)
  2. rButtonTemplate:StyleActionButton(button, actionButtonConfig)

I like that approach. I need a workaround for this:
https://github.com/zorker/rothui/blo...ctions.lua#L86

But this should do it:
Lua Code:
  1. --button.settings.durationFont
  2. button.settings.durationFont = button.settings.durationFont or {button.duration:GetFont()}
  3. UpdateFont(button,button.duration,button.settings.durationFont,size)
  4. --button.settings.countFont
  5. button.settings.countFont = button.settings.countFont or {button.count:GetFont()}
  6. UpdateFont(button,button.count,button.settings.countFont,size)
  7. --button.settings.extravalueFont
  8. button.settings.extravalueFont = button.settings.extravalueFont or {button.extravalue:GetFont()}
  9. UpdateFont(button,button.extravalue,button.settings.extravalueFont,size)

*edit*
First version of rFilter as a framework: https://github.com/zorker/rothui/com...e0644c85616913
rFilterConfig is obsolete now. Will be removed.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
Last edited by zork : 11-17-16 at 04:28 AM.
Report comment to moderator  
Reply With Quote
Unread 11-17-16, 01:41 AM  
gmarco
A Chromatic Dragonspawn
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 190
File comments: 100
Uploads: 33
Hi Zork,

I see you have updated also the github with this changes
Later in the morning I check this out Thanks

Just a thing I am thinking about...

Actionbars and de/buffs happily work without have to make them depends on a specific addon for the button layout.

Example:


Could you extend such behaviour also to rFilter ? In this way we don't need the statically depend condition in the toc file ? If there is a rButtonTemplate_layout ... use it otherwhise use the standard blizzard textures and icons.



If this will not be possible or too complex I was thinking to another thing (crazy ?) .

Is it so crazy I have ALL the rButtonTemplate layouts deploys using all the same folder structure and names, i.e. rButtonTemplate_Layout. In this way I can try all layouts (once at a time and the rfilter always get the skin, because I put in his toc file:

Code:
## Dependencies: rLib, rButtonTemplate_Layout
So to explain better: the "project" name on curse/wowinterface have different titles (rButtonTemplate_layout1, rButtonTemplate_layout2 and so on) but all of them install as rButtonTemplate_Layout.

Or better make the every different rButtonTemplate_Layouts export the same global configuration named rButtonTemplate_Layout and rFilter use that if present and not the different addons name.

In this way we to prevent the mandatory "Dependencies" condition that have to be changed to modify the button template.

Btw as usually Zork thanks so much for your time and attention.

P.s
This is only to discuss and chat, nothing mandatory
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Report comment to moderator  
Reply With Quote
Unread 11-17-16, 12:08 AM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1632
File comments: 3612
Uploads: 118
Sure you can make your button template actionbutton config global and make your button template theme a required addon.

To do that you add it to the required addons of rFilterConfig: https://github.com/zorker/rothui/blo...lterConfig.toc
Code:
## Dependencies: rLib, rButtonTemplate_Gm
In rButtonTemplate_Gm/theme.lua https://github.com/zorker/rothui/blo.../theme.lua#L42 you do sth like this:

Lua Code:
  1. local actionButtonConfig = {}
  2. rButtonTemplate_Gm_ActionbuttonConfig = actionButtonConfig

That way rButtonTemplate_Gm_ActionbuttonConfig becomes global and you can access it in rFilterConfig.

That being said...since it is bound by reference if you want changes on a specific part you need to copy it first. Otherwise you change the reference and all buttons will change. That is why the button theme is using copyTable so often.

rLib has the function avaiable: https://github.com/zorker/rothui/blo...b/core.lua#L23

In rFilterConfig.actionbutton.lua you can do sth like this:
Lua Code:
  1. --copy the default button theme
  2. L.C.actionButtonConfig = rLib:CopyTable(rButtonTemplate_Gm_ActionbuttonConfig)
  3. --add specific changes here to L.C.actionButtonConfig
  4. L.C.actionButtonConfig.name.alpha = 1

Btw...thanks for bringing that up. I am not sure why I have not done that myself.

*edit* That is the theory. I found some bugs. Need to fix them first.
*edit2* Ok fixed all the issued. Damn I found an error in rLib. :/

https://github.com/zorker/rothui/com...47abe1dccf2864
https://github.com/zorker/rothui/com...71102ec2afd847
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
Last edited by zork : 11-17-16 at 12:46 AM.
Report comment to moderator  
Reply With Quote
Unread 11-16-16, 08:01 PM  
gmarco
A Chromatic Dragonspawn
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 190
File comments: 100
Uploads: 33
Hi Zork and others,

Make a rounded square is easy ... but it is not so easy to if the texture is a circle ... I can't even imagine how to code it

I have finished a different template (rounded square).



A couple of things I'd like to share:

The Blizzard cooldown swinger is squared so I have to disable it while mantaining the numeric cooldown.

I added this code in the top of the template:

Lua Code:
  1. for i,v in ipairs{"Action","MultiBarBottomLeft","MultiBarBottomRight","MultiBarRight","MultiBarLeft"} do
  2.  
  3.     for i = 1, 12 do
  4.         local cooldown = _G[v .. 'Button' .. i .. 'Cooldown']
  5.         cooldown:SetDrawBling(false)
  6.         cooldown:SetDrawSwipe(false)
  7.         cooldown:SetDrawEdge(false)
  8.     end
  9. end

It works fine but is it the right way to do it ?

Another thing.

Is possible to skin rFilter with rButtonTemplate automagically without have to copy the textures in the rFilter media folder ? So if I changed the rButtonTemplate layout it changes accordingly

I mean this:


Thanks for reading
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Report comment to moderator  
Reply With Quote
Unread 11-16-16, 02:55 PM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1632
File comments: 3612
Uploads: 118
Yes you can do that. You can supply one or more points that will repoint the textures based on the button. That way you can repoint any texture. Check the points in my example and play around with the x and y values.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
Report comment to moderator  
Reply With Quote
Unread 11-16-16, 12:03 PM  
gmarco
A Chromatic Dragonspawn
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 190
File comments: 100
Uploads: 33
Zork, Another question if possible.

May I forced an icon inside the texture ?
For example to let you understand better ... if I make circle texture may I force the icon inside without to see the angles of it outside ?

Thanks

P.s


Es. removing the angles here
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Last edited by gmarco : 11-16-16 at 12:11 PM.
Report comment to moderator  
Reply With Quote
Unread 11-16-16, 11:10 AM  
gmarco
A Chromatic Dragonspawn
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 190
File comments: 100
Uploads: 33
Hi Zork,

thanks very much for yoyr precious tutorial

I have made a set of buttons:



and they looks grey but my normal texture is in this way:



and it is white not grey.

But I have forgotten to check this:

Lua Code:
  1. --normalTexture
  2. actionButtonConfig.normalTexture = {
  3.   file = mediapath.."normal",
  4.   color = {0.5,0.5,0.5,1},
  5.   points = {
  6.     {"TOPLEFT", 0, 0 },
  7.     {"BOTTOMRIGHT", 0, 0 },
  8.   },
  9. }

the color is a grey with alpha 1 ? So, if I realize only now that I am putting a grey color on the top of my tga file. So it works like expected )

The others textures that I see wrongly were because I miss this piece of code that you commented in your template causing me to happily deleted in mine

Lua Code:
  1. --[[
  2. --pushedTexture
  3. actionButtonConfig.pushedTexture = {
  4.   file = mediapath.."pushed",
  5.   points = {
  6.     {"TOPLEFT", 0, 0 },
  7.     {"BOTTOMRIGHT", 0, 0 },
  8.   },
  9. }
  10. --highlightTexture
  11. actionButtonConfig.highlightTexture = {
  12.   file = mediapath.."highlight",
  13.   points = {
  14.     {"TOPLEFT", 0, 0 },
  15.     {"BOTTOMRIGHT", 0, 0 },
  16.   },
  17. }
  18. --checkedTexture
  19. actionButtonConfig.checkedTexture = {
  20.   file = mediapath.."checked",
  21.   points = {
  22.     {"TOPLEFT", 0, 0 },
  23.     {"BOTTOMRIGHT", 0, 0 },
  24.   },
  25. }
  26. ]]--

Enable it everything is fine

Thanks again for your help Zork... Now everything is (almost) clear
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: