Page 1 of 1

saveMacroButtonProperty for Token - What does it do?

Posted: Mon Jul 29, 2019 5:17 am
by Merudo
One way the token method saveMacroButtonProperty() in Token.java is called is when changes to a token macro are applied (see MacroButtonProperties.java).

I've noticed that this method doesn't appear necessary to save/apply changes to a token macro. In fact, I've only seen this method been useful when trying to create a new token macro.

I'm trying to find out what the purpose of saveMacroButtonProperty() is. Does anyone know?

The reason I'm asking is that currently, a null pointer exception is thrown when applying a change to a macro on a different map. I found a way to remove the error but that would mean skipping saveMacroButtonProperty(). I'm trying to find out what the side effects of that might be.

Re: saveMacroButtonProperty for Token - What does it do?

Posted: Mon Jul 29, 2019 12:10 pm
by Phergus
With just a quick glance at the code I would say it is because most of the method is about making sure that the GUI updates and the clients are updated.

When testing these kinds of issues, you need to test both with and without a server running. With a server running you need to have one or more clients connected so that you can verify the clients are being updated appropriately.

Re: saveMacroButtonProperty for Token - What does it do?

Posted: Mon Jul 29, 2019 4:18 pm
by Merudo
You are right, I checked it out and it doesn't update the macro for clients.

Re: saveMacroButtonProperty for Token - What does it do?

Posted: Mon Jul 29, 2019 4:58 pm
by Phergus
Yeah. That's the kind of thing that has bitten us many times in the past.