Allow selection of non-buildable items (#2126)

This commit is contained in:
Jack Rainy
2020-03-12 08:34:44 +02:00
committed by GitHub
parent e370bbc53b
commit 528392baab

View File

@ -213,19 +213,18 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
pickProductionButton.add(buttonText.toLabel()).expandX().fillX().left() pickProductionButton.add(buttonText.toLabel()).expandX().fillX().left()
// no rejection reason means we can build it! // no rejection reason means we can build it!
if(rejectionReason == "") { if(rejectionReason != "") {
pickProductionButton.color = Color.GRAY
pickProductionButton.row()
pickProductionButton.add(rejectionReason.toLabel(Color.RED).apply{ setWrap(true)} )
.colspan(pickProductionButton.columns).fillX().left().padTop(2f)
}
pickProductionButton.onClick { pickProductionButton.onClick {
cityScreen.selectedConstruction = cityScreen.city.cityConstructions.getConstruction(construction) cityScreen.selectedConstruction = cityScreen.city.cityConstructions.getConstruction(construction)
cityScreen.selectedTile = null cityScreen.selectedTile = null
selectedQueueEntry = -2 selectedQueueEntry = -2
cityScreen.update() cityScreen.update()
} }
} else {
pickProductionButton.color = Color.GRAY
pickProductionButton.row()
pickProductionButton.add(rejectionReason.toLabel(Color.RED).apply{ setWrap(true)} )
.colspan(pickProductionButton.columns).fillX().left().padTop(2f)
}
return pickProductionButton return pickProductionButton
} }