mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 23:10:39 -04:00
added a ? to the unit panel in the lower left and fixed jumping ui elements there
This commit is contained in:
parent
dcb7daaabd
commit
0ce55feb39
@ -10,7 +10,7 @@ class WorldScreenBottomBar(val worldScreen: WorldScreen) : Table(){
|
|||||||
val tileInfoTable = TileInfoTable(worldScreen)
|
val tileInfoTable = TileInfoTable(worldScreen)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
add(unitTable).width(worldScreen.stage.width/3).fill()
|
add(unitTable).width(worldScreen.stage.width/3).bottom().fillX()
|
||||||
add().width(worldScreen.stage.width/3) // empty space for the battle table
|
add().width(worldScreen.stage.width/3) // empty space for the battle table
|
||||||
add(tileInfoTable).width(worldScreen.stage.width/3).fill()
|
add(tileInfoTable).width(worldScreen.stage.width/3).fill()
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@ package com.unciv.ui.worldscreen.unit
|
|||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
import com.badlogic.gdx.scenes.scene2d.Touchable
|
import com.badlogic.gdx.scenes.scene2d.Touchable
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Image
|
import com.badlogic.gdx.scenes.scene2d.ui.*
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Label
|
import com.unciv.UnCivGame
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
|
||||||
import com.unciv.logic.battle.CityCombatant
|
import com.unciv.logic.battle.CityCombatant
|
||||||
import com.unciv.logic.city.CityInfo
|
import com.unciv.logic.city.CityInfo
|
||||||
import com.unciv.logic.map.MapUnit
|
import com.unciv.logic.map.MapUnit
|
||||||
import com.unciv.logic.map.TileInfo
|
import com.unciv.logic.map.TileInfo
|
||||||
import com.unciv.models.gamebasics.tr
|
import com.unciv.models.gamebasics.tr
|
||||||
|
import com.unciv.ui.CivilopediaScreen
|
||||||
import com.unciv.ui.utils.*
|
import com.unciv.ui.utils.*
|
||||||
import com.unciv.ui.worldscreen.WorldScreen
|
import com.unciv.ui.worldscreen.WorldScreen
|
||||||
|
|
||||||
@ -25,6 +25,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
|
|||||||
var currentlyExecutingAction : String? = null
|
var currentlyExecutingAction : String? = null
|
||||||
var lastSelectedCityButton : Boolean = false
|
var lastSelectedCityButton : Boolean = false
|
||||||
val deselectUnitButton = Table()
|
val deselectUnitButton = Table()
|
||||||
|
val helpUnitButton = Table()
|
||||||
|
|
||||||
// This is so that not on every update(), we will update the unit table.
|
// This is so that not on every update(), we will update the unit table.
|
||||||
// Most of the time it's the same unit with the same stats so why waste precious time?
|
// Most of the time it's the same unit with the same stats so why waste precious time?
|
||||||
@ -33,23 +34,41 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
pad(5f)
|
pad(5f)
|
||||||
|
|
||||||
background = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f))
|
background = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f))
|
||||||
|
|
||||||
add(Table().apply {
|
add(VerticalGroup().apply {
|
||||||
add(prevIdleUnitButton)
|
pad(5f)
|
||||||
add(unitIconHolder)
|
|
||||||
add(unitNameLabel).pad(5f)
|
deselectUnitButton.add(Label("X",CameraStageBaseScreen.skin).setFontColor(Color.WHITE)).pad(10f)
|
||||||
add(nextIdleUnitButton)
|
deselectUnitButton.pack()
|
||||||
}).colspan(2).row()
|
deselectUnitButton.touchable = Touchable.enabled
|
||||||
separator= addSeparator().actor!!
|
deselectUnitButton.onClick { selectedUnit=null; selectedCity=null; worldScreen.shouldUpdate=true }
|
||||||
add(promotionsTable).colspan(2).row()
|
addActor(deselectUnitButton)
|
||||||
add(unitDescriptionTable)
|
|
||||||
|
helpUnitButton.add(Label("?",CameraStageBaseScreen.skin).setFontColor(Color.WHITE)).pad(10f)
|
||||||
|
helpUnitButton.pack()
|
||||||
|
helpUnitButton.touchable = Touchable.enabled
|
||||||
|
helpUnitButton.onClick { UnCivGame.Current.screen = CivilopediaScreen() }
|
||||||
|
addActor(helpUnitButton)
|
||||||
|
|
||||||
|
}).left()
|
||||||
|
|
||||||
|
add(prevIdleUnitButton)
|
||||||
|
|
||||||
|
add(Table().apply {
|
||||||
|
add(Table().apply {
|
||||||
|
add(unitIconHolder)
|
||||||
|
add(unitNameLabel).pad(5f)
|
||||||
|
|
||||||
|
}).colspan(2).fill().row()
|
||||||
|
separator= addSeparator().actor!!
|
||||||
|
add(promotionsTable).colspan(2).row()
|
||||||
|
add(unitDescriptionTable)
|
||||||
|
}).expand()
|
||||||
|
|
||||||
|
add(nextIdleUnitButton)
|
||||||
|
|
||||||
deselectUnitButton.add(Label("X",CameraStageBaseScreen.skin).setFontColor(Color.WHITE)).pad(20f)
|
|
||||||
deselectUnitButton.pack()
|
|
||||||
deselectUnitButton.touchable = Touchable.enabled
|
|
||||||
deselectUnitButton.onClick { selectedUnit=null; selectedCity=null; worldScreen.shouldUpdate=true }
|
|
||||||
addActor(deselectUnitButton)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun update() {
|
fun update() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user