new save format wip (no branching on this commit)

This commit is contained in:
minjaesong
2021-10-07 14:40:04 +09:00
parent d6a22f6567
commit 6d8a7520ac
15 changed files with 94 additions and 39 deletions

View File

@@ -287,7 +287,7 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
private fun postInitForLoadFromSave(codices: Codices) {
codices.actors.forEach {
try {
val actor = ReadActor(LoadSavegame.getFileReader(codices.disk, it.toLong()))
val actor = ReadActor(codices.disk, LoadSavegame.getFileReader(codices.disk, it.toLong()))
addNewActor(actor)
}
catch (e: NullPointerException) {

View File

@@ -34,7 +34,7 @@ object ImportWorld : ConsoleCommand {
Echo("Usage: Importworld filename-without-extension")
}
}
/*
object ImportActor : ConsoleCommand {
override fun execute(args: Array<String>) {
if (args.size == 2) {
@@ -56,4 +56,4 @@ object ImportActor : ConsoleCommand {
override fun printUsage() {
Echo("Usage: Importactor filename-without-extension")
}
}
}*/

View File

@@ -1,6 +1,8 @@
package net.torvald.terrarum.modulebasegame.gameactors
import com.badlogic.gdx.Gdx
import net.torvald.spriteanimation.HasAssembledSprite
import net.torvald.spriteassembler.ADProperties
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.gameactors.AVKey
@@ -13,15 +15,15 @@ import net.torvald.terrarum.gameactors.AVKey
class IngamePlayer : ActorHumanoid, HasAssembledSprite {
override var animDescPath = "invalid"
override var animDescPathGlow: String? = null
override var animDesc: ADProperties? = null
override var animDescGlow: ADProperties? = null
internal var worldCurrentlyPlaying = 0 // only filled up on save and load; DO NOT USE THIS
private constructor()
constructor(animDescPath: String, animDescPathGlow: String?, born: Long) : super(born) {
this.animDescPath = animDescPath
this.animDescPathGlow = animDescPathGlow
animDesc = ADProperties(Gdx.files.internal(animDescPath))
if (animDescPathGlow != null) animDescGlow = ADProperties(Gdx.files.internal(animDescPathGlow))
actorValue[AVKey.__HISTORICAL_BORNTIME] = born
}

View File

@@ -31,7 +31,7 @@ object PlayerBuilderTestSubject1 {
p.sprite = SpriteAnimation(p)
p.spriteGlow = SpriteAnimation(p)
p.reassembleSprite(p.sprite!!, p.spriteGlow)
p.reassembleSprite(p.sprite, p.animDesc, p.spriteGlow, p.animDescGlow)
p.setHitboxDimension(15, p.actorValue.getAsInt(AVKey.BASEHEIGHT) ?: ActorHumanoid.BASE_HEIGHT, 21, 0)
// ingame must teleport the player to the spawn point

View File

@@ -31,7 +31,7 @@ object PlayerBuilderWerebeastTest {
p.sprite = SpriteAnimation(p)
p.spriteGlow = SpriteAnimation(p)
p.reassembleSprite(p.sprite!!, p.spriteGlow)
p.reassembleSprite(p.sprite, p.animDesc, p.spriteGlow, p.animDescGlow)
p.setHitboxDimension(22, p.actorValue.getAsInt(AVKey.BASEHEIGHT)!!, 30, 0)
p.setPosition(3.0 * TILE_SIZE, 3.0 * TILE_SIZE)

View File

@@ -28,7 +28,6 @@ class UIProxyNewBuildingMaker : UICanvas() {
}
override fun doClosing(delta: Float) {
TODO("not implemented")
}
override fun endOpening(delta: Float) {
@@ -40,10 +39,8 @@ class UIProxyNewBuildingMaker : UICanvas() {
}
override fun endClosing(delta: Float) {
TODO("not implemented")
}
override fun dispose() {
TODO("not implemented")
}
}

View File

@@ -31,7 +31,6 @@ class UIProxyNewRandomGame : UICanvas() {
}
override fun doClosing(delta: Float) {
TODO("not implemented")
}
override fun endOpening(delta: Float) {