Tile info now dispays which civ each unit belongs to

Embarked units marked on map with different shaped background
This commit is contained in:
Yair Morgenstern 2018-11-04 13:06:16 +02:00
parent 52e9e35853
commit fb2538524a
6 changed files with 343 additions and 331 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 KiB

After

Width:  |  Height:  |  Size: 769 KiB

View file

@ -212,10 +212,11 @@ open class TileInfo {
if (roadStatus !== RoadStatus.None && !isCityCenter()) SB.appendln(roadStatus.toString().tr())
if (improvement != null) SB.appendln(improvement!!.tr())
if (improvementInProgress != null && isViewableToPlayer) SB.appendln("{$improvementInProgress} in ${this.turnsToImprovement} {turns}".tr())
if (civilianUnit != null && isViewableToPlayer) SB.appendln(civilianUnit!!.name.tr())
if (civilianUnit != null && isViewableToPlayer) SB.appendln(civilianUnit!!.name.tr()+" - "+civilianUnit!!.civInfo.civName.tr())
if(militaryUnit!=null && isViewableToPlayer){
var milUnitString = militaryUnit!!.name.tr()
if(militaryUnit!!.health<100) milUnitString += "(" + militaryUnit!!.health + ")"
milUnitString += " - "+militaryUnit!!.civInfo.civName.tr()
SB.appendln(milUnitString)
}
if(getDefensiveBonus()!=0f){

View file

@ -10,12 +10,12 @@ class Technology : ICivilopedia {
override val description: String
get(){
val SB=StringBuilder()
if(baseDescription!=null) SB.appendln(baseDescription)
if(baseDescription!=null) SB.appendln(baseDescription!!.tr())
val improvedImprovements = GameBasics.TileImprovements.values.filter { it.improvingTech==name }.groupBy { it.improvingTechStats.toString() }
improvedImprovements.forEach{
val impimpString = it.value.joinToString { it.name.tr() } +" {provide" + (if(it.value.size==1) "s" else "") +"} "+it.key
for (improvement in improvedImprovements) {
val impimpString = improvement.value.joinToString { it.name.tr() } +" {provide" + (if(improvement.value.size==1) "s" else "") +"} "+improvement.key
SB.appendln(impimpString.tr())
}

View file

@ -337,8 +337,12 @@ open class TileGroup(var tileInfo: TileInfo) : 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")
val background =
when {
unit.isEmbarked() -> ImageGetter.getImage("OtherIcons/Banner")
unit.isFortified() -> ImageGetter.getImage("OtherIcons/Shield.png")
else -> ImageGetter.getImage("OtherIcons/Circle.png")
}
background.apply {
this.color = unit.civInfo.getNation().getColor()
setSize(size, size)