mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 03:54:06 +09:00
new import screen
This commit is contained in:
@@ -447,6 +447,13 @@ removefile:
|
||||
fa.close()
|
||||
}
|
||||
|
||||
fun setSaveOrigin(bits: Int) {
|
||||
val fa = RandomAccessFile(diskFile, "rwd")
|
||||
fa.seek(51L)
|
||||
fa.writeByte(bits)
|
||||
fa.close()
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Save type (0b 0000 00ab)
|
||||
* b: unset - full save; set - quicksave (only applicable to worlds -- quicksave just means the disk is in dirty state)
|
||||
@@ -467,6 +474,15 @@ removefile:
|
||||
return fa.read().also { fa.close() }
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 16 if the savegame was imported, 0 if the savegame was generated in-game
|
||||
*/
|
||||
fun getSaveOrigin(): Int {
|
||||
val fa = RandomAccessFile(diskFile, "rwd")
|
||||
fa.seek(51L)
|
||||
return fa.read().also { fa.close() }
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun getDiskName(charset: Charset): String {
|
||||
|
||||
@@ -76,8 +76,11 @@ Version 254 is a customised version of TEVD tailored to be used as a savegame fo
|
||||
0: Undefined (or very old version of the game)
|
||||
1: Player Data
|
||||
2: World Data
|
||||
Int8[13] Extra info bytes reserved for future usage
|
||||
/* END extraInfoBytes */
|
||||
Int8 Savefile Origin Flags
|
||||
0: Created in-game
|
||||
16: Imported
|
||||
Int8[12] Extra info bytes reserved for future usage
|
||||
-- END extraInfoBytes --
|
||||
UInt8[236] Rest of the long disk name (268 bytes total)
|
||||
|
||||
(Header size: 300 bytes)
|
||||
@@ -150,6 +153,9 @@ class VirtualDisk(
|
||||
var saveKind: Int
|
||||
set(value) { extraInfoBytes[2] = value.toByte() }
|
||||
get() = extraInfoBytes[2].toUint()
|
||||
var saveOrigin: Int
|
||||
set(value) { extraInfoBytes[3] = value.toByte() }
|
||||
get() = extraInfoBytes[3].toUint()
|
||||
override fun getDiskName(charset: Charset) = diskName.toCanonicalString(charset)
|
||||
val root: DiskEntry
|
||||
get() = entries[0]!!
|
||||
@@ -249,6 +255,11 @@ object VDSaveKind {
|
||||
const val WORLD_DATA = 2
|
||||
}
|
||||
|
||||
object VDSaveOrigin {
|
||||
const val INGAME = 0
|
||||
const val IMPORTED = 16
|
||||
}
|
||||
|
||||
object VDFileID {
|
||||
const val ROOT = 0L
|
||||
const val SAVEGAMEINFO = -1L
|
||||
|
||||
Reference in New Issue
Block a user