asset archiving wip, font update

This commit is contained in:
minjaesong
2026-02-19 09:53:32 +09:00
parent 661d516800
commit 04b49b8a5c
80 changed files with 617 additions and 336 deletions

View File

@@ -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)

View File

@@ -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())
}