mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-04 16:11:46 +07:00
More rankings & demographics screen icons (#7063)
* Add icons to demographics/rankings screen * Unused import * Some simplification * Reviews * Undelete atlas
This commit is contained in:
parent
e91c0ff212
commit
1312140793
File diff suppressed because it is too large
Load Diff
@ -1,14 +1,19 @@
|
||||
package com.unciv.ui.victoryscreen
|
||||
|
||||
enum class RankingType {
|
||||
Score,
|
||||
Population,
|
||||
Crop_Yield,
|
||||
Production,
|
||||
Gold,
|
||||
Territory,
|
||||
Force,
|
||||
Happiness,
|
||||
Technologies,
|
||||
Culture
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Image
|
||||
import com.unciv.ui.images.ImageGetter
|
||||
|
||||
enum class RankingType(val getImage: ()->Image?) {
|
||||
// production, gold, happiness, and culture already have icons added when the line is `tr()`anslated
|
||||
Score({ ImageGetter.getImage("OtherIcons/Cultured").apply { color = Color.FIREBRICK } }),
|
||||
Population({ ImageGetter.getStatIcon("Population") }),
|
||||
Crop_Yield({ ImageGetter.getStatIcon("Food") }),
|
||||
Production({ null }),
|
||||
Gold({ null }),
|
||||
Territory({ ImageGetter.getImage("OtherIcons/Hexagon") }),
|
||||
Force({ ImageGetter.getImage("OtherIcons/Shield") }),
|
||||
Happiness({ null }),
|
||||
Technologies({ ImageGetter.getStatIcon("Science") }),
|
||||
Culture({ null })
|
||||
}
|
@ -223,8 +223,12 @@ class VictoryScreen(val worldScreen: WorldScreen) : PickerScreen() {
|
||||
|
||||
for (category in RankingType.values()) {
|
||||
val headers = Table().apply { defaults().pad(5f) }
|
||||
headers.add(category.name.replace('_', ' ').toLabel()).row()
|
||||
headers.addSeparator().fillX()
|
||||
val textAndIcon = Table().apply { defaults() }
|
||||
val columnImage = category.getImage()
|
||||
if (columnImage != null) textAndIcon.add(columnImage).center().size(Constants.defaultFontSize.toFloat() * 0.75f).padRight(2f).padTop(-2f)
|
||||
textAndIcon.add(category.name.replace('_', ' ').toLabel()).row()
|
||||
headers.add(textAndIcon)
|
||||
headers.addSeparator()
|
||||
demographicsTable.add(headers)
|
||||
}
|
||||
}
|
||||
@ -234,7 +238,11 @@ class VictoryScreen(val worldScreen: WorldScreen) : PickerScreen() {
|
||||
|
||||
for (category in RankingType.values()) {
|
||||
val column = Table().apply { defaults().pad(5f) }
|
||||
column.add(category.name.replace('_' , ' ').toLabel()).row()
|
||||
val textAndIcon = Table().apply { defaults() }
|
||||
val columnImage = category.getImage()
|
||||
if (columnImage != null) textAndIcon.add(columnImage).size(Constants.defaultFontSize.toFloat() * 0.75f).padRight(2f).padTop(-2f)
|
||||
textAndIcon.add(category.name.replace('_' , ' ').toLabel()).row()
|
||||
column.add(textAndIcon)
|
||||
column.addSeparator()
|
||||
|
||||
for (civ in majorCivs.sortedByDescending { it.getStatForRanking(category) }) {
|
||||
|
Loading…
Reference in New Issue
Block a user