Separated langpack, concept art for inventory UI

Former-commit-id: 7a98df93b4ef50b47283abcd99576d6fbefc9cc5
Former-commit-id: db6e34417ccf84e59ba68547f30459cb4b188eb7
This commit is contained in:
Song Minjae
2016-07-04 23:08:16 +09:00
parent 2ed435165a
commit 2e46df67a8
91 changed files with 70088 additions and 720 deletions

View File

@@ -2,6 +2,7 @@ package net.torvald
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import java.io.File
import java.io.IOException
import java.nio.file.FileSystems
@@ -27,6 +28,17 @@ object JsonFetcher {
return jsonObj
}
@Throws(IOException::class)
fun readJson(jsonFile: File): JsonObject {
jsonString = StringBuffer() // reset buffer every time it called
readJsonFileAsString(jsonFile.canonicalPath)
val jsonParser = JsonParser()
val jsonObj = jsonParser.parse(jsonString!!.toString()).asJsonObject
return jsonObj
}
@Throws(IOException::class)
private fun readJsonFileAsString(path: String) {
Files.lines(FileSystems.getDefault().getPath(path)).forEach(