mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
make cardPicsDir separately configurable
This commit is contained in:
@@ -33,9 +33,11 @@ import org.apache.commons.lang3.tuple.Pair;
|
|||||||
public class ForgeProfileProperties {
|
public class ForgeProfileProperties {
|
||||||
public final String userDir;
|
public final String userDir;
|
||||||
public final String cacheDir;
|
public final String cacheDir;
|
||||||
|
public final String cardPicsDir;
|
||||||
|
|
||||||
private final String _USER_DIR_KEY = "userDir";
|
private final String _USER_DIR_KEY = "userDir";
|
||||||
private final String _CACHE_DIR_KEY = "cacheDir";
|
private final String _CACHE_DIR_KEY = "cacheDir";
|
||||||
|
private final String _CARD_PICS_DIR_KEY = "cardPicsDir";
|
||||||
|
|
||||||
public ForgeProfileProperties(String filename) {
|
public ForgeProfileProperties(String filename) {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
@@ -60,8 +62,12 @@ public class ForgeProfileProperties {
|
|||||||
propUserDir += propUserDir.endsWith("/") || propUserDir.endsWith(File.pathSeparator) ? "" : "/";
|
propUserDir += propUserDir.endsWith("/") || propUserDir.endsWith(File.pathSeparator) ? "" : "/";
|
||||||
propCacheDir += propCacheDir.endsWith("/") || propCacheDir.endsWith(File.pathSeparator) ? "" : "/";
|
propCacheDir += propCacheDir.endsWith("/") || propCacheDir.endsWith(File.pathSeparator) ? "" : "/";
|
||||||
|
|
||||||
userDir = propUserDir;
|
String propCardPicsDir = props.getProperty(_CARD_PICS_DIR_KEY, propCacheDir + "pics/cards/");
|
||||||
cacheDir = propCacheDir;
|
propCardPicsDir += propCardPicsDir.endsWith("/") || propCardPicsDir.endsWith(File.pathSeparator) ? "" : "/";
|
||||||
|
|
||||||
|
userDir = propUserDir;
|
||||||
|
cacheDir = propCacheDir;
|
||||||
|
cardPicsDir = propCardPicsDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns a pair <userDir, cacheDir>
|
// returns a pair <userDir, cacheDir>
|
||||||
|
|||||||
@@ -49,10 +49,12 @@ public final class NewConstants {
|
|||||||
// data tree roots
|
// data tree roots
|
||||||
private static final String _USER_DIR;
|
private static final String _USER_DIR;
|
||||||
private static final String _CACHE_DIR;
|
private static final String _CACHE_DIR;
|
||||||
|
public static final String CACHE_CARD_PICS_DIR;
|
||||||
static {
|
static {
|
||||||
ForgeProfileProperties profileProps = new ForgeProfileProperties(PROFILE_FILE);
|
ForgeProfileProperties profileProps = new ForgeProfileProperties(PROFILE_FILE);
|
||||||
_USER_DIR = profileProps.userDir;
|
_USER_DIR = profileProps.userDir;
|
||||||
_CACHE_DIR = profileProps.cacheDir;
|
_CACHE_DIR = profileProps.cacheDir;
|
||||||
|
CACHE_CARD_PICS_DIR = profileProps.cardPicsDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
// data that is only in the profile dirs
|
// data that is only in the profile dirs
|
||||||
@@ -78,9 +80,8 @@ public final class NewConstants {
|
|||||||
public static final FileLocation EDITOR_LAYOUT_FILE = new FileLocation(_DEFAULTS_DIR, _USER_PREFS_DIR, "editor.xml");
|
public static final FileLocation EDITOR_LAYOUT_FILE = new FileLocation(_DEFAULTS_DIR, _USER_PREFS_DIR, "editor.xml");
|
||||||
|
|
||||||
// data that is only in the cached dir
|
// data that is only in the cached dir
|
||||||
private static final String _DB_DIR = _CACHE_DIR + "db/";
|
private static final String _DB_DIR = _CACHE_DIR + "db/";
|
||||||
private static final String _PICS_DIR = _CACHE_DIR + "pics/";
|
private static final String _PICS_DIR = _CACHE_DIR + "pics/";
|
||||||
public static final String CACHE_CARD_PICS_DIR = _PICS_DIR + "cards/";
|
|
||||||
public static final String CACHE_TOKEN_PICS_DIR = _PICS_DIR + "tokens/";
|
public static final String CACHE_TOKEN_PICS_DIR = _PICS_DIR + "tokens/";
|
||||||
public static final String CACHE_ICON_PICS_DIR = _PICS_DIR + "icons/";
|
public static final String CACHE_ICON_PICS_DIR = _PICS_DIR + "icons/";
|
||||||
public static final String CACHE_BOOSTER_PICS_DIR = _PICS_DIR + "boosters/";
|
public static final String CACHE_BOOSTER_PICS_DIR = _PICS_DIR + "boosters/";
|
||||||
|
|||||||
Reference in New Issue
Block a user