UnitTable close button clickHandler fix (#8573)

This commit is contained in:
Gualdimar
2023-02-04 19:31:55 +02:00
committed by GitHub
parent 5335a34734
commit c7a6082fd7

View File

@ -82,15 +82,16 @@ class UnitTable(val worldScreen: WorldScreen) : Table() {
add(VerticalGroup().apply {
pad(5f)
deselectUnitButton.add(ImageGetter.getImage("OtherIcons/Close")).size(20f).pad(10f)
deselectUnitButton.pack()
deselectUnitButton.touchable = Touchable.enabled
deselectUnitButton.onClick {
touchable = Touchable.enabled
onClick {
selectUnit()
worldScreen.shouldUpdate = true
this@UnitTable.isVisible = false
}
deselectUnitButton.add(ImageGetter.getImage("OtherIcons/Close")).size(20f).pad(10f)
deselectUnitButton.pack()
deselectUnitButton.touchable = Touchable.enabled
addActor(deselectUnitButton)
}).left()