Fix for #2358 crashing newgame choose nation (#2369)

* Bring Incas into the main game
(also changes slinger withdraw ability to inheritable)

* Update Nations.json

* Fix for #2358 JR's catch - crash after selection in nation picker
- events can fire after an actor has already been removed from its stage
This commit is contained in:
proteus-anguinus
2020-04-10 09:26:08 +02:00
committed by GitHub
parent 226801bfbd
commit d063c4cda1

View File

@ -40,10 +40,14 @@ open class AutoScrollPane(widget: Actor?, style: ScrollPaneStyle = ScrollPaneSty
init {
this.addListener (object : ClickListener() {
override fun enter(event: InputEvent?, x: Float, y: Float, pointer: Int, fromActor: Actor?) {
if (stage == null)
return
if (savedFocus == null) savedFocus = stage.scrollFocus
stage.scrollFocus = this@AutoScrollPane
}
override fun exit(event: InputEvent?, x: Float, y: Float, pointer: Int, toActor: Actor?) {
if (stage == null)
return
if (stage.scrollFocus == this@AutoScrollPane) stage.scrollFocus = savedFocus
savedFocus = null
}