From 23af64deb47a2cedda6b9ffa08474bd240184c82 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Wed, 28 Jun 2023 16:42:38 +0900 Subject: [PATCH] proper savegame backups sorting --- src/net/torvald/terrarum/SavegameCollection.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/torvald/terrarum/SavegameCollection.kt b/src/net/torvald/terrarum/SavegameCollection.kt index 24a405802..8d77032a8 100644 --- a/src/net/torvald/terrarum/SavegameCollection.kt +++ b/src/net/torvald/terrarum/SavegameCollection.kt @@ -14,7 +14,7 @@ import kotlin.io.path.Path class SavegameCollection(files0: List) { /** Sorted in reverse by the last modified time of the files, index zero being the most recent */ - val files = files0.sortedByDescending { it.getLastModifiedTime().shl(1) or it.diskFile.extension.matches(Regex("^[abc]\$")).toLong() } + val files = files0.sortedByDescending { it.getLastModifiedTime().shl(2) or it.diskFile.extension.isBlank().toLong(1) or it.diskFile.extension.matches(Regex("^[abc]${'$'}")).toLong() } /** Sorted in reverse by the last modified time of the files, index zero being the most recent */ val autoSaves = files.filter { it.diskFile.extension.matches(Regex("[a-z]")) } /** Sorted in reverse by the last modified time of the files, index zero being the most recent */