Added a popup for people who try to create a game and fail

This commit is contained in:
Yair Morgenstern 2019-04-24 21:14:53 +03:00
parent 143d4422e8
commit d8c238bf97
2 changed files with 12 additions and 3 deletions

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.app"
minSdkVersion 14
targetSdkVersion 28
versionCode 230
versionName "2.14.10"
versionCode 231
versionName "2.15.0"
}
// Had to add this crap for Travis to build, it wanted to sign the app

View File

@ -18,6 +18,7 @@ import com.unciv.ui.utils.enable
import com.unciv.ui.utils.onClick
import com.unciv.ui.utils.toLabel
import com.unciv.ui.worldscreen.WorldScreen
import com.unciv.ui.worldscreen.optionstable.PopupTable
import kotlin.concurrent.thread
import kotlin.math.min
@ -95,7 +96,15 @@ class NewGameScreen: PickerScreen(){
rightSideButton.setText("Working...".tr())
thread { // Creating a new game can take a while and we don't want ANRs
newGame = GameStarter().startNewGame(newGameParameters)
try {
newGame = GameStarter().startNewGame(newGameParameters)
}
catch (exception:Exception){
val popup = PopupTable(this)
popup.addGoodSizedLabel("It looks like we can't make a map with the parameters you requested!").row()
popup.addGoodSizedLabel("Maybe you put too many players into too small a map?").row()
popup.open()
}
}
}