mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
some gui stuff for imported players
This commit is contained in:
@@ -167,8 +167,10 @@ class SavegameCollectionPair(private val player: SavegameCollection?, private va
|
||||
// private var autoPlayer: DiskSkimmer? = null
|
||||
// private var autoWorld: DiskSkimmer? = null
|
||||
|
||||
var isImported: Boolean = false; private set
|
||||
|
||||
/* removing auto/manual discrimination: on Local Asynchronous Multiplayer, if newer autosave is available, there is
|
||||
* no choice but loading one to preserve the data; then why bother having two? */
|
||||
* no choice but loading one to preserve the data; then why bother having two? */
|
||||
private var playerDisk: DiskSkimmer? = null; private set
|
||||
private var worldDisk: DiskSkimmer? = null; private set
|
||||
|
||||
@@ -221,6 +223,10 @@ class SavegameCollectionPair(private val player: SavegameCollection?, private va
|
||||
2
|
||||
else (player != null && world != null).toInt()
|
||||
|
||||
if (player != null) {
|
||||
isImported = (player.loadable().getSaveOrigin() and VDSaveOrigin.IMPORTED != 0)
|
||||
}
|
||||
|
||||
printdbg(this, "playerDisk = ${playerDisk?.diskFile?.path}")
|
||||
printdbg(this, "worldDisk = ${worldDisk?.diskFile?.path}")
|
||||
printdbg(this, "status = $status")
|
||||
|
||||
@@ -517,6 +517,8 @@ class UIItemPlayerCells(
|
||||
// internal val pixmapAuto: Pixmap?
|
||||
internal val savegameThumbnailPixmap: Pixmap?
|
||||
|
||||
private val isImported: Boolean
|
||||
|
||||
init {
|
||||
App.savegamePlayers[playerUUID]!!.loadable().getFile(SAVEGAMEINFO)?.bytes?.let {
|
||||
var lastPlayTime0 = 0L
|
||||
@@ -541,6 +543,8 @@ class UIItemPlayerCells(
|
||||
// pixmapManual = savegamePair.getManualSave()?.player?.getThumbnailPixmap(SAVE_THUMBNAIL_MAIN_WIDTH, SAVE_THUMBNAIL_MAIN_HEIGHT, 2.0)
|
||||
// pixmapAuto = savegamePair.getAutoSave()?.player?.getThumbnailPixmap(SAVE_THUMBNAIL_MAIN_WIDTH, SAVE_THUMBNAIL_MAIN_HEIGHT, 2.0)
|
||||
savegameThumbnailPixmap = savegamePair.getLoadableSave()?.player?.getThumbnailPixmap(SAVE_THUMBNAIL_MAIN_WIDTH, SAVE_THUMBNAIL_MAIN_HEIGHT, 2.0)
|
||||
|
||||
isImported = savegamePair.isImported
|
||||
}
|
||||
|
||||
private fun parseDuration(seconds: Long): String {
|
||||
@@ -618,11 +622,19 @@ class UIItemPlayerCells(
|
||||
batch.draw(icons.get(13,0), x + avatarViewWidth + 14f - 0, line3 + 2f) // journal
|
||||
batch.draw(icons.get(22,1), x + avatarViewWidth + 14f - 1, line4 + 2f) // version(?)
|
||||
batch.draw(icons.get(23,0), x + width - 4f - playTimeTextLen - 24f, line4 + 2f) // stopwatch
|
||||
// autosave marker
|
||||
if (savegameStatus == 2)
|
||||
batch.draw(icons.get(24,1), x + width - 23f, line1 + 2f)
|
||||
else if (savegameStatus == 0)
|
||||
batch.draw(icons.get(23,1), x + width - 23f, line1 + 2f)
|
||||
|
||||
// save status marker
|
||||
(if (isImported)
|
||||
icons.get(21,1)
|
||||
else if (savegameStatus == 2) // newer autosave
|
||||
icons.get(24,1)
|
||||
else if (savegameStatus == 0) // no world data found
|
||||
icons.get(23,1)
|
||||
else null)?.let {
|
||||
batch.draw(it, x + width - 25f, line1 + 2f)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// infocell divider
|
||||
batch.color = if (mouseUp) hruleColLit else hruleCol
|
||||
|
||||
Reference in New Issue
Block a user