Fixed #467 - popups on separate screens affected each other

This commit is contained in:
Yair Morgenstern 2019-02-24 13:07:34 +02:00
parent b73077baa4
commit 6cda5bb8ad
3 changed files with 6 additions and 9 deletions

View file

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

View file

@ -19,6 +19,7 @@ open class CameraStageBaseScreen : Screen {
var game: UnCivGame = UnCivGame.Current
var stage: Stage
var tutorials = Tutorials()
var hasPopupOpen = false
init {
val resolutions: List<Float> = game.settings.resolution.split("x").map { it.toInt().toFloat() }

View file

@ -40,8 +40,8 @@ open class PopupTable(val screen: CameraStageBaseScreen): Table(CameraStageBaseS
class YesNoPopupTable(question:String, action:()->Unit,
screen: CameraStageBaseScreen = UnCivGame.Current.worldScreen) : PopupTable(screen){
init{
if(!isOpen) {
isOpen=true
if(!screen.hasPopupOpen) {
screen.hasPopupOpen=true
add(question.toLabel()).colspan(2).row()
add(TextButton("No".tr(), skin).onClick { close() })
@ -52,10 +52,6 @@ class YesNoPopupTable(question:String, action:()->Unit,
fun close(){
remove()
isOpen=false
}
companion object {
var isOpen=false
screen.hasPopupOpen=false
}
}