Added Civ icon to cities

Improved City Connection icon
This commit is contained in:
Yair Morgenstern 2019-06-19 20:13:32 +03:00
parent a6d1cdc398
commit a1e1b91b9a
4 changed files with 12 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1006 KiB

After

Width:  |  Height:  |  Size: 1006 KiB

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.app" applicationId "com.unciv.app"
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 28 targetSdkVersion 28
versionCode 259 versionCode 260
versionName "2.17.8" versionName "2.17.9"
} }
// Had to add this crap for Travis to build, it wanted to sign the app // Had to add this crap for Travis to build, it wanted to sign the app

View File

@ -30,7 +30,8 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
background = ImageGetter.getDrawable("OtherIcons/civTableBackground.png") background = ImageGetter.getDrawable("OtherIcons/civTableBackground.png")
.tint(city.civInfo.getNation().getColor()) .tint(city.civInfo.getNation().getColor())
val label = cityButtonText.toLabel() val label = cityButtonText.toLabel()
label.setFontColor(city.civInfo.getNation().getSecondaryColor()) val secondaryColor = city.civInfo.getNation().getSecondaryColor()
label.setFontColor(secondaryColor)
clear() clear()
val unitTable = tileGroup.worldScreen.bottomBar.unitTable val unitTable = tileGroup.worldScreen.bottomBar.unitTable
@ -80,7 +81,7 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
if (city.isCapital()) { if (city.isCapital()) {
if (city.civInfo.isCityState()) { if (city.civInfo.isCityState()) {
val cityStateImage = ImageGetter.getNationIcon("CityState") val cityStateImage = ImageGetter.getNationIcon("CityState")
.apply { color = city.civInfo.getNation().getSecondaryColor()} .apply { color = secondaryColor}
iconTable.add(cityStateImage).size(20f).pad(2f).padLeft(10f) iconTable.add(cityStateImage).size(20f).pad(2f).padLeft(10f)
} else { } else {
val starImage = ImageGetter.getImage("OtherIcons/Star.png").apply { color = Color.LIGHT_GRAY } val starImage = ImageGetter.getImage("OtherIcons/Star.png").apply { color = Color.LIGHT_GRAY }
@ -88,13 +89,19 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
} }
} else if (city.civInfo.isCurrentPlayer() && city.isConnectedToCapital()) { } else if (city.civInfo.isCurrentPlayer() && city.isConnectedToCapital()) {
val connectionImage = ImageGetter.getStatIcon("CityConnection") val connectionImage = ImageGetter.getStatIcon("CityConnection")
connectionImage.color = secondaryColor
iconTable.add(connectionImage).size(20f).pad(2f).padLeft(10f) iconTable.add(connectionImage).size(20f).pad(2f).padLeft(10f)
} }
iconTable.add(label).pad(10f) // sufficient horizontal padding iconTable.add(label).pad(10f) // sufficient horizontal padding
.fillY() // provide full-height clicking area .fillY() // provide full-height clicking area
if (UnCivGame.Current.viewEntireMapForDebug || city.civInfo.isCurrentPlayer()) {
if (UnCivGame.Current.viewEntireMapForDebug || city.civInfo.isCurrentPlayer())
iconTable.add(getConstructionGroup(city.cityConstructions)).padRight(10f) iconTable.add(getConstructionGroup(city.cityConstructions)).padRight(10f)
else if(city.civInfo.isMajorCiv()) {
val nationIcon = ImageGetter.getNationIcon(city.civInfo.getNation().name)
nationIcon.color = secondaryColor
iconTable.add(nationIcon).size(20f).padRight(10f)
} }
add(iconTable).row() add(iconTable).row()
pack() pack()