mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
Ui fixes (#3218)
* moving close button to end of the list and setting color to red * aligning text/icon in main screen top bar
This commit is contained in:
parent
93bf69f3d5
commit
8e53be616d
@ -9,7 +9,6 @@ import com.badlogic.gdx.scenes.scene2d.ui.Slider
|
|||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||||
import com.badlogic.gdx.utils.Align
|
import com.badlogic.gdx.utils.Align
|
||||||
import com.unciv.Constants
|
import com.unciv.Constants
|
||||||
import com.unciv.UncivGame
|
|
||||||
import com.unciv.logic.HexMath
|
import com.unciv.logic.HexMath
|
||||||
import com.unciv.logic.civilization.CivilizationInfo
|
import com.unciv.logic.civilization.CivilizationInfo
|
||||||
import com.unciv.logic.civilization.diplomacy.DiplomaticStatus
|
import com.unciv.logic.civilization.diplomacy.DiplomaticStatus
|
||||||
@ -20,7 +19,8 @@ import com.unciv.models.translations.tr
|
|||||||
import com.unciv.ui.pickerscreens.PromotionPickerScreen
|
import com.unciv.ui.pickerscreens.PromotionPickerScreen
|
||||||
import com.unciv.ui.utils.*
|
import com.unciv.ui.utils.*
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
import kotlin.math.*
|
import kotlin.math.abs
|
||||||
|
import kotlin.math.roundToInt
|
||||||
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
||||||
|
|
||||||
class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPage: String = "Cities") : CameraStageBaseScreen(){
|
class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPage: String = "Cities") : CameraStageBaseScreen(){
|
||||||
@ -32,11 +32,6 @@ class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPa
|
|||||||
onBackButtonClicked { game.setWorldScreen() }
|
onBackButtonClicked { game.setWorldScreen() }
|
||||||
val clicks = HashMap<String,() -> Unit>()
|
val clicks = HashMap<String,() -> Unit>()
|
||||||
|
|
||||||
val closeButton = Constants.close.toTextButton()
|
|
||||||
closeButton.onClick { game.setWorldScreen() }
|
|
||||||
closeButton.y = stage.height - closeButton.height - 5
|
|
||||||
topTable.add(closeButton)
|
|
||||||
|
|
||||||
val setCityInfoButton = "Cities".toTextButton()
|
val setCityInfoButton = "Cities".toTextButton()
|
||||||
val setCities = {
|
val setCities = {
|
||||||
centerTable.clear()
|
centerTable.clear()
|
||||||
@ -89,6 +84,13 @@ class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPa
|
|||||||
if (viewingPlayer.detailedCivResources.isEmpty())
|
if (viewingPlayer.detailedCivResources.isEmpty())
|
||||||
setResourcesButton.disable()
|
setResourcesButton.disable()
|
||||||
|
|
||||||
|
val closeButton = Constants.close.toTextButton().apply {
|
||||||
|
setColor(0.75f, 0.1f, 0.1f, 1f)
|
||||||
|
}
|
||||||
|
closeButton.onClick { game.setWorldScreen() }
|
||||||
|
closeButton.y = stage.height - closeButton.height - 5
|
||||||
|
topTable.add(closeButton)
|
||||||
|
|
||||||
topTable.pack()
|
topTable.pack()
|
||||||
|
|
||||||
clicks[defaultPage]?.invoke()
|
clicks[defaultPage]?.invoke()
|
||||||
|
@ -84,7 +84,7 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() {
|
|||||||
|
|
||||||
statsTable.add(goldLabel)
|
statsTable.add(goldLabel)
|
||||||
val goldImage = ImageGetter.getStatIcon("Gold")
|
val goldImage = ImageGetter.getStatIcon("Gold")
|
||||||
statsTable.add(goldImage).padRight(20f).size(20f)
|
statsTable.add(goldImage).padRight(20f).padBottom(6f).size(20f)
|
||||||
val invokeStatsPage = {
|
val invokeStatsPage = {
|
||||||
worldScreen.game.setScreen(EmpireOverviewScreen(worldScreen.selectedCiv, "Stats"))
|
worldScreen.game.setScreen(EmpireOverviewScreen(worldScreen.selectedCiv, "Stats"))
|
||||||
}
|
}
|
||||||
@ -93,14 +93,14 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() {
|
|||||||
|
|
||||||
statsTable.add(scienceLabel) //.apply { setAlignment(Align.center) }).align(Align.top)
|
statsTable.add(scienceLabel) //.apply { setAlignment(Align.center) }).align(Align.top)
|
||||||
val scienceImage = ImageGetter.getStatIcon("Science")
|
val scienceImage = ImageGetter.getStatIcon("Science")
|
||||||
statsTable.add(scienceImage).padRight(20f).size(20f)
|
statsTable.add(scienceImage).padRight(20f).padBottom(6f).size(20f)
|
||||||
val invokeTechScreen = {
|
val invokeTechScreen = {
|
||||||
worldScreen.game.setScreen(TechPickerScreen(worldScreen.selectedCiv))
|
worldScreen.game.setScreen(TechPickerScreen(worldScreen.selectedCiv))
|
||||||
}
|
}
|
||||||
scienceLabel.onClick(invokeTechScreen)
|
scienceLabel.onClick(invokeTechScreen)
|
||||||
scienceImage.onClick(invokeTechScreen)
|
scienceImage.onClick(invokeTechScreen)
|
||||||
|
|
||||||
statsTable.add(happinessImage).size(20f)
|
statsTable.add(happinessImage).padBottom(6f).size(20f)
|
||||||
statsTable.add(happinessLabel).padRight(20f)//.apply { setAlignment(Align.center) }).align(Align.top)
|
statsTable.add(happinessLabel).padRight(20f)//.apply { setAlignment(Align.center) }).align(Align.top)
|
||||||
val invokeResourcesPage = {
|
val invokeResourcesPage = {
|
||||||
worldScreen.game.setScreen(EmpireOverviewScreen(worldScreen.selectedCiv, "Resources"))
|
worldScreen.game.setScreen(EmpireOverviewScreen(worldScreen.selectedCiv, "Resources"))
|
||||||
@ -110,7 +110,7 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() {
|
|||||||
|
|
||||||
statsTable.add(cultureLabel)//.apply { setAlignment(Align.center) }).align(Align.top)
|
statsTable.add(cultureLabel)//.apply { setAlignment(Align.center) }).align(Align.top)
|
||||||
val cultureImage = ImageGetter.getStatIcon("Culture")
|
val cultureImage = ImageGetter.getStatIcon("Culture")
|
||||||
statsTable.add(cultureImage).size(20f)
|
statsTable.add(cultureImage).padBottom(6f).size(20f)
|
||||||
val invokePoliciesPage = {
|
val invokePoliciesPage = {
|
||||||
worldScreen.game.setScreen(PolicyPickerScreen(worldScreen, worldScreen.selectedCiv))
|
worldScreen.game.setScreen(PolicyPickerScreen(worldScreen, worldScreen.selectedCiv))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user