mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 23:39:40 +07:00
Scenario now no longer spawns starting units - they should be prebuilt into the scenario!
This commit is contained in:
@ -35,6 +35,7 @@ object GameStarter {
|
||||
for(unit in tile.getUnits())
|
||||
if(gameInfo.civilizations.none { it.civName== unit.owner}){
|
||||
unit.currentTile=tile
|
||||
unit.setTransients(ruleset)
|
||||
unit.removeFromTile()
|
||||
}
|
||||
|
||||
@ -67,6 +68,7 @@ object GameStarter {
|
||||
}
|
||||
|
||||
// and only now do we add units for everyone, because otherwise both the gameInfo.setTransients() and the placeUnit will both add the unit to the civ's unit list!
|
||||
if (gameSetupInfo.mapParameters.type != MapType.scenario)
|
||||
addCivStartingUnits(gameInfo)
|
||||
|
||||
return gameInfo
|
||||
|
@ -96,6 +96,19 @@ class NewGameScreen(previousScreen:CameraStageBaseScreen, _gameSetupInfo: GameSe
|
||||
private fun newGameThread() {
|
||||
try {
|
||||
newGame = GameStarter.startNewGame(gameSetupInfo)
|
||||
} catch (exception: Exception) {
|
||||
Gdx.app.postRunnable {
|
||||
val cantMakeThatMapPopup = Popup(this)
|
||||
cantMakeThatMapPopup.addGoodSizedLabel("It looks like we can't make a map with the parameters you requested!".tr()).row()
|
||||
cantMakeThatMapPopup.addGoodSizedLabel("Maybe you put too many players into too small a map?".tr()).row()
|
||||
cantMakeThatMapPopup.addCloseButton()
|
||||
cantMakeThatMapPopup.open()
|
||||
Gdx.input.inputProcessor = stage
|
||||
rightSideButton.enable()
|
||||
rightSideButton.setText("Start game!".tr())
|
||||
}
|
||||
}
|
||||
|
||||
if (gameSetupInfo.gameParameters.isOnlineMultiplayer) {
|
||||
newGame!!.isUpToDate = true // So we don't try to download it from dropbox the second after we upload it - the file is not yet ready for loading!
|
||||
try {
|
||||
@ -118,26 +131,10 @@ class NewGameScreen(previousScreen:CameraStageBaseScreen, _gameSetupInfo: GameSe
|
||||
newGame = null
|
||||
}
|
||||
}
|
||||
} catch (exception: Exception) {
|
||||
Gdx.app.postRunnable {
|
||||
val cantMakeThatMapPopup = Popup(this)
|
||||
cantMakeThatMapPopup.addGoodSizedLabel("It looks like we can't make a map with the parameters you requested!".tr()).row()
|
||||
cantMakeThatMapPopup.addGoodSizedLabel("Maybe you put too many players into too small a map?".tr()).row()
|
||||
cantMakeThatMapPopup.addCloseButton()
|
||||
cantMakeThatMapPopup.open()
|
||||
Gdx.input.inputProcessor = stage
|
||||
rightSideButton.enable()
|
||||
rightSideButton.setText("Start game!".tr())
|
||||
}
|
||||
}
|
||||
|
||||
Gdx.graphics.requestRendering()
|
||||
}
|
||||
|
||||
// fun setNewGameButtonEnabled(bool: Boolean) {
|
||||
// if (bool) rightSideButton.enable()
|
||||
// else rightSideButton.disable()
|
||||
// }
|
||||
|
||||
fun lockTables() {
|
||||
playerPickerTable.locked = true
|
||||
newGameOptionsTable.locked = true
|
||||
|
Reference in New Issue
Block a user