From bed7a37a6b09fc47c594c24592665b407b284a8e Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 21 Jun 2018 22:52:24 +0300 Subject: [PATCH] Cities connected to capital have a connected symbol next to them Unit information displays XP to next promotion --- android/assets/StatIcons/20xCityConnection5.png | Bin 0 -> 1364 bytes android/assets/jsons/Tutorials.json | 10 ++++++++++ android/build.gradle | 4 ++-- core/src/com/unciv/UnCivGame.kt | 3 +-- core/src/com/unciv/logic/city/CityInfo.kt | 3 +-- core/src/com/unciv/logic/city/CityStats.kt | 2 +- core/src/com/unciv/ui/tilegroups/TileGroup.kt | 3 +-- .../com/unciv/ui/tilegroups/WorldTileGroup.kt | 12 +++++++++--- .../com/unciv/ui/worldscreen/unit/UnitTable.kt | 2 +- 9 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 android/assets/StatIcons/20xCityConnection5.png diff --git a/android/assets/StatIcons/20xCityConnection5.png b/android/assets/StatIcons/20xCityConnection5.png new file mode 100644 index 0000000000000000000000000000000000000000..2ba55f9b693165f4c145252e3f7d10b835c2c8e6 GIT binary patch literal 1364 zcmZ`(X;4#F6g~-Ld4U9879fE@Vm3esNqCU3hJ=u?2VzWtVolg1AP5N3Y6sfd+K#wP zp@5>Tww=+cOsiNeR>v7bg%a<=NC@9cq zG&Y;fY&H|8@$vB)85wG|x~8Va;c%p-r4gb|r;CY+QN^ni3Po6$n8)LhX~Dj}zCe=@ zWr3k4kw`2S-`}6oRf+@$QTwZDWB^R;OXxx_%Ns*15*-+E|C&Ie0$t>_ef)qf1y(8q zW`chbP(lH`?d9brojtSq%4N5^60=&Z9UUFk!raFX*5UXX9B;s9O6_^7?(S}<)7jeE zT3uajG^p{#n#DQC%ehi~!R9WLtXNUr+}!MPRk&O(yWLK-nV1-V{uGAexqn{8k}zpO zL7}zC=BljC%P%$>jrsZcdcB_LSE*D+%L2Er58b<2Sg{O^lnGMO4Cxsblf`OtI57+( zh9eS1?CDK3rE(%8BNd9M@bJ){ZiQCESE|!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/assets/jsons/Tutorials.json +++ b/android/assets/jsons/Tutorials.json @@ -195,4 +195,14 @@ ] ], + SecondCity: [ + [ + "You have founded your second city!", + "Connecting your cities to the capital by roads", + " will generate gold via the trade route.", + "Note that each road costs 1 gold maintainance per turn, " + " so it may be more economical to wait until the cities grow!" + ] + ] + } diff --git a/android/build.gradle b/android/build.gradle index a89a8ec579..07ca93b58e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.game" minSdkVersion 14 targetSdkVersion 26 - versionCode 87 - versionName "2.5.3" + versionCode 89 + versionName "2.5.4.2" } buildTypes { release { diff --git a/core/src/com/unciv/UnCivGame.kt b/core/src/com/unciv/UnCivGame.kt index 0f865d6d29..2691ea575f 100644 --- a/core/src/com/unciv/UnCivGame.kt +++ b/core/src/com/unciv/UnCivGame.kt @@ -16,8 +16,7 @@ class UnCivGame : Game() { * This exists so that when debugging we can see the entire map. * Remember to turn this to false before commit and upload! */ - val viewEntireMapForDebug = true - + val viewEntireMapForDebug = false lateinit var worldScreen: WorldScreen diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 60bd0a9dd5..52ed6251cc 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -14,8 +14,7 @@ import com.unciv.models.stats.Stats import kotlin.math.min class CityInfo { - @Transient - lateinit var civInfo: CivilizationInfo + @Transient lateinit var civInfo: CivilizationInfo var location: Vector2 = Vector2.Zero var name: String = "" var health = 200 diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index 7a47f0debb..afe5ec15ae 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -255,7 +255,7 @@ class CityStats { this.currentCityStats = stats } - private fun isConnectedToCapital(roadType: RoadStatus): Boolean { + fun isConnectedToCapital(roadType: RoadStatus): Boolean { if(cityInfo.civInfo.cities.count()<2) return false// first city! val capitalTile = cityInfo.civInfo.getCapital().getCenterTile() val tilesReached = HashSet() diff --git a/core/src/com/unciv/ui/tilegroups/TileGroup.kt b/core/src/com/unciv/ui/tilegroups/TileGroup.kt index 83300ab8df..bbdb73209b 100644 --- a/core/src/com/unciv/ui/tilegroups/TileGroup.kt +++ b/core/src/com/unciv/ui/tilegroups/TileGroup.kt @@ -215,8 +215,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { } } if(improvementImage!=null){ - if(viewable) improvementImage!!.color= Color.WHITE - else improvementImage!!.color= Color.WHITE.cpy().apply { a=0.7f } + if(!viewable) improvementImage!!.color= Color.WHITE.cpy().apply { a=0.7f } } } diff --git a/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt b/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt index c324f97990..e0d4450961 100644 --- a/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt +++ b/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt @@ -1,13 +1,13 @@ package com.unciv.ui.tilegroups import com.badlogic.gdx.graphics.Color -import com.badlogic.gdx.scenes.scene2d.ui.Image import com.badlogic.gdx.scenes.scene2d.ui.Label import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.utils.Align import com.unciv.UnCivGame import com.unciv.logic.city.CityInfo import com.unciv.logic.map.MapUnit +import com.unciv.logic.map.RoadStatus import com.unciv.logic.map.TileInfo import com.unciv.models.gamebasics.unit.UnitType import com.unciv.ui.cityscreen.CityScreen @@ -101,9 +101,15 @@ class WorldTileGroup(tileInfo: TileInfo) : TileGroup(tileInfo) { add(fireImage).size(20f).padLeft(5f) } if(city.isCapital()){ - val starImage = Image(ImageGetter.getDrawable("OtherIcons/Star.png").tint(Color.LIGHT_GRAY)) + val starImage = ImageGetter.getImage("OtherIcons/Star.png").apply { color = Color.LIGHT_GRAY} add(starImage).size(20f).padLeft(5f) - } else{add()} // this is so the health bar is always 2 columns wide + } + else if (city.cityStats.isConnectedToCapital(RoadStatus.Road)){ + val connectionImage = ImageGetter.getStatIcon("CityConnection") + add(connectionImage).size(20f).padLeft(5f) + } + + else{add()} // this is so the health bar is always 2 columns wide add(label).pad(10f) pack() setOrigin(Align.center) diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt index a7c6a1793e..4121c3fbe7 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt @@ -70,7 +70,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){ if (unit.getBaseUnit().rangedStrength!=0) unitLabelText += "\n"+"Ranged strength".tr()+": "+unit.getBaseUnit().rangedStrength - unitLabelText += "\n"+"XP".tr()+": "+unit.promotions.XP + unitLabelText += "\n"+"XP".tr()+": "+unit.promotions.XP+"/"+unit.promotions.xpForNextPromotion() if(unit.isFortified() && unit.getFortificationTurns()>0) unitLabelText+="\n+"+unit.getFortificationTurns()*20+"% fortification"