Usage of ExtendedPreferences
This commit is contained in:
@@ -45,7 +45,7 @@ public class Saves{
|
||||
|
||||
public void load(){
|
||||
saves.clear();
|
||||
IntArray slots = Settings.getBinary("save-slots", IntArray.class, IntArray::new);
|
||||
IntArray slots = Settings.getObject("save-slots", IntArray.class, IntArray::new);
|
||||
|
||||
for(int i = 0; i < slots.size; i ++){
|
||||
int index = slots.get(i);
|
||||
@@ -143,7 +143,7 @@ public class Saves{
|
||||
IntArray result = new IntArray(saves.size);
|
||||
for(int i = 0; i < saves.size; i++) result.add(saves.get(i).index);
|
||||
|
||||
Settings.putBinary("save-slots", result);
|
||||
Settings.putObject("save-slots", result);
|
||||
Settings.save();
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public class Unlocks{
|
||||
public void load(){
|
||||
sets.clear();
|
||||
|
||||
ObjectMap<String, ObjectMap<ContentType, Array<String>>> result = Settings.getBinary("content-sets", ObjectMap.class, () -> new ObjectMap<>());
|
||||
ObjectMap<String, ObjectMap<ContentType, Array<String>>> result = Settings.getObject("content-sets", ObjectMap.class, () -> new ObjectMap<>());
|
||||
|
||||
for(Entry<String, ObjectMap<ContentType, Array<String>>> outer : result.entries()){
|
||||
ContentUnlockSet cset = new ContentUnlockSet();
|
||||
@@ -102,7 +102,7 @@ public class Unlocks{
|
||||
output.put(centry.key, write);
|
||||
}
|
||||
|
||||
Settings.putBinary("content-sets", output);
|
||||
Settings.putObject("content-sets", output);
|
||||
Settings.save();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user