RPTools.net

Discussion and Support

Skip to content

It is currently Sun Sep 24, 2017 4:08 pm 






Reply to topic  [ 3 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Cave Troll
 
Joined: Sat Nov 25, 2006 8:51 pm
Posts: 65
Location: Chicago
 Post subject: PersistenceUtil.java patch request
PostPosted: Mon Nov 07, 2011 7:57 pm 
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:

Quote:
public static void saveToken(Token token, String string ) throws IOException {
// Thumbnail
BufferedImage image = ImageManager.getImage( token.getImageAssetId() );


To:
Quote:
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


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri May 12, 2006 7:56 pm
Posts: 6300
Location: Las Cruces, NM
 Post subject: Re: PersistenceUtil.java patch request
PostPosted: Mon Nov 07, 2011 9:05 pm 
You'll want to send a patch file to Azhrei.

_________________
Call me, Hex Boy.

Visit http://www.darkisle.com for photos of castles, cairns, standing stones, and other ancient sites in the British Isles.


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Sat Nov 25, 2006 8:51 pm
Posts: 65
Location: Chicago
 Post subject: Re: PersistenceUtil.java patch request
PostPosted: Mon Nov 07, 2011 10:34 pm 
thanks, sent it over.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 3 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 2 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman