Added secondary colors for civs - applies to units, cities, minimap, and more!
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 821 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 937 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 868 B After Width: | Height: | Size: 902 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 915 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 782 B After Width: | Height: | Size: 967 B |
Before Width: | Height: | Size: 630 KiB After Width: | Height: | Size: 669 KiB |
@ -1,49 +1,56 @@
|
||||
[
|
||||
{
|
||||
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",
|
||||
"Ellasar","Erech","Kutha","Sirpurla","Neribtum","Ashur","Ninveh","Nimrud","Arbela","Nuzi",
|
||||
"Arrapkha","Tutub","Shaduppum","Rapiqum","Mashkan Shapir","Tuttul","Ramad","Ana","Haradum","Agrab"]
|
||||
},
|
||||
{
|
||||
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",
|
||||
"Eretria","Pergamon","Miletos","Megara","Phocaea","Sicyon","Tiryns","Samos","Mytilene","Chios",
|
||||
"Paros","Ellis","Syracuse","Herakleia","Gortyn","Chalkis","Pylos","Pella","Naxos"]
|
||||
},
|
||||
{
|
||||
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",
|
||||
"Kaifeng","Ningbo","Baoding","Yangzhou","Harbin","Chongqing","Luoyang","Kunming","Taipei","Shenyang",
|
||||
"Taiyuan","Tainan","Dalian","Lijiang","Wuxi","Suzhou","Maoming","Shaoguan","Yangjiang","Heyuan"]
|
||||
},
|
||||
{
|
||||
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",
|
||||
"Abydos","Asyut","Avaris","Lisht","Buto","Edfu","Pithom","Busiris","Kahun","Athribis",
|
||||
"Mendes","Elashmunein","Tanis","Bubastis","Oryx","Sebennytus","Akhmin","Karnak","Luxor","El Kab"]
|
||||
},
|
||||
{
|
||||
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",
|
||||
"Dover","Brighton","Norwich","Leeds","Reading","Birmingham","Richmond","Exeter","Cambridge","Gloucester",
|
||||
"Manchester","Bristol","Leicester","Carlisle","Ipswich","Portsmouth","Berwick","Bath","Mumbles","Southampton"]
|
||||
},
|
||||
{
|
||||
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",
|
||||
"Dijon","Amiens","Cherbourg","Poitiers","Toulouse","Bayonne","Strasbourg","Brest","Bordeaux","Rennes",
|
||||
"Nice","Saint Etienne","Nantes","Reims","Le Mans","Montpellier","Limoges","Nancy","Lille","Caen"]
|
||||
},
|
||||
{
|
||||
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",
|
||||
cities:["Moscow","St. Petersburg","Novgorod","Rostov","Yaroslavl","Yekaterinburg","Yakutsk","Vladivostok","Smolensk","Orenburg",
|
||||
"Krasnoyarsk","Khabarovsk","Bryansk","Tver","Novosibirsk","Magadan","Murmansk","Irkutsk","Chita","Samara",
|
||||
@ -51,20 +58,23 @@
|
||||
},
|
||||
{
|
||||
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",
|
||||
"Satricum","Ardea","Ostia","Velitrae","Viroconium","Tarentum","Brundisium","Caesaraugusta","Caesarea","Palmyra",
|
||||
"Signia","Aquileia","Clusium","Sutrium","Cremona","Placentia","Hispalis","Artaxata","Aurelianorum","Nicopolis"]
|
||||
},
|
||||
{
|
||||
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",
|
||||
"Aden","Yamama","Muscat","Mansura","Bukhara","Fez","Shiraz","Merw","Balkh","Mosul",
|
||||
"Aydab","Bayt","Suhar","Taif","Hama","Tabuk","Sana'a","Shihr","Tripoli","Tunis"]
|
||||
},
|
||||
{
|
||||
name:"Barbarians",
|
||||
mainColor:[200,200,200]
|
||||
mainColor:[200,200,200],
|
||||
secondaryColor:[0,0,0]
|
||||
}
|
||||
]
|
@ -1,8 +1,10 @@
|
||||
package com.unciv.models.gamebasics.tile
|
||||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.unciv.models.gamebasics.GameBasics
|
||||
import com.unciv.models.gamebasics.ICivilopedia
|
||||
import com.unciv.models.stats.NamedStats
|
||||
import com.unciv.ui.utils.colorFromRGB
|
||||
|
||||
class Terrain : NamedStats(), ICivilopedia {
|
||||
override val description: String
|
||||
@ -47,8 +49,8 @@ class Terrain : NamedStats(), ICivilopedia {
|
||||
* RGB color of base terrain
|
||||
*/
|
||||
var RGB: List<Int>? = null
|
||||
|
||||
var movementCost = 1
|
||||
|
||||
var defenceBonus:Float = 0f
|
||||
|
||||
fun getColor(): Color = colorFromRGB(RGB!![0], RGB!![1], RGB!![2])
|
||||
}
|
@ -49,8 +49,8 @@ class BaseUnit : INamed, IConstruction, ICivilopedia {
|
||||
val sb = StringBuilder()
|
||||
if(baseDescription!=null) sb.appendln(baseDescription!!.tr())
|
||||
if(!forPickerScreen) {
|
||||
if (unbuildable) sb.appendln("Unbuildable")
|
||||
if(uniqueTo!=null) sb.appendln("Unique to $uniqueTo, replaces $replaces")
|
||||
if (unbuildable) sb.appendln("Unbuildable".tr())
|
||||
else sb.appendln("Cost: $cost")
|
||||
if(requiredResource!=null) sb.appendln("Required resource: {$requiredResource}".tr())
|
||||
if(requiredTech!=null) sb.appendln("Required tech: {$requiredTech}".tr())
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.unciv.ui
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor
|
||||
import com.badlogic.gdx.scenes.scene2d.Touchable
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.*
|
||||
@ -31,8 +30,8 @@ class NewGameScreen: PickerScreen(){
|
||||
init {
|
||||
pad(10f)
|
||||
background=ImageGetter.getBackground(nation.getColor().apply { a=0.5f })
|
||||
add(Label(nation.name, skin).apply { setFontColor(Color.WHITE)}).row()
|
||||
add(Label(getUniqueLabel(nation), skin).apply { setWrap(true);setFontColor(Color.WHITE)}).width(width)
|
||||
add(Label(nation.name, skin).apply { setFontColor(nation.getSecondaryColor())}).row()
|
||||
add(Label(getUniqueLabel(nation), skin).apply { setWrap(true);setFontColor(nation.getSecondaryColor())}).width(width)
|
||||
addClickListener { newGameParameters.nation=nation.name; onClick() }
|
||||
touchable=Touchable.enabled
|
||||
update()
|
||||
|
@ -15,7 +15,6 @@ import com.unciv.logic.map.TileInfo
|
||||
import com.unciv.ui.cityscreen.YieldGroup
|
||||
import com.unciv.ui.utils.ImageGetter
|
||||
import com.unciv.ui.utils.center
|
||||
import com.unciv.ui.utils.colorFromRGB
|
||||
|
||||
open class TileGroup(var tileInfo: TileInfo) : Group() {
|
||||
protected val hexagon = ImageGetter.getImage("TerrainIcons/Hexagon.png")
|
||||
@ -250,8 +249,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
||||
}
|
||||
|
||||
private fun updateTileColor(isViewable: Boolean) {
|
||||
val RGB = tileInfo.getBaseTerrain().RGB!!
|
||||
hexagon.color = colorFromRGB(RGB[0], RGB[1], RGB[2])
|
||||
hexagon.color = tileInfo.getBaseTerrain().getColor()
|
||||
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
|
||||
newImage = getUnitImage(unit, unit.civInfo.getNation().getColor(), 25f)
|
||||
newImage = getUnitImage(unit, 25f)
|
||||
addActor(newImage)
|
||||
newImage.center(this)
|
||||
newImage.y += yFromCenter
|
||||
|
||||
if (!unit.isIdle()) newImage.color = Color(1f, 1f, 1f, 0.5f)
|
||||
if (!unit.isIdle()) newImage.color.a = 0.5f
|
||||
}
|
||||
return newImage
|
||||
}
|
||||
|
||||
|
||||
private fun getUnitImage(unit: MapUnit, color: Color, size: Float): Group {
|
||||
val unitBaseImage = ImageGetter.getUnitIcon(unit.name)
|
||||
private fun getUnitImage(unit: MapUnit, size: Float): Group {
|
||||
val unitBaseImage = ImageGetter.getUnitIcon(unit.name, unit.civInfo.getNation().getSecondaryColor())
|
||||
.apply { setSize(20f, 20f) }
|
||||
|
||||
val background = if (unit.isFortified()) ImageGetter.getImage("OtherIcons/Shield.png")
|
||||
else ImageGetter.getImage("OtherIcons/Circle.png")
|
||||
background.apply {
|
||||
this.color = color
|
||||
this.color = unit.civInfo.getNation().getColor()
|
||||
setSize(size, size)
|
||||
}
|
||||
val group = Group().apply {
|
||||
|
@ -77,6 +77,7 @@ class WorldTileGroup(tileInfo: TileInfo) : TileGroup(tileInfo) {
|
||||
if (cityButton == null) {
|
||||
cityButton = Table()
|
||||
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!
|
||||
|
||||
addActor(cityButton)
|
||||
@ -85,7 +86,7 @@ class WorldTileGroup(tileInfo: TileInfo) : TileGroup(tileInfo) {
|
||||
|
||||
val cityButtonText = city.name + " (" + city.population.population + ")"
|
||||
val label = Label(cityButtonText, CameraStageBaseScreen.skin)
|
||||
label.setFontColor(city.civInfo.getNation().getColor())
|
||||
label.setFontColor(city.civInfo.getNation().getSecondaryColor())
|
||||
if (city.civInfo.isPlayerCivilization())
|
||||
label.addClickListener {
|
||||
UnCivGame.Current.screen = CityScreen(city)
|
||||
@ -130,17 +131,27 @@ class WorldTileGroup(tileInfo: TileInfo) : TileGroup(tileInfo) {
|
||||
private fun getConstructionGroup(cityConstructions: CityConstructions):Group{
|
||||
val group= Group()
|
||||
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)
|
||||
image.setSize(20f,20f)
|
||||
image.centerY(group)
|
||||
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)
|
||||
|
||||
val secondaryColor = cityConstructions.cityInfo.civInfo.getNation().getSecondaryColor()
|
||||
if(cityConstructions.getCurrentConstruction() !is SpecialConstruction) {
|
||||
val turnsToConstruction = cityConstructions.turnsToConstruction(cityConstructions.currentConstruction)
|
||||
val label = Label(turnsToConstruction.toString(),CameraStageBaseScreen.skin)
|
||||
label.color = Color.BROWN
|
||||
label.setFontColor(secondaryColor)
|
||||
label.setFont(10)
|
||||
label.pack()
|
||||
group.addActor(label)
|
||||
|
@ -52,8 +52,8 @@ object ImageGetter {
|
||||
.apply { setSize(20f,20f)}
|
||||
}
|
||||
|
||||
fun getUnitIcon(unitName:String):Image{
|
||||
return getImage("UnitIcons/$unitName")
|
||||
fun getUnitIcon(unitName:String,color:Color= Color.BLACK):Image{
|
||||
return getImage("UnitIcons/$unitName").apply { this.color=color }
|
||||
}
|
||||
|
||||
fun getImprovementIcon(improvementName:String, size:Float=20f):Actor{
|
||||
|
@ -12,7 +12,6 @@ import com.unciv.logic.civilization.CivilizationInfo
|
||||
import com.unciv.logic.map.TileInfo
|
||||
import com.unciv.ui.utils.ImageGetter
|
||||
import com.unciv.ui.utils.addClickListener
|
||||
import com.unciv.ui.utils.colorFromRGB
|
||||
|
||||
class Minimap(val tileMapHolder: TileMapHolder) : ScrollPane(null){
|
||||
val allTiles = Group()
|
||||
@ -73,12 +72,11 @@ class Minimap(val tileMapHolder: TileMapHolder) : ScrollPane(null){
|
||||
fun update(cloneCivilization: CivilizationInfo) {
|
||||
val exploredTiles = cloneCivilization.exploredTiles
|
||||
for(tileInfo in tileMapHolder.tileMap.values) {
|
||||
val RGB = tileInfo.getBaseTerrain().RGB!!
|
||||
val hex = tileImages[tileInfo]!!
|
||||
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 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
|
||||
}
|
||||
}
|
||||
}
|