mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 09:17:47 +07:00
Added a popup for people who try to create a game and fail
This commit is contained in:
parent
143d4422e8
commit
d8c238bf97
@ -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
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user