mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 16:29:48 +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())
|
for(unit in tile.getUnits())
|
||||||
if(gameInfo.civilizations.none { it.civName== unit.owner}){
|
if(gameInfo.civilizations.none { it.civName== unit.owner}){
|
||||||
unit.currentTile=tile
|
unit.currentTile=tile
|
||||||
|
unit.setTransients(ruleset)
|
||||||
unit.removeFromTile()
|
unit.removeFromTile()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +68,8 @@ 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!
|
// 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!
|
||||||
addCivStartingUnits(gameInfo)
|
if (gameSetupInfo.mapParameters.type != MapType.scenario)
|
||||||
|
addCivStartingUnits(gameInfo)
|
||||||
|
|
||||||
return gameInfo
|
return gameInfo
|
||||||
}
|
}
|
||||||
|
@ -96,28 +96,6 @@ class NewGameScreen(previousScreen:CameraStageBaseScreen, _gameSetupInfo: GameSe
|
|||||||
private fun newGameThread() {
|
private fun newGameThread() {
|
||||||
try {
|
try {
|
||||||
newGame = GameStarter.startNewGame(gameSetupInfo)
|
newGame = GameStarter.startNewGame(gameSetupInfo)
|
||||||
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 {
|
|
||||||
OnlineMultiplayer().tryUploadGame(newGame!!)
|
|
||||||
GameSaver.autoSave(newGame!!) {}
|
|
||||||
|
|
||||||
// Saved as Multiplayer game to show up in the session browser
|
|
||||||
GameSaver.saveGame(newGame!!, newGame!!.gameId, true)
|
|
||||||
// Save gameId to clipboard because you have to do it anyway.
|
|
||||||
Gdx.app.clipboard.contents = newGame!!.gameId
|
|
||||||
// Popup to notify the User that the gameID got copied to the clipboard
|
|
||||||
Gdx.app.postRunnable { ResponsePopup("gameID copied to clipboard".tr(), UncivGame.Current.worldScreen, 2500) }
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
Gdx.app.postRunnable {
|
|
||||||
val cantUploadNewGamePopup = Popup(this)
|
|
||||||
cantUploadNewGamePopup.addGoodSizedLabel("Could not upload game!")
|
|
||||||
cantUploadNewGamePopup.addCloseButton()
|
|
||||||
cantUploadNewGamePopup.open()
|
|
||||||
}
|
|
||||||
newGame = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
Gdx.app.postRunnable {
|
Gdx.app.postRunnable {
|
||||||
val cantMakeThatMapPopup = Popup(this)
|
val cantMakeThatMapPopup = Popup(this)
|
||||||
@ -130,14 +108,33 @@ class NewGameScreen(previousScreen:CameraStageBaseScreen, _gameSetupInfo: GameSe
|
|||||||
rightSideButton.setText("Start game!".tr())
|
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 {
|
||||||
|
OnlineMultiplayer().tryUploadGame(newGame!!)
|
||||||
|
GameSaver.autoSave(newGame!!) {}
|
||||||
|
|
||||||
|
// Saved as Multiplayer game to show up in the session browser
|
||||||
|
GameSaver.saveGame(newGame!!, newGame!!.gameId, true)
|
||||||
|
// Save gameId to clipboard because you have to do it anyway.
|
||||||
|
Gdx.app.clipboard.contents = newGame!!.gameId
|
||||||
|
// Popup to notify the User that the gameID got copied to the clipboard
|
||||||
|
Gdx.app.postRunnable { ResponsePopup("gameID copied to clipboard".tr(), UncivGame.Current.worldScreen, 2500) }
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
Gdx.app.postRunnable {
|
||||||
|
val cantUploadNewGamePopup = Popup(this)
|
||||||
|
cantUploadNewGamePopup.addGoodSizedLabel("Could not upload game!")
|
||||||
|
cantUploadNewGamePopup.addCloseButton()
|
||||||
|
cantUploadNewGamePopup.open()
|
||||||
|
}
|
||||||
|
newGame = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Gdx.graphics.requestRendering()
|
Gdx.graphics.requestRendering()
|
||||||
}
|
}
|
||||||
|
|
||||||
// fun setNewGameButtonEnabled(bool: Boolean) {
|
|
||||||
// if (bool) rightSideButton.enable()
|
|
||||||
// else rightSideButton.disable()
|
|
||||||
// }
|
|
||||||
|
|
||||||
fun lockTables() {
|
fun lockTables() {
|
||||||
playerPickerTable.locked = true
|
playerPickerTable.locked = true
|
||||||
newGameOptionsTable.locked = true
|
newGameOptionsTable.locked = true
|
||||||
|
Reference in New Issue
Block a user