Menu no longer appears multiple times on top of itself if you click the menu button several times in a row

This commit is contained in:
Yair Morgenstern 2018-06-22 00:53:24 +03:00
parent bbbccc96ef
commit c1d196d38c

View File

@ -84,7 +84,8 @@ class WorldScreenTopBar(val screen: WorldScreen) : Table() {
.apply { setSize(50f, 50f) }
menuButton.color = Color.WHITE
menuButton.addClickListener {
screen.stage.addActor(WorldScreenOptionsTable())
if(screen.stage.actors.none { it is WorldScreenOptionsTable })
screen.stage.addActor(WorldScreenOptionsTable())
}
menuButton.centerY(this)
menuButton.x = menuButton.y