mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
Merge branch 'android-improvements' of git.cardforge.org:jamincollins/forge into update-and-merge-1
This commit is contained in:
@@ -68,18 +68,27 @@ public class FilesPage extends TabPage<SettingsScreen> {
|
|||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
//storage locations
|
//storage locations
|
||||||
lstItems.addItem(new StorageOption("Data Location (e.g. Settings, Decks, Quests)", ForgeProfileProperties.getUserDir()) {
|
|
||||||
@Override
|
|
||||||
protected void onDirectoryChanged(String newDir) {
|
|
||||||
ForgeProfileProperties.setUserDir(newDir);
|
|
||||||
}
|
|
||||||
}, 1);
|
|
||||||
final StorageOption cardPicsOption = new StorageOption("Card Pics Location", ForgeProfileProperties.getCardPicsDir()) {
|
final StorageOption cardPicsOption = new StorageOption("Card Pics Location", ForgeProfileProperties.getCardPicsDir()) {
|
||||||
@Override
|
@Override
|
||||||
protected void onDirectoryChanged(String newDir) {
|
protected void onDirectoryChanged(String newDir) {
|
||||||
ForgeProfileProperties.setCardPicsDir(newDir);
|
ForgeProfileProperties.setCardPicsDir(newDir);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
final StorageOption decksOption = new StorageOption("Decks Location", ForgeProfileProperties.getDecksDir()) {
|
||||||
|
@Override
|
||||||
|
protected void onDirectoryChanged(String newDir) {
|
||||||
|
ForgeProfileProperties.setDecksDir(newDir);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
lstItems.addItem(new StorageOption("Data Location (e.g. Settings, Decks, Quests)", ForgeProfileProperties.getUserDir()) {
|
||||||
|
@Override
|
||||||
|
protected void onDirectoryChanged(String newDir) {
|
||||||
|
ForgeProfileProperties.setUserDir(newDir);
|
||||||
|
|
||||||
|
//ensure decks option is updated if needed
|
||||||
|
decksOption.updateDir(ForgeProfileProperties.getDecksDir());
|
||||||
|
}
|
||||||
|
}, 1);
|
||||||
lstItems.addItem(new StorageOption("Image Cache Location", ForgeProfileProperties.getCacheDir()) {
|
lstItems.addItem(new StorageOption("Image Cache Location", ForgeProfileProperties.getCacheDir()) {
|
||||||
@Override
|
@Override
|
||||||
protected void onDirectoryChanged(String newDir) {
|
protected void onDirectoryChanged(String newDir) {
|
||||||
@@ -90,6 +99,7 @@ public class FilesPage extends TabPage<SettingsScreen> {
|
|||||||
}
|
}
|
||||||
}, 1);
|
}, 1);
|
||||||
lstItems.addItem(cardPicsOption, 1);
|
lstItems.addItem(cardPicsOption, 1);
|
||||||
|
lstItems.addItem(decksOption, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ public class ForgeProfileProperties {
|
|||||||
private static void save() {
|
private static void save() {
|
||||||
final Pair<String, String> defaults = getDefaultDirs();
|
final Pair<String, String> defaults = getDefaultDirs();
|
||||||
final String defaultUserDir = defaults.getLeft() + File.separator;
|
final String defaultUserDir = defaults.getLeft() + File.separator;
|
||||||
|
final String defaultDecksDir = defaultUserDir + "decks" + File.separator;
|
||||||
final String defaultCacheDir = defaults.getRight() + File.separator;
|
final String defaultCacheDir = defaults.getRight() + File.separator;
|
||||||
final String defaultCardPicsDir = defaultCacheDir + "pics" + File.separator + "cards" + File.separator;
|
final String defaultCardPicsDir = defaultCacheDir + "pics" + File.separator + "cards" + File.separator;
|
||||||
|
|
||||||
@@ -213,6 +214,9 @@ public class ForgeProfileProperties {
|
|||||||
if (!userDir.equals(defaultUserDir)) { //ensure backslashes are escaped
|
if (!userDir.equals(defaultUserDir)) { //ensure backslashes are escaped
|
||||||
sb.append(USER_DIR_KEY + "=" + userDir.replace("\\", "\\\\") + "\n");
|
sb.append(USER_DIR_KEY + "=" + userDir.replace("\\", "\\\\") + "\n");
|
||||||
}
|
}
|
||||||
|
if (!decksDir.equals(defaultDecksDir)) {
|
||||||
|
sb.append(DECKS_DIR_KEY + "=" + decksDir.replace("\\", "\\\\") + "\n");
|
||||||
|
}
|
||||||
if (!cacheDir.equals(defaultCacheDir)) {
|
if (!cacheDir.equals(defaultCacheDir)) {
|
||||||
sb.append(CACHE_DIR_KEY + "=" + cacheDir.replace("\\", "\\\\") + "\n");
|
sb.append(CACHE_DIR_KEY + "=" + cacheDir.replace("\\", "\\\\") + "\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user