From 146a806b08ebf2959b2b6c004c461313bec98d94 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 21 Apr 2021 20:53:14 +0300 Subject: [PATCH] Added 'last updated time' to mod description --- .../src/com/unciv/ui/pickerscreens/ModManagementScreen.kt | 8 +++++++- core/src/com/unciv/ui/worldscreen/mainmenu/DropBox.kt | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt b/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt index beaccc49d9..927688881b 100644 --- a/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt @@ -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() } diff --git a/core/src/com/unciv/ui/worldscreen/mainmenu/DropBox.kt b/core/src/com/unciv/ui/worldscreen/mainmenu/DropBox.kt index 108f4e62b9..9cb4f9418c 100644 --- a/core/src/com/unciv/ui/worldscreen/mainmenu/DropBox.kt +++ b/core/src/com/unciv/ui/worldscreen/mainmenu/DropBox.kt @@ -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 = "" } }