Feature - Implemented redraw scriptList buttons on property change

AlbinoRhino

Active member
The talk about the toolbar in the other forum made me think that the feature that I use frequently is the scriptList buttons. It's sort of a "make-your-own" toolbar.

Currently any changes made to the scriptList property aren't updated until logging out / in and the gui is re-drawn. The daily deeds panel used to be the same way but at some point it was changed so that it re-draws itself when the property changes, which is very handy.

I would like to request that the scriptList button bar please be given the same feature. Then, one could script changes to that property on a per-situation basis and have their "toolbar" adapt to their current situation without logging in and out.
 

Veracity

Developer
Staff member
An issue is that there are two options for the script bar:

1) Added to the right of the desktop toolbar
2) Vertically on the right.

You can change that property, too - and it will require restarting to move the script toolbar from place to another.

I'll experiment with updating the vertical panel when you change scripts.
 

AlbinoRhino

Active member
Thank you for looking at this ! I've actually tinkered around trying to add this feature myself but so far I've failed.
 
Last edited:

Veracity

Developer
Staff member
Revision 17662 should do this for you if you have "script buttons on the right"; it will create a toolbar even if you have zero scripts specified in scriptList and will update any time that setting changes, adding and deleting buttons as needed.

I did nothing for the "script buttons at end of main toolbar". I also did not make it update the GUI if you enable the script bar for the first time or disable it entirely or switch between top row and right side or vice versa; you have to restart, as before, to see those changes.
 

Veracity

Developer
Staff member
You know, I think the "add script buttons to the end of the regular toolbar" is stupid. What I'd like:

Don't show script toolbar
Show script toolbar on right side.

And then, always create the toolbar, but only load it with the list of script buttons if "Show script toolbar".

The toolbar then listens to both settings - scriptButtonPosition and scriptList - and loads the buttons only if the former is true, and changes the buttons whenever the latter changes, as it is now.
 

Veracity

Developer
Staff member
Revision 17664 does it that way.

We always create a toolbar on the right side of the main panel to hold script buttons.
If you have "Don't show script toolbar", there are no buttons on it and Swing suppresses it.
If you have "Show script toolbar on right side", we load it with buttons and Swing shows it.
If you change scriptList, we change the buttons.
If you change scriptButtonPosition, we show or don't show it.
 
Top