Page 1 of 1

PersistenceUtil.java patch request

Posted: Mon Nov 07, 2011 7:57 pm
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

Re: PersistenceUtil.java patch request

Posted: Mon Nov 07, 2011 9:05 pm
by Phergus
You'll want to send a patch file to Azhrei.

Re: PersistenceUtil.java patch request

Posted: Mon Nov 07, 2011 10:34 pm
by sozin
thanks, sent it over.