mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Support connecting to AppData
Support loading card images
This commit is contained in:
@@ -38,7 +38,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
@@ -66,16 +65,9 @@ public class ImageCache {
|
||||
static {
|
||||
BufferedImage defImage = null;
|
||||
try {
|
||||
ClassLoader cl = Thread.currentThread().getContextClassLoader();
|
||||
InputStream isNoCardJpg = cl.getResourceAsStream("no_card.jpg");
|
||||
defImage = ImageIO.read(isNoCardJpg);
|
||||
} catch (Exception e) {
|
||||
// resource not found; perhaps we're running straight from source
|
||||
try {
|
||||
defImage = ImageIO.read(new File("src/main/resources/no_card.jpg"));
|
||||
} catch (Exception ex) {
|
||||
System.err.println("could not load default card image");
|
||||
}
|
||||
defImage = ImageIO.read(new File(NewConstants.NO_CARD_FILE));
|
||||
} catch (Exception ex) {
|
||||
System.err.println("could not load default card image");
|
||||
} finally {
|
||||
_defaultImage = (null == defImage) ? new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB) : defImage;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public final class NewConstants {
|
||||
public static final String CARD_DATA_DIR = _RES_ROOT + "cardsfolder/";
|
||||
public static final String DECK_CUBE_DIR = _RES_ROOT + "cube";
|
||||
public static final String AI_PROFILE_DIR = _RES_ROOT + "ai";
|
||||
public static final String NO_CARD_FILE = _RES_ROOT + "defaults/no_card.jpg";
|
||||
public static final String QUEST_WORLD_DIR = _QUEST_DIR + "worlds/";
|
||||
public static final String QUEST_PRECON_DIR = _QUEST_DIR + "precons/";
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB |
Reference in New Issue
Block a user