From 9889bfcd1d4f9b01a5e1914e5aae93c0aaa8f969 Mon Sep 17 00:00:00 2001 From: SomeTroglodyte <63000004+SomeTroglodyte@users.noreply.github.com> Date: Wed, 16 Aug 2023 16:59:14 +0200 Subject: [PATCH] Show impassable tile percentage on Map Editor View summary (#9917) --- android/assets/jsons/translations/template.properties | 3 +-- .../com/unciv/ui/screens/mapeditorscreen/MapEditorScreen.kt | 1 - .../unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index db9679e16f..18ebe6e9ac 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -513,8 +513,7 @@ Starting location(s): [param] = Continent: [param] ([amount] tiles) = Resource abundance = Change map to fit selected ruleset? = -Area: [amount] tiles, [amount2] continents/islands = -Area: [amount] tiles, [amount2]% water, [amount3] continents/islands = +Area: [amount] tiles, [amount2]% water, [amount3]% impassable, [amount4] continents/islands = Do you want to leave without saving the recent changes? = Leave = Do you want to load another map without saving the recent changes? = diff --git a/core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorScreen.kt b/core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorScreen.kt index 5c9ecf18fb..3ae832da21 100644 --- a/core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorScreen.kt +++ b/core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorScreen.kt @@ -42,7 +42,6 @@ import kotlinx.coroutines.Job //todo normalize properly -//todo Remove "Area: [amount] tiles, [amount2] continents/islands = " after 2022-07-01 //todo functional Tab for Units (empty Tab is prepared but commented out in MapEditorEditTab.AllEditSubTabs) //todo copy/paste tile areas? (As tool tab, brush sized, floodfill forbidden, tab displays copied area) //todo Synergy with Civilopedia for drawing loose tiles / terrain icons diff --git a/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt b/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt index 4a45a1d6bf..0bd1ebde7f 100644 --- a/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt +++ b/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt @@ -95,8 +95,9 @@ class MapEditorViewTab( val area = tileMap.values.size val waterPercent = (tileMap.values.count { it.isWater } * 100f / area).toInt() + val impassablePercent = (tileMap.values.count { it.isImpassible() } * 100f / area).toInt() val continents = tileMap.continentSizes.size - val statsText = "Area: [$area] tiles, [$waterPercent]% water, [$continents] continents/islands" + val statsText = "Area: [$area] tiles, [$waterPercent]% water, [$impassablePercent]% impassable, [$continents] continents/islands" val statsLabel = WrappableLabel(statsText, labelWidth) add(statsLabel.apply { wrap = true }).row()