Added secondary colors for civs - applies to units, cities, minimap, and more!

This commit is contained in:
Yair Morgenstern 2018-08-30 23:54:33 +03:00
parent 3e1fe03205
commit 056a428376
40 changed files with 209 additions and 191 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 821 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 937 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 868 B

After

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 782 B

After

Width:  |  Height:  |  Size: 967 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 KiB

After

Width:  |  Height:  |  Size: 669 KiB

View File

@ -1,49 +1,56 @@
[ [
{ {
name:"Babylon", name:"Babylon",
mainColor:[220,20,60], mainColor:[27,53,63],
secondaryColor:[213,249,255],
cities:["Babylon","Akkad","Dur-Kurigalzu","Nippur","Borsippa","Sippar","Opis","Mari","Shushan","Eshnunna", cities:["Babylon","Akkad","Dur-Kurigalzu","Nippur","Borsippa","Sippar","Opis","Mari","Shushan","Eshnunna",
"Ellasar","Erech","Kutha","Sirpurla","Neribtum","Ashur","Ninveh","Nimrud","Arbela","Nuzi", "Ellasar","Erech","Kutha","Sirpurla","Neribtum","Ashur","Ninveh","Nimrud","Arbela","Nuzi",
"Arrapkha","Tutub","Shaduppum","Rapiqum","Mashkan Shapir","Tuttul","Ramad","Ana","Haradum","Agrab"] "Arrapkha","Tutub","Shaduppum","Rapiqum","Mashkan Shapir","Tuttul","Ramad","Ana","Haradum","Agrab"]
}, },
{ {
name:"Greece", name:"Greece",
mainColor:[ 101, 153, 255], mainColor:[181, 232, 232],
secondaryColor:[68,142,249],
cities:["Athens","Sparta","Corinth","Argos","Knossos","Mycenae","Pharsalos","Ephesus","Halicarnassus","Rhodes", cities:["Athens","Sparta","Corinth","Argos","Knossos","Mycenae","Pharsalos","Ephesus","Halicarnassus","Rhodes",
"Eretria","Pergamon","Miletos","Megara","Phocaea","Sicyon","Tiryns","Samos","Mytilene","Chios", "Eretria","Pergamon","Miletos","Megara","Phocaea","Sicyon","Tiryns","Samos","Mytilene","Chios",
"Paros","Ellis","Syracuse","Herakleia","Gortyn","Chalkis","Pylos","Pella","Naxos"] "Paros","Ellis","Syracuse","Herakleia","Gortyn","Chalkis","Pylos","Pella","Naxos"]
}, },
{ {
name:"China", name:"China",
mainColor:[ 9, 112, 84], mainColor:[9, 112, 84],
secondaryColor:[255,255,255],
cities:["Beijing","Shanghai","Guangzhou","Nanjing","Xian","Chengdu","Hangzhou","Tianjin","Macau","Shandong", cities:["Beijing","Shanghai","Guangzhou","Nanjing","Xian","Chengdu","Hangzhou","Tianjin","Macau","Shandong",
"Kaifeng","Ningbo","Baoding","Yangzhou","Harbin","Chongqing","Luoyang","Kunming","Taipei","Shenyang", "Kaifeng","Ningbo","Baoding","Yangzhou","Harbin","Chongqing","Luoyang","Kunming","Taipei","Shenyang",
"Taiyuan","Tainan","Dalian","Lijiang","Wuxi","Suzhou","Maoming","Shaoguan","Yangjiang","Heyuan"] "Taiyuan","Tainan","Dalian","Lijiang","Wuxi","Suzhou","Maoming","Shaoguan","Yangjiang","Heyuan"]
}, },
{ {
name:"Egypt", name:"Egypt",
mainColor:[ 255, 153, 0], mainColor:[ 231, 213, 0],
secondaryColor:[98,10,210],
cities:["Thebes","Memphis","Heliopolis","Elephantine","Alexandria","Pi-Ramesses","Giza","Byblos","Akhetaten","Hieraconpolis", cities:["Thebes","Memphis","Heliopolis","Elephantine","Alexandria","Pi-Ramesses","Giza","Byblos","Akhetaten","Hieraconpolis",
"Abydos","Asyut","Avaris","Lisht","Buto","Edfu","Pithom","Busiris","Kahun","Athribis", "Abydos","Asyut","Avaris","Lisht","Buto","Edfu","Pithom","Busiris","Kahun","Athribis",
"Mendes","Elashmunein","Tanis","Bubastis","Oryx","Sebennytus","Akhmin","Karnak","Luxor","El Kab"] "Mendes","Elashmunein","Tanis","Bubastis","Oryx","Sebennytus","Akhmin","Karnak","Luxor","El Kab"]
}, },
{ {
name:"England", name:"England",
mainColor:[ 100, 100, 201], mainColor:[ 114, 0, 0],
secondaryColor:[255,255,255],
cities:["London","York","Nottingham","Hastings","Canterbury","Coventry","Warwick","Newcastle","Oxford","Liverpool", cities:["London","York","Nottingham","Hastings","Canterbury","Coventry","Warwick","Newcastle","Oxford","Liverpool",
"Dover","Brighton","Norwich","Leeds","Reading","Birmingham","Richmond","Exeter","Cambridge","Gloucester", "Dover","Brighton","Norwich","Leeds","Reading","Birmingham","Richmond","Exeter","Cambridge","Gloucester",
"Manchester","Bristol","Leicester","Carlisle","Ipswich","Portsmouth","Berwick","Bath","Mumbles","Southampton"] "Manchester","Bristol","Leicester","Carlisle","Ipswich","Portsmouth","Berwick","Bath","Mumbles","Southampton"]
}, },
{ {
name:"France", name:"France",
mainColor:[ 20, 160, 220], mainColor:[ 38, 98, 255],
secondaryColor:[239,236,148],
cities:["Paris","Orleans","Lyon","Troyes","Tours","Marseille","Chartres","Avignon","Rouen","Grenoble", cities:["Paris","Orleans","Lyon","Troyes","Tours","Marseille","Chartres","Avignon","Rouen","Grenoble",
"Dijon","Amiens","Cherbourg","Poitiers","Toulouse","Bayonne","Strasbourg","Brest","Bordeaux","Rennes", "Dijon","Amiens","Cherbourg","Poitiers","Toulouse","Bayonne","Strasbourg","Brest","Bordeaux","Rennes",
"Nice","Saint Etienne","Nantes","Reims","Le Mans","Montpellier","Limoges","Nancy","Lille","Caen"] "Nice","Saint Etienne","Nantes","Reims","Le Mans","Montpellier","Limoges","Nancy","Lille","Caen"]
}, },
{ {
name:"Russia", name:"Russia",
mainColor:[ 255, 215, 0], mainColor:[ 236, 178, 0],
secondaryColor:[0,0,0],
unique:"Strategic Resources provide +1 Production, and Horses, Iron and Uranium Resources provide double quantity", unique:"Strategic Resources provide +1 Production, and Horses, Iron and Uranium Resources provide double quantity",
cities:["Moscow","St. Petersburg","Novgorod","Rostov","Yaroslavl","Yekaterinburg","Yakutsk","Vladivostok","Smolensk","Orenburg", cities:["Moscow","St. Petersburg","Novgorod","Rostov","Yaroslavl","Yekaterinburg","Yakutsk","Vladivostok","Smolensk","Orenburg",
"Krasnoyarsk","Khabarovsk","Bryansk","Tver","Novosibirsk","Magadan","Murmansk","Irkutsk","Chita","Samara", "Krasnoyarsk","Khabarovsk","Bryansk","Tver","Novosibirsk","Magadan","Murmansk","Irkutsk","Chita","Samara",
@ -51,20 +58,23 @@
}, },
{ {
name:"Rome", name:"Rome",
mainColor:[ 75,0,130], mainColor:[ 53,0,87],
secondaryColor:[238,201,9],
cities:["Rome","Antium","Cumae","Neapolis","Ravenna","Arretium","Mediolanum","Arpinum","Circei","Setia", cities:["Rome","Antium","Cumae","Neapolis","Ravenna","Arretium","Mediolanum","Arpinum","Circei","Setia",
"Satricum","Ardea","Ostia","Velitrae","Viroconium","Tarentum","Brundisium","Caesaraugusta","Caesarea","Palmyra", "Satricum","Ardea","Ostia","Velitrae","Viroconium","Tarentum","Brundisium","Caesaraugusta","Caesarea","Palmyra",
"Signia","Aquileia","Clusium","Sutrium","Cremona","Placentia","Hispalis","Artaxata","Aurelianorum","Nicopolis"] "Signia","Aquileia","Clusium","Sutrium","Cremona","Placentia","Hispalis","Artaxata","Aurelianorum","Nicopolis"]
}, },
{ {
name:"Arabia", name:"Arabia",
mainColor:[ 0,100,0], mainColor:[ 41,83,42],
secondaryColor:[146,221,9],
cities:["Mecca","Medina","Damascus","Baghdad","Najran","Kufah","Basra","Khurasan","Anjar","Fustat", cities:["Mecca","Medina","Damascus","Baghdad","Najran","Kufah","Basra","Khurasan","Anjar","Fustat",
"Aden","Yamama","Muscat","Mansura","Bukhara","Fez","Shiraz","Merw","Balkh","Mosul", "Aden","Yamama","Muscat","Mansura","Bukhara","Fez","Shiraz","Merw","Balkh","Mosul",
"Aydab","Bayt","Suhar","Taif","Hama","Tabuk","Sana'a","Shihr","Tripoli","Tunis"] "Aydab","Bayt","Suhar","Taif","Hama","Tabuk","Sana'a","Shihr","Tripoli","Tunis"]
}, },
{ {
name:"Barbarians", name:"Barbarians",
mainColor:[200,200,200] mainColor:[200,200,200],
secondaryColor:[0,0,0]
} }
] ]

View File

@ -1,8 +1,10 @@
package com.unciv.models.gamebasics.tile package com.unciv.models.gamebasics.tile
import com.badlogic.gdx.graphics.Color
import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.GameBasics
import com.unciv.models.gamebasics.ICivilopedia import com.unciv.models.gamebasics.ICivilopedia
import com.unciv.models.stats.NamedStats import com.unciv.models.stats.NamedStats
import com.unciv.ui.utils.colorFromRGB
class Terrain : NamedStats(), ICivilopedia { class Terrain : NamedStats(), ICivilopedia {
override val description: String override val description: String
@ -47,8 +49,8 @@ class Terrain : NamedStats(), ICivilopedia {
* RGB color of base terrain * RGB color of base terrain
*/ */
var RGB: List<Int>? = null var RGB: List<Int>? = null
var movementCost = 1 var movementCost = 1
var defenceBonus:Float = 0f var defenceBonus:Float = 0f
fun getColor(): Color = colorFromRGB(RGB!![0], RGB!![1], RGB!![2])
} }

View File

@ -49,8 +49,8 @@ class BaseUnit : INamed, IConstruction, ICivilopedia {
val sb = StringBuilder() val sb = StringBuilder()
if(baseDescription!=null) sb.appendln(baseDescription!!.tr()) if(baseDescription!=null) sb.appendln(baseDescription!!.tr())
if(!forPickerScreen) { if(!forPickerScreen) {
if (unbuildable) sb.appendln("Unbuildable")
if(uniqueTo!=null) sb.appendln("Unique to $uniqueTo, replaces $replaces") if(uniqueTo!=null) sb.appendln("Unique to $uniqueTo, replaces $replaces")
if (unbuildable) sb.appendln("Unbuildable".tr())
else sb.appendln("Cost: $cost") else sb.appendln("Cost: $cost")
if(requiredResource!=null) sb.appendln("Required resource: {$requiredResource}".tr()) if(requiredResource!=null) sb.appendln("Required resource: {$requiredResource}".tr())
if(requiredTech!=null) sb.appendln("Required tech: {$requiredTech}".tr()) if(requiredTech!=null) sb.appendln("Required tech: {$requiredTech}".tr())

View File

@ -1,7 +1,6 @@
package com.unciv.ui package com.unciv.ui
import com.badlogic.gdx.Gdx import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.scenes.scene2d.Actor import com.badlogic.gdx.scenes.scene2d.Actor
import com.badlogic.gdx.scenes.scene2d.Touchable import com.badlogic.gdx.scenes.scene2d.Touchable
import com.badlogic.gdx.scenes.scene2d.ui.* import com.badlogic.gdx.scenes.scene2d.ui.*
@ -31,8 +30,8 @@ class NewGameScreen: PickerScreen(){
init { init {
pad(10f) pad(10f)
background=ImageGetter.getBackground(nation.getColor().apply { a=0.5f }) background=ImageGetter.getBackground(nation.getColor().apply { a=0.5f })
add(Label(nation.name, skin).apply { setFontColor(Color.WHITE)}).row() add(Label(nation.name, skin).apply { setFontColor(nation.getSecondaryColor())}).row()
add(Label(getUniqueLabel(nation), skin).apply { setWrap(true);setFontColor(Color.WHITE)}).width(width) add(Label(getUniqueLabel(nation), skin).apply { setWrap(true);setFontColor(nation.getSecondaryColor())}).width(width)
addClickListener { newGameParameters.nation=nation.name; onClick() } addClickListener { newGameParameters.nation=nation.name; onClick() }
touchable=Touchable.enabled touchable=Touchable.enabled
update() update()

View File

@ -15,7 +15,6 @@ import com.unciv.logic.map.TileInfo
import com.unciv.ui.cityscreen.YieldGroup import com.unciv.ui.cityscreen.YieldGroup
import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.ImageGetter
import com.unciv.ui.utils.center import com.unciv.ui.utils.center
import com.unciv.ui.utils.colorFromRGB
open class TileGroup(var tileInfo: TileInfo) : Group() { open class TileGroup(var tileInfo: TileInfo) : Group() {
protected val hexagon = ImageGetter.getImage("TerrainIcons/Hexagon.png") protected val hexagon = ImageGetter.getImage("TerrainIcons/Hexagon.png")
@ -250,8 +249,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
} }
private fun updateTileColor(isViewable: Boolean) { private fun updateTileColor(isViewable: Boolean) {
val RGB = tileInfo.getBaseTerrain().RGB!! hexagon.color = tileInfo.getBaseTerrain().getColor()
hexagon.color = colorFromRGB(RGB[0], RGB[1], RGB[2])
if (!isViewable) hexagon.color = hexagon.color.lerp(Color.BLACK, 0.6f) if (!isViewable) hexagon.color = hexagon.color.lerp(Color.BLACK, 0.6f)
} }
@ -322,25 +320,25 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
} }
if (unit != null && isViewable) { // Tile is visible if (unit != null && isViewable) { // Tile is visible
newImage = getUnitImage(unit, unit.civInfo.getNation().getColor(), 25f) newImage = getUnitImage(unit, 25f)
addActor(newImage) addActor(newImage)
newImage.center(this) newImage.center(this)
newImage.y += yFromCenter newImage.y += yFromCenter
if (!unit.isIdle()) newImage.color = Color(1f, 1f, 1f, 0.5f) if (!unit.isIdle()) newImage.color.a = 0.5f
} }
return newImage return newImage
} }
private fun getUnitImage(unit: MapUnit, color: Color, size: Float): Group { private fun getUnitImage(unit: MapUnit, size: Float): Group {
val unitBaseImage = ImageGetter.getUnitIcon(unit.name) val unitBaseImage = ImageGetter.getUnitIcon(unit.name, unit.civInfo.getNation().getSecondaryColor())
.apply { setSize(20f, 20f) } .apply { setSize(20f, 20f) }
val background = if (unit.isFortified()) ImageGetter.getImage("OtherIcons/Shield.png") val background = if (unit.isFortified()) ImageGetter.getImage("OtherIcons/Shield.png")
else ImageGetter.getImage("OtherIcons/Circle.png") else ImageGetter.getImage("OtherIcons/Circle.png")
background.apply { background.apply {
this.color = color this.color = unit.civInfo.getNation().getColor()
setSize(size, size) setSize(size, size)
} }
val group = Group().apply { val group = Group().apply {

View File

@ -77,6 +77,7 @@ class WorldTileGroup(tileInfo: TileInfo) : TileGroup(tileInfo) {
if (cityButton == null) { if (cityButton == null) {
cityButton = Table() cityButton = Table()
cityButton!!.background = ImageGetter.getDrawable("OtherIcons/civTableBackground.png") cityButton!!.background = ImageGetter.getDrawable("OtherIcons/civTableBackground.png")
.tint(city.civInfo.getNation().getColor())
cityButton!!.isTransform = true // If this is not set then the city button won't scale! cityButton!!.isTransform = true // If this is not set then the city button won't scale!
addActor(cityButton) addActor(cityButton)
@ -85,7 +86,7 @@ class WorldTileGroup(tileInfo: TileInfo) : TileGroup(tileInfo) {
val cityButtonText = city.name + " (" + city.population.population + ")" val cityButtonText = city.name + " (" + city.population.population + ")"
val label = Label(cityButtonText, CameraStageBaseScreen.skin) val label = Label(cityButtonText, CameraStageBaseScreen.skin)
label.setFontColor(city.civInfo.getNation().getColor()) label.setFontColor(city.civInfo.getNation().getSecondaryColor())
if (city.civInfo.isPlayerCivilization()) if (city.civInfo.isPlayerCivilization())
label.addClickListener { label.addClickListener {
UnCivGame.Current.screen = CityScreen(city) UnCivGame.Current.screen = CityScreen(city)
@ -130,17 +131,27 @@ class WorldTileGroup(tileInfo: TileInfo) : TileGroup(tileInfo) {
private fun getConstructionGroup(cityConstructions: CityConstructions):Group{ private fun getConstructionGroup(cityConstructions: CityConstructions):Group{
val group= Group() val group= Group()
val groupHeight = 25f val groupHeight = 25f
group.setSize(35f,groupHeight) group.setSize(40f,groupHeight)
val circle = ImageGetter.getImage("OtherIcons/Circle")
circle.setSize(25f,25f)
val image = ImageGetter.getConstructionImage(cityConstructions.currentConstruction) val image = ImageGetter.getConstructionImage(cityConstructions.currentConstruction)
image.setSize(20f,20f) image.setSize(20f,20f)
image.centerY(group) image.centerY(group)
image.x = group.width-image.width image.x = group.width-image.width
// center the circle on thee production image
circle.x = image.x + (image.width-circle.width)/2
circle.y = image.y + (image.height-circle.height)/2
group.addActor(circle)
group.addActor(image) group.addActor(image)
val secondaryColor = cityConstructions.cityInfo.civInfo.getNation().getSecondaryColor()
if(cityConstructions.getCurrentConstruction() !is SpecialConstruction) { if(cityConstructions.getCurrentConstruction() !is SpecialConstruction) {
val turnsToConstruction = cityConstructions.turnsToConstruction(cityConstructions.currentConstruction) val turnsToConstruction = cityConstructions.turnsToConstruction(cityConstructions.currentConstruction)
val label = Label(turnsToConstruction.toString(),CameraStageBaseScreen.skin) val label = Label(turnsToConstruction.toString(),CameraStageBaseScreen.skin)
label.color = Color.BROWN label.setFontColor(secondaryColor)
label.setFont(10) label.setFont(10)
label.pack() label.pack()
group.addActor(label) group.addActor(label)

View File

@ -52,8 +52,8 @@ object ImageGetter {
.apply { setSize(20f,20f)} .apply { setSize(20f,20f)}
} }
fun getUnitIcon(unitName:String):Image{ fun getUnitIcon(unitName:String,color:Color= Color.BLACK):Image{
return getImage("UnitIcons/$unitName") return getImage("UnitIcons/$unitName").apply { this.color=color }
} }
fun getImprovementIcon(improvementName:String, size:Float=20f):Actor{ fun getImprovementIcon(improvementName:String, size:Float=20f):Actor{

View File

@ -12,7 +12,6 @@ import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.logic.map.TileInfo import com.unciv.logic.map.TileInfo
import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.ImageGetter
import com.unciv.ui.utils.addClickListener import com.unciv.ui.utils.addClickListener
import com.unciv.ui.utils.colorFromRGB
class Minimap(val tileMapHolder: TileMapHolder) : ScrollPane(null){ class Minimap(val tileMapHolder: TileMapHolder) : ScrollPane(null){
val allTiles = Group() val allTiles = Group()
@ -73,12 +72,11 @@ class Minimap(val tileMapHolder: TileMapHolder) : ScrollPane(null){
fun update(cloneCivilization: CivilizationInfo) { fun update(cloneCivilization: CivilizationInfo) {
val exploredTiles = cloneCivilization.exploredTiles val exploredTiles = cloneCivilization.exploredTiles
for(tileInfo in tileMapHolder.tileMap.values) { for(tileInfo in tileMapHolder.tileMap.values) {
val RGB = tileInfo.getBaseTerrain().RGB!!
val hex = tileImages[tileInfo]!! val hex = tileImages[tileInfo]!!
if (!(exploredTiles.contains(tileInfo.position) || UnCivGame.Current.viewEntireMapForDebug)) hex.color = Color.BLACK if (!(exploredTiles.contains(tileInfo.position) || UnCivGame.Current.viewEntireMapForDebug)) hex.color = Color.BLACK
else if (tileInfo.isCityCenter()) hex.color = Color.WHITE else if (tileInfo.isCityCenter()) hex.color = tileInfo.getOwner()!!.getNation().getSecondaryColor()
else if (tileInfo.getCity() != null) hex.color = tileInfo.getOwner()!!.getNation().getColor() else if (tileInfo.getCity() != null) hex.color = tileInfo.getOwner()!!.getNation().getColor()
else hex.color = colorFromRGB(RGB[0], RGB[1], RGB[2]).lerp(Color.GRAY, 0.5f) // Todo add to baseterrain as function else hex.color = tileInfo.getBaseTerrain().getColor().lerp(Color.GRAY, 0.5f) // Todo add to baseterrain as function
} }
} }
} }