mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Fix UnitTable layout (#9392)
This commit is contained in:
parent
fc222ca4cf
commit
6d185ea5a5
@ -106,10 +106,10 @@ class UnitTable(val worldScreen: WorldScreen) : Table() {
|
|||||||
add(unitIconNameGroup)
|
add(unitIconNameGroup)
|
||||||
add(nextIdleUnitButton)
|
add(nextIdleUnitButton)
|
||||||
}
|
}
|
||||||
add(moveBetweenUnitsTable).colspan(2).fill().row()
|
add(moveBetweenUnitsTable).fill().row()
|
||||||
|
|
||||||
separator = addSeparator().actor!!
|
separator = addSeparator().padBottom(5f).actor!!
|
||||||
add(promotionsTable).colspan(2).row()
|
add(promotionsTable).row()
|
||||||
add(unitDescriptionTable)
|
add(unitDescriptionTable)
|
||||||
touchable = Touchable.enabled
|
touchable = Touchable.enabled
|
||||||
onClick {
|
onClick {
|
||||||
@ -262,13 +262,14 @@ class UnitTable(val worldScreen: WorldScreen) : Table() {
|
|||||||
unitIconHolder.clear()
|
unitIconHolder.clear()
|
||||||
promotionsTable.clear()
|
promotionsTable.clear()
|
||||||
unitDescriptionTable.clearListeners()
|
unitDescriptionTable.clearListeners()
|
||||||
|
separator.width = 0f // ImageWithCustomSize remembers width and returns if when Table asks for prefWidth
|
||||||
|
|
||||||
if (selectedUnit != null) {
|
if (selectedUnit != null) {
|
||||||
if (selectedUnits.size == 1) { // single selected unit
|
if (selectedUnits.size == 1) { // single selected unit
|
||||||
unitIconHolder.add(UnitGroup(selectedUnit!!, 30f)).pad(5f)
|
unitIconHolder.add(UnitGroup(selectedUnit!!, 30f)).pad(5f)
|
||||||
|
|
||||||
for (promotion in selectedUnit!!.promotions.getPromotions(true))
|
for (promotion in selectedUnit!!.promotions.getPromotions(true))
|
||||||
promotionsTable.add(ImageGetter.getPromotionPortrait(promotion.name))
|
promotionsTable.add(ImageGetter.getPromotionPortrait(promotion.name)).padBottom(2f)
|
||||||
|
|
||||||
// Since Clear also clears the listeners, we need to re-add them every time
|
// Since Clear also clears the listeners, we need to re-add them every time
|
||||||
promotionsTable.onClick {
|
promotionsTable.onClick {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user