This commit is contained in:
Yair Morgenstern
2020-10-21 19:01:07 +03:00
parent 635a12feae
commit 8dde23aa38
29 changed files with 115 additions and 126 deletions

View File

@ -30,7 +30,7 @@ class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPa
init {
onBackButtonClicked { game.setWorldScreen() }
val clicks = HashMap<String,() -> Unit>()
val clicks = HashMap<String, () -> Unit>()
val setCityInfoButton = "Cities".toTextButton()
val setCities = {
@ -43,8 +43,8 @@ class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPa
topTable.add(setCityInfoButton)
val setStatsInfoButton = "Stats".toTextButton()
clicks["Stats"] = {setStats()}
setStatsInfoButton.onClick{setStats()}
clicks["Stats"] = { setStats() }
setStatsInfoButton.onClick { setStats() }
topTable.add(setStatsInfoButton)
val setCurrentTradesButton = "Trades".toTextButton()
@ -60,7 +60,7 @@ class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPa
val setUnitsButton = "Units".toTextButton()
setUnitsButton.onClick {
centerTable.clear()
centerTable.add(ScrollPane(getUnitTable()).apply { setOverscroll(false,false) }).height(stage.height * 0.8f)
centerTable.add(ScrollPane(getUnitTable()).apply { setOverscroll(false, false) }).height(stage.height * 0.8f)
centerTable.pack()
}
topTable.add(setUnitsButton)
@ -321,7 +321,7 @@ class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPa
private fun getUnitTable(): Table {
val table=Table(skin).apply { defaults().pad(5f) }
val table = Table(skin).apply { defaults().pad(5f) }
table.add("Name".tr())
table.add("Action".tr())
table.add(Fonts.strength.toString())
@ -333,8 +333,8 @@ class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPa
table.row()
table.addSeparator()
for(unit in viewingPlayer.getCivUnits().sortedWith(compareBy({it.name},{!it.due},
{it.currentMovement<0.1f},{abs(it.currentTile.position.x)+abs(it.currentTile.position.y)}))) {
for (unit in viewingPlayer.getCivUnits().sortedWith(compareBy({ it.name }, { !it.due },
{ it.currentMovement < 0.1f }, { abs(it.currentTile.position.x) + abs(it.currentTile.position.y) }))) {
val baseUnit = unit.baseUnit()
val button = unit.name.toTextButton()
button.onClick {