mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
asset archiving wip, font update
This commit is contained in:
@@ -40,7 +40,10 @@ object CSVFetcher {
|
||||
return csvRecordList
|
||||
}
|
||||
|
||||
fun readFromModule(module: String, path: String) = net.torvald.terrarum.utils.CSVFetcher.readFromFile(ModMgr.getGdxFile(module, path).path())
|
||||
fun readFromModule(module: String, path: String): List<org.apache.commons.csv.CSVRecord> {
|
||||
val content = ModMgr.getGdxFile(module, path).readString("UTF-8")
|
||||
return readFromString(content)
|
||||
}
|
||||
|
||||
fun readFromString(csv: String): List<org.apache.commons.csv.CSVRecord> {
|
||||
val preprocessed = preprocessCSV(csv)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.torvald.terrarum.utils
|
||||
|
||||
import com.badlogic.gdx.files.FileHandle
|
||||
import com.badlogic.gdx.utils.JsonReader
|
||||
import com.badlogic.gdx.utils.JsonValue
|
||||
import net.torvald.terrarum.App.printdbg
|
||||
@@ -36,6 +37,13 @@ object JsonFetcher {
|
||||
return JsonReader().parse(jsonString.toString())
|
||||
}
|
||||
|
||||
@Throws(java.io.IOException::class)
|
||||
operator fun invoke(fileHandle: FileHandle): JsonValue {
|
||||
val content = fileHandle.readString("UTF-8")
|
||||
printdbg(this, "Reading JSON ${fileHandle.path()}")
|
||||
return JsonReader().parse(content)
|
||||
}
|
||||
|
||||
fun readFromJsonString(stringReader: Reader): JsonValue {
|
||||
return JsonReader().parse(stringReader.readText())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user