PersistenceUtil.java patch request

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

Moderators: dorpond, trevor, Azhrei

Post Reply
sozin
Cave Troll
Posts: 65
Joined: Sat Nov 25, 2006 8:51 pm
Location: Chicago
Contact:

PersistenceUtil.java patch request

Post by sozin »

Hello,

I'm midway through a Herolabs -> Maptools token importer, and had to make a non-invasive patch to PersistenceUtil.java to pull it off.

Here's my change; from:
public static void saveToken(Token token, String string ) throws IOException {
// Thumbnail
BufferedImage image = ImageManager.getImage( token.getImageAssetId() );
To:
public static void saveToken(Token token, String string ) throws IOException {
saveToken( token, string, false );
}

public static void saveToken(Token token, String string, boolean doWait ) throws IOException {
// Thumbnail
BufferedImage image = null;

if ( doWait ) {
image = ImageManager.getImageAndWait(token.getImageAssetId());
}
else {
image = ImageManager.getImage( token.getImageAssetId() );
}
Backwards compatible for existing users; allows me to persist a token with an image gracefully. (without this change the token just shows up with the TRANSFERRING IMAGE '?' icon.)

Can submit a patch file too if that helps.

Cheers

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

Re: PersistenceUtil.java patch request

Post by Phergus »

You'll want to send a patch file to Azhrei.

sozin
Cave Troll
Posts: 65
Joined: Sat Nov 25, 2006 8:51 pm
Location: Chicago
Contact:

Re: PersistenceUtil.java patch request

Post by sozin »

thanks, sent it over.

Post Reply

Return to “Developer Notes”