mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 22:06:05 -04:00
Fixed queue showing "Consumes 1" when no resource is consumed
Plus linting
This commit is contained in:
parent
5328efa233
commit
7d9b56e3b1
@ -39,7 +39,8 @@ open class TileInfo {
|
|||||||
// This will be called often - farm can be built on Hill and tundra if adjacent to fresh water
|
// This will be called often - farm can be built on Hill and tundra if adjacent to fresh water
|
||||||
// and farms on adjacent to fresh water tiles will have +1 additional Food after researching Civil Service
|
// and farms on adjacent to fresh water tiles will have +1 additional Food after researching Civil Service
|
||||||
@delegate:Transient
|
@delegate:Transient
|
||||||
val isAdjacentToFreshwater: Boolean by lazy { matchesUniqueFilter("River") || matchesUniqueFilter("Fresh water") || neighbors.any { it.matchesUniqueFilter("Fresh water") } }
|
val isAdjacentToFreshwater: Boolean by lazy { matchesUniqueFilter("River") || matchesUniqueFilter("Fresh water")
|
||||||
|
|| neighbors.any { it.matchesUniqueFilter("Fresh water") } }
|
||||||
|
|
||||||
var militaryUnit: MapUnit? = null
|
var militaryUnit: MapUnit? = null
|
||||||
var civilianUnit: MapUnit? = null
|
var civilianUnit: MapUnit? = null
|
||||||
|
@ -76,8 +76,7 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo, tileSetStrin
|
|||||||
|
|
||||||
if (tileInfo.isWorked()) {
|
if (tileInfo.isWorked()) {
|
||||||
yieldGroup.color = Color.WHITE
|
yieldGroup.color = Color.WHITE
|
||||||
}
|
} else if (!tileInfo.isCityCenter()) {
|
||||||
else if(!tileInfo.isCityCenter()){
|
|
||||||
yieldGroup.color = Color.GRAY.cpy().apply { a = 0.5f }
|
yieldGroup.color = Color.GRAY.cpy().apply { a = 0.5f }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,12 +88,8 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo, tileSetStrin
|
|||||||
populationIcon.setPosition(width / 2 - populationIcon.width / 2,
|
populationIcon.setPosition(width / 2 - populationIcon.width / 2,
|
||||||
height * 0.85f - populationIcon.height / 2)
|
height * 0.85f - populationIcon.height / 2)
|
||||||
|
|
||||||
if (tileInfo.isWorked()) {
|
if (tileInfo.isWorked()) populationIcon.color = Color.WHITE
|
||||||
populationIcon.color = Color.WHITE
|
else if (!tileInfo.isCityCenter()) populationIcon.color = Color.GRAY.cpy()
|
||||||
}
|
|
||||||
else if(!tileInfo.isCityCenter()){
|
|
||||||
populationIcon.color = Color.GRAY.cpy()
|
|
||||||
}
|
|
||||||
|
|
||||||
populationIcon.toFront()
|
populationIcon.toFront()
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
|||||||
|
|
||||||
class ConstructionInfoTable(val city: CityInfo): Table() {
|
class ConstructionInfoTable(val city: CityInfo): Table() {
|
||||||
val selectedConstructionTable = Table()
|
val selectedConstructionTable = Table()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
selectedConstructionTable.background = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f))
|
selectedConstructionTable.background = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f))
|
||||||
add(selectedConstructionTable).pad(2f).fill()
|
add(selectedConstructionTable).pad(2f).fill()
|
||||||
@ -55,8 +56,7 @@ class ConstructionInfoTable(val city: CityInfo): Table() {
|
|||||||
val turnsToComplete = cityConstructions.turnsToConstruction(construction.name)
|
val turnsToComplete = cityConstructions.turnsToConstruction(construction.name)
|
||||||
buildingText += ("\r\n" + "Cost".tr() + " " + construction.getProductionCost(city.civInfo).toString()).tr()
|
buildingText += ("\r\n" + "Cost".tr() + " " + construction.getProductionCost(city.civInfo).toString()).tr()
|
||||||
buildingText += turnOrTurns(turnsToComplete)
|
buildingText += turnOrTurns(turnsToComplete)
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
buildingText += specialConstruction.getProductionTooltip(city)
|
buildingText += specialConstruction.getProductionTooltip(city)
|
||||||
}
|
}
|
||||||
selectedConstructionTable.add(buildingText.toLabel()).row()
|
selectedConstructionTable.add(buildingText.toLabel()).row()
|
||||||
|
@ -228,9 +228,10 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
|
|||||||
else turnOrTurns(turnsToComplete)
|
else turnOrTurns(turnsToComplete)
|
||||||
|
|
||||||
val constructionResource = cityConstructions.getConstruction(name).getResourceRequirements()
|
val constructionResource = cityConstructions.getConstruction(name).getResourceRequirements()
|
||||||
|
for ((resource, amount) in constructionResource)
|
||||||
|
if (amount == 1) text += "\n" + "Consumes 1 [$resource]".tr()
|
||||||
|
else text += "\n" + "Consumes [$amount] [$resource]".tr()
|
||||||
|
|
||||||
if (constructionResource != null)
|
|
||||||
text += "\n" + "Consumes 1 [$constructionResource]".tr()
|
|
||||||
|
|
||||||
table.defaults().pad(2f).minWidth(40f)
|
table.defaults().pad(2f).minWidth(40f)
|
||||||
if (isFirstConstructionOfItsKind) table.add(getProgressBar(name)).minWidth(5f)
|
if (isFirstConstructionOfItsKind) table.add(getProgressBar(name)).minWidth(5f)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user