mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 18:14:06 +09:00
writing savemode to the savegame binary
This commit is contained in:
@@ -291,6 +291,8 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
// by doing this, whatever the "possession" the player had will be broken by the game load
|
||||
actorNowPlaying = getActorByID(Terrarum.PLAYER_REF_ID) as IngamePlayer
|
||||
|
||||
makeSavegameBackupCopy() // don't put it on the postInit() or render(); postInitForNewGame calls this function on the savegamewriter's callback
|
||||
}
|
||||
|
||||
private fun postInitForNewGame() {
|
||||
@@ -314,7 +316,7 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
// make initial savefile
|
||||
WriteSavegame.immediate(savegameArchive, getSaveFileMain(), this) {
|
||||
makeSavegameBackupCopy()
|
||||
makeSavegameBackupCopy() // don't put it on the postInit() or render(); must be called using callback
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ object Quicksave : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
val ingame = Terrarum.ingame!! as TerrarumIngame
|
||||
|
||||
WriteSavegame.quick(ingame.savegameArchive, ingame.getSaveFileMain(), ingame) {
|
||||
WriteSavegame.quick(ingame.savegameArchive, ingame.getSaveFileMain(), ingame, false) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +359,8 @@ class UIItemDemoSaveCells(
|
||||
// file size
|
||||
App.fontSmallNumbers.draw(batch, "${disk.usedBytes.ushr(10)} KiB", x + 3f, y + height - 16f)
|
||||
// savegame name
|
||||
App.fontGame.draw(batch, disk.getDiskNameString(Common.CHARSET), x + 3f, y + 1f)
|
||||
val diskName = disk.getDiskNameString(Common.CHARSET)
|
||||
App.fontGame.draw(batch, diskName + "${if (disk.saveMode % 2 == 1) "*" else ""}", x + 3f, y + 1f)
|
||||
|
||||
super.render(batch, camera)
|
||||
batch.color = Color.WHITE
|
||||
|
||||
Reference in New Issue
Block a user