mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 15:27:50 +07:00
Fixed #467 - popups on separate screens affected each other
This commit is contained in:
@ -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
|
||||
|
@ -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() }
|
||||
|
@ -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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user