Added 'last updated time' to mod description

This commit is contained in:
Yair Morgenstern 2021-04-21 20:53:14 +03:00
parent 72f63b7ba1
commit 146a806b08
2 changed files with 11 additions and 1 deletions

View File

@ -11,6 +11,9 @@ import com.unciv.models.ruleset.RulesetCache
import com.unciv.models.translations.tr
import com.unciv.ui.utils.*
import com.unciv.ui.worldscreen.mainmenu.Github
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.*
import kotlin.concurrent.thread
class ModManagementScreen: PickerScreen() {
@ -74,7 +77,10 @@ class ModManagementScreen: PickerScreen() {
modActionTable.clear()
modActionTable.add("Open Github page".toTextButton().onClick {
Gdx.net.openURI(repo.html_url)
})
}).row()
val updateString = "Last updated at: "+ LocalDateTime.parse(repo.updated_at, DateTimeFormatter.ISO_DATE_TIME)
.toLocalDate().toString()
modActionTable.add(updateString.toLabel())
}
downloadTable.add(downloadButton).row()
}

View File

@ -9,8 +9,11 @@ import java.io.*
import java.net.HttpURLConnection
import java.net.URL
import java.nio.charset.Charset
import java.time.DateTimeException
import java.util.*
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import kotlin.collections.ArrayList
object DropBox {
@ -197,6 +200,7 @@ object Github {
var stargazers_count = 0
var default_branch = ""
var html_url = ""
var updated_at = ""
}
}