Add counters to mobile Forge and adjust desktop counters

This commit is contained in:
Krazy
2017-06-24 21:49:36 +00:00
parent 4a7f967541
commit 5a2d45ba28
11 changed files with 330 additions and 80 deletions

View File

@@ -80,8 +80,9 @@ public final class ForgeConstants {
private static final String CONQUEST_DIR = RES_DIR + "conquest" + PATH_SEPARATOR;
public static final String CONQUEST_PLANES_DIR = CONQUEST_DIR + "planes" + PATH_SEPARATOR;
public static final String SKINS_DIR = RES_DIR + "skins" + PATH_SEPARATOR;
public static final String DEFAULT_SKINS_DIR = SKINS_DIR + "default" + PATH_SEPARATOR;
public static final String SKINS_DIR = RES_DIR + "skins" + PATH_SEPARATOR;
public static final String COMMON_FONTS_DIR = RES_DIR + "fonts" + PATH_SEPARATOR;
public static final String DEFAULT_SKINS_DIR = SKINS_DIR + "default" + PATH_SEPARATOR;
//don't associate these skin files with a directory since skin directory will be determined later
public static final String SPRITE_ICONS_FILE = "sprite_icons.png";
public static final String SPRITE_FOILS_FILE = "sprite_foils.png";
@@ -203,6 +204,31 @@ public final class ForgeConstants {
public static final String AUTO_YIELD_PER_CARD = "Per Card (Each Game)";
public static final String AUTO_YIELD_PER_ABILITY = "Per Ability (Each Match)";
public enum CounterDisplayLocation {
TOP("Top of Card"), BOTTOM("Bottom of Card");
private String name;
CounterDisplayLocation(final String name) {
this.name = name;
}
public String getName() {
return name;
}
public static CounterDisplayLocation from(final String name) {
for (CounterDisplayLocation counterDisplayLocation : values()) {
if (counterDisplayLocation.name.equals(name)) {
return counterDisplayLocation;
}
}
throw new IllegalArgumentException("Counter display location '" + name + "' not found.");
}
}
public enum CounterDisplayType {
/** Use only the new tab-like counter display */

View File

@@ -92,6 +92,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_AUTO_YIELD_MODE (ForgeConstants.AUTO_YIELD_PER_ABILITY),
UI_SHOW_STORM_COUNT_IN_PROMPT ("false"),
UI_CARD_COUNTER_DISPLAY_TYPE(ForgeConstants.CounterDisplayType.TEXT.getName()),
UI_CARD_COUNTER_DISPLAY_LOCATION(ForgeConstants.CounterDisplayLocation.TOP.getName()),
UI_FOR_TOUCHSCREN("false"),