v0.8.2: Finished news implementation, including a full news scene

This commit is contained in:
Evan Debenham
2020-07-18 18:26:24 -04:00
parent 0d9715b732
commit 81bdd42e7e
10 changed files with 450 additions and 19 deletions

View File

@@ -66,6 +66,27 @@ public class GameSettings {
return defValue;
}
}
public static long getLong( String key, long defValue ) {
return getLong(key, defValue, Long.MIN_VALUE, Long.MAX_VALUE);
}
public static long getLong( String key, long defValue, long min, long max ) {
try {
long i = get().getLong( key, defValue );
if (i < min || i > max){
long val = (long)GameMath.gate(min, i, max);
put(key, val);
return val;
} else {
return i;
}
} catch (ClassCastException e) {
//ShatteredPixelDungeon.reportException(e);
put(key, defValue);
return defValue;
}
}
public static boolean getBoolean( String key, boolean defValue ) {
try {
@@ -101,6 +122,11 @@ public class GameSettings {
get().putInteger(key, value);
get().flush();
}
public static void put( String key, long value ) {
get().putLong(key, value);
get().flush();
}
public static void put( String key, boolean value ) {
get().putBoolean(key, value);