mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-18 06:24:06 +09:00
moved things a lot just so that splash screen shows up WHILE things load
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
package net.torvald.terrarum.serialise
|
||||
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import java.io.File
|
||||
import java.io.FileFilter
|
||||
import java.io.FileInputStream
|
||||
|
||||
|
||||
|
||||
object SavegameLedger {
|
||||
|
||||
private val SAVE_DIRECTORY = File(Terrarum.defaultSaveDir)
|
||||
private val SAVE_DIRECTORY = File(AppLoader.defaultSaveDir)
|
||||
|
||||
fun hasSavegameDirectory() = SAVE_DIRECTORY.exists() && SAVE_DIRECTORY.isDirectory
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package net.torvald.terrarum.serialise
|
||||
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import java.io.IOException
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
@@ -20,11 +20,11 @@ internal object WriteCSV {
|
||||
//val itemCSV = CSVFetcher.readCSVasString(ItemCodex.CSV_PATH)
|
||||
//val matCSV = CSVFetcher.readCSVasString(MaterialCodex.CSV_PATH)
|
||||
|
||||
val pathTile = Paths.get("${Terrarum.defaultSaveDir}" +
|
||||
val pathTile = Paths.get("${AppLoader.defaultSaveDir}" +
|
||||
"/$saveDirectoryName/${META_FILENAME_TILE}")
|
||||
val pathItem = Paths.get("${Terrarum.defaultSaveDir}" +
|
||||
val pathItem = Paths.get("${AppLoader.defaultSaveDir}" +
|
||||
"/$saveDirectoryName/${META_FILENAME_ITEM}")
|
||||
val pathMat = Paths.get("${Terrarum.defaultSaveDir}" +
|
||||
val pathMat = Paths.get("${AppLoader.defaultSaveDir}" +
|
||||
"/$saveDirectoryName/${META_FILENAME_MAT}")
|
||||
val tempPathTile = Files.createTempFile(pathTile.toString(), "_temp")
|
||||
val tempPathItem = Files.createTempFile(pathItem.toString(), "_temp")
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package net.torvald.terrarum.serialise
|
||||
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.IOException
|
||||
@@ -26,11 +27,11 @@ internal object WriteLayerData {
|
||||
|
||||
|
||||
internal operator fun invoke(saveDirectoryName: String): Boolean {
|
||||
val path = "${Terrarum.defaultSaveDir}/$saveDirectoryName/${LAYERS_FILENAME}"
|
||||
val path = "${AppLoader.defaultSaveDir}/$saveDirectoryName/${LAYERS_FILENAME}"
|
||||
val tempPath = "${path}_bak"
|
||||
val map = (Terrarum.ingame!!.world)
|
||||
|
||||
val parentDir = File("${Terrarum.defaultSaveDir}/$saveDirectoryName")
|
||||
val parentDir = File("${AppLoader.defaultSaveDir}/$saveDirectoryName")
|
||||
if (!parentDir.exists()) {
|
||||
parentDir.mkdir()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.serialise
|
||||
|
||||
import com.badlogic.gdx.utils.compression.Lzma
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
@@ -51,11 +52,11 @@ internal object WriteLayerDataLzma {
|
||||
internal operator fun invoke(): File? {
|
||||
val world = (Terrarum.ingame!!.world)
|
||||
|
||||
val path = "${Terrarum.defaultSaveDir}/tmp_$LAYERS_FILENAME${world.worldIndex}"
|
||||
val path = "${AppLoader.defaultSaveDir}/tmp_$LAYERS_FILENAME${world.worldIndex}"
|
||||
|
||||
// TODO let's try dump-on-the-disk-then-pack method...
|
||||
|
||||
/*val parentDir = File("${Terrarum.defaultSaveDir}/$saveDirectoryName")
|
||||
/*val parentDir = File("${AppLoader.defaultSaveDir}/$saveDirectoryName")
|
||||
if (!parentDir.exists()) {
|
||||
parentDir.mkdir()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.torvald.terrarum.serialise
|
||||
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
@@ -57,11 +58,11 @@ internal object WriteLayerDataZip {
|
||||
internal operator fun invoke(): File? {
|
||||
val world = (Terrarum.ingame!!.world)
|
||||
|
||||
val path = "${Terrarum.defaultSaveDir}/tmp_$LAYERS_FILENAME${world.worldIndex}"
|
||||
val path = "${AppLoader.defaultSaveDir}/tmp_$LAYERS_FILENAME${world.worldIndex}"
|
||||
|
||||
// TODO let's try dump-on-the-disk-then-pack method...
|
||||
|
||||
/*val parentDir = File("${Terrarum.defaultSaveDir}/$saveDirectoryName")
|
||||
/*val parentDir = File("${AppLoader.defaultSaveDir}/$saveDirectoryName")
|
||||
if (!parentDir.exists()) {
|
||||
parentDir.mkdir()
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ internal object WriteMeta {
|
||||
props.map { hashArray.add(DigestUtils.sha256(it)) }
|
||||
|
||||
// open file and delete it
|
||||
val metaPath = Paths.get("$Terrarum.defaultSaveDir" +
|
||||
val metaPath = Paths.get("$AppLoader.defaultSaveDir" +
|
||||
"/$saveDirectoryName/$META_FILENAME")
|
||||
val metaTempPath = Files.createTempFile(metaPath.toString(), "_temp")
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.serialise
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.ModMgr
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.PlayerBuilder
|
||||
@@ -29,7 +30,7 @@ object WriteWorldInfo {
|
||||
internal operator fun invoke(): List<File>? {
|
||||
val world = (Terrarum.ingame!!.world)
|
||||
|
||||
val path = "${Terrarum.defaultSaveDir}/tmp_worldinfo"
|
||||
val path = "${AppLoader.defaultSaveDir}/tmp_worldinfo"
|
||||
|
||||
val infileList = arrayOf(
|
||||
ModMgr.getGdxFilesFromEveryMod("blocks/blocks.csv"),
|
||||
|
||||
Reference in New Issue
Block a user