mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-14 07:36:06 +09:00
writing config to disk
This commit is contained in:
@@ -297,6 +297,7 @@ public class App implements ApplicationListener {
|
||||
// load configs
|
||||
getDefaultDirectory();
|
||||
createDirs();
|
||||
initialiseConfig();
|
||||
readConfigJson();
|
||||
updateListOfSavegames();
|
||||
|
||||
@@ -988,7 +989,7 @@ public class App implements ApplicationListener {
|
||||
|
||||
// CONFIG //
|
||||
|
||||
private static KVHashMap gameConfig = new KVHashMap();
|
||||
public static KVHashMap gameConfig = new KVHashMap();
|
||||
|
||||
private static void createConfigJson() throws IOException {
|
||||
File configFile = new File(configDir);
|
||||
@@ -998,6 +999,15 @@ public class App implements ApplicationListener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads DefaultConfig to populate the gameConfig
|
||||
*/
|
||||
private static void initialiseConfig() {
|
||||
for (Map.Entry<String, Object> entry : DefaultConfig.INSTANCE.getHashMap().entrySet()) {
|
||||
gameConfig.set(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return true on successful, false on failure.
|
||||
|
||||
Reference in New Issue
Block a user