mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-28 13:48:49 +07:00
* 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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user