innerColor and outerColor function name changes

This commit is contained in:
Yair Morgenstern 2019-09-14 23:17:52 +03:00
parent f6323edbc8
commit bad10370de
9 changed files with 27 additions and 26 deletions

View File

@ -51,10 +51,11 @@ class Nation : INamed {
var startBias = ArrayList<String>() var startBias = ArrayList<String>()
fun getColor(): Color { fun getOuterColor(): Color {
return colorFromRGB(outerColor[0], outerColor[1], outerColor[2]) return colorFromRGB(outerColor[0], outerColor[1], outerColor[2])
} }
fun getSecondaryColor(): Color {
fun getInnerColor(): Color {
if(innerColor==null) return Color.BLACK if(innerColor==null) return Color.BLACK
return colorFromRGB(innerColor!![0], innerColor!![1], innerColor!![2]) return colorFromRGB(innerColor!![0], innerColor!![1], innerColor!![2])
} }

View File

@ -122,12 +122,12 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){
private fun createOffersTable(civ: CivilizationInfo, offersList: TradeOffersList, numberOfOtherSidesOffers: Int): Table { private fun createOffersTable(civ: CivilizationInfo, offersList: TradeOffersList, numberOfOtherSidesOffers: Int): Table {
val table = Table() val table = Table()
table.defaults().pad(10f) table.defaults().pad(10f)
table.background = ImageGetter.getBackground(civ.nation.getColor()) table.background = ImageGetter.getBackground(civ.nation.getOuterColor())
table.add(civ.civName.toLabel().setFontColor(civ.nation.getSecondaryColor())).row() table.add(civ.civName.toLabel().setFontColor(civ.nation.getInnerColor())).row()
table.addSeparator() table.addSeparator()
for(offer in offersList){ for(offer in offersList){
val offerText = offer.getOfferText() val offerText = offer.getOfferText()
table.add(offerText.toLabel().setFontColor(civ.nation.getSecondaryColor())).row() table.add(offerText.toLabel().setFontColor(civ.nation.getInnerColor())).row()
} }
for(i in 1..numberOfOtherSidesOffers - offersList.size) for(i in 1..numberOfOtherSidesOffers - offersList.size)
table.add("".toLabel()).row() // we want both sides of the general table to have the same number of rows table.add("".toLabel()).row() // we want both sides of the general table to have the same number of rows
@ -416,8 +416,8 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){
label.setFontColor(Color.BLACK) label.setFontColor(Color.BLACK)
} else if (currentPlayer==civ || UnCivGame.Current.viewEntireMapForDebug || currentPlayer.knows(civ)) { } else if (currentPlayer==civ || UnCivGame.Current.viewEntireMapForDebug || currentPlayer.knows(civ)) {
civGroup.add(ImageGetter.getNationIndicator(civ.nation, 30f)) civGroup.add(ImageGetter.getNationIndicator(civ.nation, 30f))
civGroup.background = civGroupBackground.tint(civ.nation.getColor()) civGroup.background = civGroupBackground.tint(civ.nation.getOuterColor())
label.setFontColor(civ.nation.getSecondaryColor()) label.setFontColor(civ.nation.getInnerColor())
} else { } else {
civGroup.background = civGroupBackground.tint(Color.DARK_GRAY) civGroup.background = civGroupBackground.tint(Color.DARK_GRAY)
label.setText("???") label.setText("???")

View File

@ -13,18 +13,18 @@ class NationTable(val nation: Nation, width:Float, onClick:()->Unit)
: Table(CameraStageBaseScreen.skin){ : Table(CameraStageBaseScreen.skin){
val innerTable = Table() val innerTable = Table()
init { init {
background = ImageGetter.getBackground(nation.getSecondaryColor()) background = ImageGetter.getBackground(nation.getInnerColor())
innerTable.pad(10f) innerTable.pad(10f)
innerTable.background = ImageGetter.getBackground(nation.getColor()) innerTable.background = ImageGetter.getBackground(nation.getOuterColor())
val titleTable = Table() val titleTable = Table()
titleTable.add(ImageGetter.getNationIndicator(nation, 50f)).pad(10f) titleTable.add(ImageGetter.getNationIndicator(nation, 50f)).pad(10f)
titleTable.add(nation.getLeaderDisplayName().toLabel() titleTable.add(nation.getLeaderDisplayName().toLabel()
.apply { setFontColor(nation.getSecondaryColor()); setFontSize(24) }) .apply { setFontColor(nation.getInnerColor()); setFontSize(24) })
innerTable.add(titleTable).row() innerTable.add(titleTable).row()
innerTable.add(getUniqueLabel(nation) innerTable.add(getUniqueLabel(nation)
.apply { setWrap(true);setFontColor(nation.getSecondaryColor()) }) .apply { setWrap(true);setFontColor(nation.getInnerColor()) })
.width(width) .width(width)
onClick { onClick {
onClick() onClick()

View File

@ -45,10 +45,10 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
private fun addAirUnitTable() { private fun addAirUnitTable() {
if (!tileGroup.tileInfo.airUnits.isNotEmpty()) return if (!tileGroup.tileInfo.airUnits.isNotEmpty()) return
val secondarycolor = city.civInfo.nation.getSecondaryColor() val secondarycolor = city.civInfo.nation.getInnerColor()
val airUnitTable = Table().apply { defaults().pad(5f) } val airUnitTable = Table().apply { defaults().pad(5f) }
airUnitTable.background = ImageGetter.getDrawable("OtherIcons/civTableBackground") airUnitTable.background = ImageGetter.getDrawable("OtherIcons/civTableBackground")
.tint(city.civInfo.nation.getColor()) .tint(city.civInfo.nation.getOuterColor())
val aircraftImage = ImageGetter.getImage("OtherIcons/Aircraft") val aircraftImage = ImageGetter.getImage("OtherIcons/Aircraft")
aircraftImage.color = secondarycolor aircraftImage.color = secondarycolor
airUnitTable.add(aircraftImage).size(15f) airUnitTable.add(aircraftImage).size(15f)
@ -89,11 +89,11 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
} }
private fun getIconTable(): Table { private fun getIconTable(): Table {
val secondaryColor = city.civInfo.nation.getSecondaryColor() val secondaryColor = city.civInfo.nation.getInnerColor()
val iconTable = Table() val iconTable = Table()
iconTable.touchable=Touchable.enabled iconTable.touchable=Touchable.enabled
iconTable.background = ImageGetter.getDrawable("OtherIcons/civTableBackground") iconTable.background = ImageGetter.getDrawable("OtherIcons/civTableBackground")
.tint(city.civInfo.nation.getColor()) .tint(city.civInfo.nation.getOuterColor())
if (city.resistanceCounter > 0) { if (city.resistanceCounter > 0) {
val resistanceImage = ImageGetter.getImage("StatIcons/Resistance") val resistanceImage = ImageGetter.getImage("StatIcons/Resistance")
@ -170,7 +170,7 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
group.addActor(circle) group.addActor(circle)
group.addActor(image) group.addActor(image)
val secondaryColor = cityConstructions.cityInfo.civInfo.nation.getSecondaryColor() val secondaryColor = cityConstructions.cityInfo.civInfo.nation.getInnerColor()
val cityCurrentConstruction = cityConstructions.getCurrentConstruction() val cityCurrentConstruction = cityConstructions.getCurrentConstruction()
if(cityCurrentConstruction !is SpecialConstruction) { if(cityCurrentConstruction !is SpecialConstruction) {
val turnsToConstruction = cityConstructions.turnsToConstruction(cityCurrentConstruction.name) val turnsToConstruction = cityConstructions.turnsToConstruction(cityCurrentConstruction.name)

View File

@ -278,7 +278,7 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
previousTileOwner = tileOwner previousTileOwner = tileOwner
if (tileOwner == null) return if (tileOwner == null) return
val civColor = tileInfo.getOwner()!!.nation.getColor() val civColor = tileInfo.getOwner()!!.nation.getOuterColor()
for (neighbor in tileInfo.neighbors) { for (neighbor in tileInfo.neighbors) {
val neighborOwner = neighbor.getOwner() val neighborOwner = neighbor.getOwner()
if (neighborOwner == tileOwner && borderImages.containsKey(neighbor)) // the neighbor used to not belong to us, but now it's ours if (neighborOwner == tileOwner && borderImages.containsKey(neighbor)) // the neighbor used to not belong to us, but now it's ours

View File

@ -67,15 +67,15 @@ object ImageGetter {
} }
fun getNationIndicator(nation: Nation, size:Float): IconCircleGroup { fun getNationIndicator(nation: Nation, size:Float): IconCircleGroup {
val civIndicator = getCircle().apply { color = nation.getSecondaryColor() } val civIndicator = getCircle().apply { color = nation.getInnerColor() }
.surroundWithCircle(size).apply { circle.color = nation.getColor() } .surroundWithCircle(size).apply { circle.color = nation.getOuterColor() }
val civIconName = if(nation.isCityState()) "CityState" else nation.name val civIconName = if(nation.isCityState()) "CityState" else nation.name
if(nationIconExists(civIconName)){ if(nationIconExists(civIconName)){
val cityStateIcon = ImageGetter.getNationIcon(civIconName) val cityStateIcon = ImageGetter.getNationIcon(civIconName)
cityStateIcon.setSize(size*0.7f,size*0.7f) cityStateIcon.setSize(size*0.7f,size*0.7f)
cityStateIcon.center(civIndicator) cityStateIcon.center(civIndicator)
cityStateIcon.color = nation.getColor() cityStateIcon.color = nation.getOuterColor()
civIndicator.addActor(cityStateIcon) civIndicator.addActor(cityStateIcon)
} }

View File

@ -11,12 +11,12 @@ class UnitGroup(val unit: MapUnit, val size: Float): Group() {
var blackSpinningCircle:Image?=null var blackSpinningCircle:Image?=null
init { init {
val unitBaseImage = ImageGetter.getUnitIcon(unit.name, unit.civInfo.nation.getSecondaryColor()) val unitBaseImage = ImageGetter.getUnitIcon(unit.name, unit.civInfo.nation.getInnerColor())
.apply { setSize(size * 0.75f, size * 0.75f) } .apply { setSize(size * 0.75f, size * 0.75f) }
val background = getBackgroundImageForUnit(unit) val background = getBackgroundImageForUnit(unit)
background.apply { background.apply {
this.color = unit.civInfo.nation.getColor() this.color = unit.civInfo.nation.getOuterColor()
setSize(size, size) setSize(size, size)
} }
setSize(size, size) setSize(size, size)

View File

@ -78,9 +78,9 @@ class Minimap(val tileMapHolder: TileMapHolder) : ScrollPane(null){
if (!(UnCivGame.Current.viewEntireMapForDebug || cloneCivilization.exploredTiles.contains(tileInfo.position))) if (!(UnCivGame.Current.viewEntireMapForDebug || cloneCivilization.exploredTiles.contains(tileInfo.position)))
hex.color = Color.DARK_GRAY hex.color = Color.DARK_GRAY
else if (tileInfo.isCityCenter() && !tileInfo.isWater) else if (tileInfo.isCityCenter() && !tileInfo.isWater)
hex.color = tileInfo.getOwner()!!.nation.getSecondaryColor() hex.color = tileInfo.getOwner()!!.nation.getInnerColor()
else if (tileInfo.getCity() != null && !tileInfo.isWater) else if (tileInfo.getCity() != null && !tileInfo.isWater)
hex.color = tileInfo.getOwner()!!.nation.getColor() hex.color = tileInfo.getOwner()!!.nation.getOuterColor()
else hex.color = tileInfo.getBaseTerrain().getColor().lerp(Color.GRAY, 0.5f) else hex.color = tileInfo.getBaseTerrain().getColor().lerp(Color.GRAY, 0.5f)
} }
} }

View File

@ -10,10 +10,10 @@ class PlayerReadyScreen(currentPlayerCiv: CivilizationInfo) : CameraStageBaseScr
init { init {
val table= Table() val table= Table()
table.touchable= Touchable.enabled table.touchable= Touchable.enabled
table.background= ImageGetter.getBackground(currentPlayerCiv.nation.getColor()) table.background= ImageGetter.getBackground(currentPlayerCiv.nation.getOuterColor())
table.add("[$currentPlayerCiv] ready?".toLabel().setFontSize(24) table.add("[$currentPlayerCiv] ready?".toLabel().setFontSize(24)
.setFontColor(currentPlayerCiv.nation.getSecondaryColor())) .setFontColor(currentPlayerCiv.nation.getInnerColor()))
table.onClick { table.onClick {
UnCivGame.Current.worldScreen = WorldScreen(currentPlayerCiv) UnCivGame.Current.worldScreen = WorldScreen(currentPlayerCiv)