mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-06 00:09:23 +07:00
Added a popup for people who try to create a game and fail
This commit is contained in:
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.app"
|
applicationId "com.unciv.app"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 230
|
versionCode 231
|
||||||
versionName "2.14.10"
|
versionName "2.15.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
// 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.onClick
|
||||||
import com.unciv.ui.utils.toLabel
|
import com.unciv.ui.utils.toLabel
|
||||||
import com.unciv.ui.worldscreen.WorldScreen
|
import com.unciv.ui.worldscreen.WorldScreen
|
||||||
|
import com.unciv.ui.worldscreen.optionstable.PopupTable
|
||||||
import kotlin.concurrent.thread
|
import kotlin.concurrent.thread
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
@ -95,7 +96,15 @@ class NewGameScreen: PickerScreen(){
|
|||||||
rightSideButton.setText("Working...".tr())
|
rightSideButton.setText("Working...".tr())
|
||||||
|
|
||||||
thread { // Creating a new game can take a while and we don't want ANRs
|
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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user