Stuffs to be considered for making actionbar replacement with LibActionButton
I don't know how many of addon authors, here, have used or are currently using LibActionButton for their addon, but what things should I consider while replacing a default blizzard actionbar with it?
The only thing that I know is you should use SecureHandlerStateTemplate for creating a bar and register state driver on it so that each individual buttons switch on shape shifting, page switching and so on. What else would be there? -Engavi |
Check lightspark's UI. He is using Lib-Action-Button. Well...he may have adjusted it a little since the reference is LibActionButton-1.0-ls.
https://github.com/ls-/ls_UI/blob/ma...onbars.lua#L10 |
Quote:
Thanks for reference zork :) ** EDIT Okay, just had a look at both files and I could pretty much say that there is no change on performance or its functionality, but the only difference the design. |
Mine might not be a good example of LAB usage because I'm still migrating to it and code needs to be adjusted, I used to re-use Blizz buttons.
But from my experience so far LAB is missing only one thing: a new 735 feature that allows you to right-click an action button to toggle pet action's autocasting if it's placed on your action bar. But that's Blizz forgetting about us, addon devs, once again, it's not a part of secenv, so nothing can be done atm >_> Other than that, it's fine. It's not that customisable by default, but it's a lib, so you can edit its code w/o any issues. That's what I did. Benefits of using LAB are quite nice, the most important, at least for me, is that you don't need to dance around default buttons' OnUpdate and OnEvent handlers, like each button has its own o_O LAB uses a better approach, so it may actually be a performance gain. And, once again, because it's a lib, you can alter it w/o breaking anything. |
Quote:
The only thing that I need is just a brief reference so that I could get a bare minimum idea on how I should deal with it. There is an official documentation for LAB on its project page, but I find it too simple (or short) :rolleyes: Quote:
Quote:
Should I directly adjust it from lib file? Or should I modify it on button creation? Quote:
Many thanks! -Engavi |
Lua Code:
Damn, I didn't even know this. They could change it to this... Lua Code:
I've also built my own version of LAB because it didn't cover all my needs, but here are my recommendations anyway:
|
Quote:
Quote:
- Proper patch #1. Blizz add a new feature, but forget to add it to secenv; - We report it; - Proper patch #2. Blizz add said feature to secenv. They rarely add anything w/ hotfixes though, so I expect this to be fixed in 8.0 :D Quote:
You can even add masque support, if you want. Quote:
You can reskin Blizz buttons w/o any issues, but when it comes to dynamic things, like using different colours for icons, reusing default buttons might be a PITA, but if you use LAB, you can do whatever you want w/ it :p I replaced LAB's Blizz-like code w/ mine. |
I have not digged into LAB yet because the default action bar is fine for my needs.
I always seperated the styling of the buttons from the general layout of the bar. If you are using an action button template it is quite easy to adjust the button appearance once the button is created because all elements are already there. It might be even possible to just use rButtonTemplate for it if a Blizzard action button template is used. rButtonTemplate:StyleActionButton() https://github.com/zorker/rothui/blo.../core.lua#L169 Doc: https://github.com/zorker/rothui/blo...late/README.me My config: https://github.com/zorker/rothui/blo.../theme.lua#L39 Funny enough I was able to give all buttons in the player BuffFrame, BagSlots and for all action buttons the same config. |
For the right-click on pet action, you can use macro type for the right-click. Well, no harm to click the original pet action button.
Lua Code:
It's a little difficult to figure out the action page, I use three steps to figure it out: 1. Use SetFrameRef to register the MainMenuBarArtFrame and OverrideActionBar to your secure frame, so we can get some action page securely during combat: ActionHandler.lua#L147-L148 2. Register state for conditions like stanceActionHandler.lua#L151-L188 3. At last, the secure snippet to get the real action page based on the state and the MainMenuBarArtFrame or OverrideActionBar ActionHandler.lua#L94-L117 |
Quote:
Quote:
|
Quote:
|
Thank you so much to all for giving me such a valuable advice, comments and references.
I'm not sure when I'd start writing my project with LAB, but this post would definitely be the great starting point for myself as well as for those who are willing to write one :) -Engavi |
Okay, here's another question.
What's the best way to disable/hide default blizzard action bars? I currently found two solutions, one from Bartender4 and the other from lightspark's project, but ain't sure of which would be better. (apologize to lightspark for keep mentioning of his project :o...) |
In general, you may want to kill them for good: unregister all events, reparent them to a hidden frame and so on.
But sometimes Blizz make bars (esp MainMenuBarArtFrame) do more things than they're supposed to do, for instance, at some point in the past MainMenuBarArtFrame was used to update either currency or rep tab on your character frame, so if you unregistered all events, you wouldn't see one of those tabs there :D I kill them all, but I keep events on MainMenuBarArtFrame, haven't caused any issues in years. Bartender hides most of them w/o touching events. |
@Engavi what's your decision for writing new Actionbars? Or have you tried reusing Blizzards Actionbars before?
I'm kinda in the same situation as you, needing some sort of customizable Actionbars. I'm currently using an old version of zorks rActionbar which actually works really nicely. But I wanted to add and ingame config and starting running into issues (like somehow 2 actionbars have the exact same spells on them, but the macros, position etc. are correct) So I'm thinking of doing something like you and using LibActionButton. My current situation looks like this if you wanna read some code. https://github.com/gempir/gempUI/blo...nbars/bars.lua |
@lightspark, Thank you for clarification :banana:
@gempir, Unfortunately, I have not yet decided whether I'd directly start from LAB or reuse Blizzard's code to just re-skin buttons, thus it's 50:50 so far. (I do not have an experience of reusing Blizzard's code either, btw) Although my "current" goal is just re-skinning, I would like to have more controls on its features and that's why I'm considering LAB at the same time, but you know :rolleyes: Even if I start my project, I'm pretty sure it won't finish in next few months cause I'm super lazy and planning to start my degrees real soon :p |
All times are GMT -6. The time now is 06:39 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI