View Single Post
07-27-17, 01:34 AM   #5
aallkkaa
A Warpwood Thunder Caller
 
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 98
Yes, I want ro change bar pages based on user input, so yeah, I'm trying to look at SecureActionButtonTemplate now.

Dominos does change action bar pages in reaction to my macros, including during combat lockdown. Or at least so it seems. Maybe it only catches the call to change the page (I can easily do that myself, through the ACTIONBAR_PAGE_CHANGED event).

Assuming Dominos changes the actual page on the Blizzard ActionBar (and then reflects that change in its own bars), it's still not very obvious to me how it does it.
Looking for "Template" in the Dominos folder, I got four different templates being used:
- ActionBarButtonTemplate;
- SecureHandlerStateTemplate;
- SecureActionButtonTemplate;
- SecureHandlerShowHideTemplate.
And that's just for the files in the bars and core subfolders. There's more in libs and in plugins ... SecureActionButtonTemplate but I'm unsure that's "the one" and "only" one needed for the task. SecureHandlerStateTemplate appears two or three times.

RegisterStateDriver also makes appearances in Dominos. Three "states" (if I'm using the correct term) that I think may be of interest to me would be:
- 'page';
- state - yes, it's a variable - I'll have to go chasing it around the code to understand its workings, I guess;
- 'combat'.

Seems like a lot of time trying to figure out how Dominos does something that might or not be what I want to do.
Dominos is of course a much much much more ambitious project than my own (and coded by someone much much much more knowledgeable too) and I don't really have the time to read and understand all the relevant parts at the moment. Maybe I will when I get some more spare time.

In the meanwhile, I found another ActionBars addon, called Paging. It serves a purpose similar to what I want to perform but it uses the modifier keys (ctrl, shift, alt) to keep on an alternate page only for as long as yu keep that modifier key pressed.
That's not what I want. Currently, I press one of the keys E, R or T and the page swaps; I then have to press said key again to swap back to 1; sometimes, when reaction times are critical, I get lost about which page I'm on). The abilities one pages 2 through 4 are mostly situational ones and though very useful in those situations, it's most often than not a case of use once and not again for a long time... Making them available only while certain modifier key is down is something that I acomplished before with keybindings (to the bars) for a long time, and I wasn't happy.
Press one key (no need to be doing hand-contortionism to hold a modifier all along) and I have a new set of buttons at my disposal, press the one I want and (the part currently missing) forget about it. This is what I'm trying to do.
TL;DR: Paging is an addon which seems to be much simpler in scope than Dominos and I might get enough information from it. It is BTW ... outdated, from 6.0.3 if I remember correctly. Will have to test whether it still works.

Once again, thanks for the thoughts, RainRider! Keep them coming!
  Reply With Quote