saveMacroButtonProperty for Token - What does it do?

Progress reports and musings from the developers on the current gaming tools.

Moderators: dorpond, trevor, Azhrei

Post Reply
Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

saveMacroButtonProperty for Token - What does it do?

Post 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.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: saveMacroButtonProperty for Token - What does it do?

Post 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.

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: saveMacroButtonProperty for Token - What does it do?

Post by Merudo »

You are right, I checked it out and it doesn't update the macro for clients.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: saveMacroButtonProperty for Token - What does it do?

Post by Phergus »

Yeah. That's the kind of thing that has bitten us many times in the past.

Post Reply

Return to “Developer Notes”