v0.8.2: Finished news implementation, including a full news scene
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user