mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Can now play an entire scenario with no improvements or techs defined
This commit is contained in:
parent
7382d4f8e8
commit
5084bb6f9e
@ -283,6 +283,8 @@ class CivilizationInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getEra(): String {
|
fun getEra(): String {
|
||||||
|
// For scenarios with no techs
|
||||||
|
if (gameInfo.ruleSet.technologies.isEmpty()) return "None"
|
||||||
if(tech.researchedTechnologies.isEmpty())
|
if(tech.researchedTechnologies.isEmpty())
|
||||||
return gameInfo.ruleSet.getEras().first()
|
return gameInfo.ruleSet.getEras().first()
|
||||||
val maxEraOfTech = tech.researchedTechnologies
|
val maxEraOfTech = tech.researchedTechnologies
|
||||||
|
@ -124,6 +124,7 @@ class GameOptionsTable(val previousScreen: IPreviousScreen, val updatePlayerPick
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun Table.addEraSelectBox() {
|
private fun Table.addEraSelectBox() {
|
||||||
|
if (ruleset.technologies.isEmpty()) return // scenario with no techs
|
||||||
val eras = ruleset.technologies.values.map { it.era() }.distinct()
|
val eras = ruleset.technologies.values.map { it.era() }.distinct()
|
||||||
addSelectBox("{Starting Era}:", eras, gameParameters.startingEra)
|
addSelectBox("{Starting Era}:", eras, gameParameters.startingEra)
|
||||||
{ gameParameters.startingEra = it }
|
{ gameParameters.startingEra = it }
|
||||||
|
@ -27,14 +27,15 @@ class UnitContextMenu(val tileMapHolder: WorldMapHolder, val selectedUnit: MapUn
|
|||||||
onMoveButtonClick()
|
onMoveButtonClick()
|
||||||
}
|
}
|
||||||
|
|
||||||
addButton(
|
// Basic scenarios sommetimes don't have roads
|
||||||
ImageGetter.getImprovementIcon("Road"),
|
if (selectedUnit.civInfo.gameInfo.ruleSet.tileImprovements.containsKey("Road"))
|
||||||
"Construct road",
|
addButton(
|
||||||
BuildLongRoadAction(selectedUnit, targetTile)
|
ImageGetter.getImprovementIcon("Road"),
|
||||||
)
|
"Construct road",
|
||||||
|
BuildLongRoadAction(selectedUnit, targetTile)
|
||||||
|
)
|
||||||
|
|
||||||
pack()
|
pack()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addButton(icon: Actor, label: String, action: MapUnitAction) {
|
fun addButton(icon: Actor, label: String, action: MapUnitAction) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user