Notification icons are now on the RIGHT so you can scroll notifications and find interesting ones faster

This commit is contained in:
Yair Morgenstern 2022-02-06 19:58:22 +02:00
parent 9726b90b22
commit 9da66c8c08

View File

@ -35,10 +35,14 @@ class NotificationsScroll(internal val worldScreen: WorldScreen) : ScrollPane(nu
val label = notification.text.toLabel(Color.BLACK, 30) val label = notification.text.toLabel(Color.BLACK, 30)
val listItem = Table() val listItem = Table()
listItem.background = ImageGetter.getRoundedEdgeRectangle()
listItem.add(label)
val iconSize = 30f val iconSize = 30f
if (notification.icons.isNotEmpty()) { if (notification.icons.isNotEmpty()) {
val ruleset = worldScreen.gameInfo.ruleSet val ruleset = worldScreen.gameInfo.ruleSet
for (icon in notification.icons) { for (icon in notification.icons.reversed()) {
val image: Actor = when { val image: Actor = when {
ruleset.technologies.containsKey(icon) -> ImageGetter.getTechIcon(icon) ruleset.technologies.containsKey(icon) -> ImageGetter.getTechIcon(icon)
ruleset.nations.containsKey(icon) -> ImageGetter.getNationIndicator(ruleset.nations[icon]!!, iconSize) ruleset.nations.containsKey(icon) -> ImageGetter.getNationIndicator(ruleset.nations[icon]!!, iconSize)
@ -48,8 +52,6 @@ class NotificationsScroll(internal val worldScreen: WorldScreen) : ScrollPane(nu
listItem.add(image).size(iconSize).padRight(5f) listItem.add(image).size(iconSize).padRight(5f)
} }
} }
listItem.background = ImageGetter.getRoundedEdgeRectangle()
listItem.add(label)
// using a large click area with no gap in between each message item. // using a large click area with no gap in between each message item.
// this avoids accidentally clicking in between the messages, resulting in a map click // this avoids accidentally clicking in between the messages, resulting in a map click