completely abolishing GSON; new save format impl wip

This commit is contained in:
minjaesong
2021-08-23 16:55:51 +09:00
parent df1ebdf93d
commit e15d5c9b05
58 changed files with 421 additions and 2101 deletions

View File

@@ -82,9 +82,10 @@ object Lang {
* "<<STRING ID>>" = "<<LOCALISED TEXT>>"
*/
//println(json.entrySet())
json.entrySet().forEach {
langpack.put("${it.key}_$lang", it.value.asString)
JsonFetcher.forEach(json) { key, value ->
langpack.put("${key}_$lang", value.asString())
}
}
private fun processPolyglotLangFile(file: File, lang: String) {
@@ -106,12 +107,13 @@ object Lang {
* (the array continues)
*
*/
json.getAsJsonObject("resources").getAsJsonArray("data").forEach {
JsonFetcher.forEach(json.get("resources").get("data")) { _, entry ->
langpack.put(
"${it.asJsonObject["n"].asString}_$lang",
it.asJsonObject["s"].asString
"${entry.getString("n")}_$lang",
entry.getString("s")
)
}
}
operator fun get(key: String): String {