Skip to content

Commit

Permalink
More unit table improvements - see #12591
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Dec 13, 2024
1 parent 6c4965a commit dcaf9c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/com/unciv/UncivGame.kt
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci
}
}

private class GameStartScreen : BaseScreen() {
class GameStartScreen : BaseScreen() {
init {
val logoImage = ImageGetter.getExternalImage("banner.png")
logoImage.center(stage)
Expand Down
3 changes: 2 additions & 1 deletion core/src/com/unciv/ui/screens/basescreen/BaseScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextButton
import com.badlogic.gdx.scenes.scene2d.ui.TextField
import com.badlogic.gdx.scenes.scene2d.utils.Drawable
import com.badlogic.gdx.utils.viewport.ExtendViewport
import com.unciv.GameStartScreen
import com.unciv.UncivGame
import com.unciv.models.TutorialTrigger
import com.unciv.models.metadata.BaseRuleset
Expand Down Expand Up @@ -60,7 +61,7 @@ abstract class BaseScreen : Screen {
/** The ExtendViewport sets the _minimum_(!) world size - the actual world size will be larger, fitted to screen/window aspect ratio. */
stage = UncivStage(ExtendViewport(height, height))

if (enableSceneDebug && this !is CrashScreen) {
if (enableSceneDebug && this !is CrashScreen && this !is GameStartScreen) {
stage.setDebugUnderMouse(true)
stage.setDebugTableUnderMouse(true)
stage.setDebugParentUnderMouse(true)
Expand Down
8 changes: 4 additions & 4 deletions core/src/com/unciv/ui/screens/worldscreen/unit/UnitTable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class UnitTable(val worldScreen: WorldScreen) : Table() {
private val prevIdleUnitButton = IdleUnitButton(this,worldScreen.mapHolder,true)
private val nextIdleUnitButton = IdleUnitButton(this,worldScreen.mapHolder,false)
private val unitIconHolder = Table()
private val unitNameLabel = "".toLabel()
private val unitNameLabel = "".toLabel(fontSize = 24)
private val unitIconNameGroup = Table()
private val promotionsTable = Table()
private val promotionsTable = Table().apply { defaults().padRight(5f) }
private val unitDescriptionTable = Table(BaseScreen.skin)

val selectedUnit : MapUnit?
Expand Down Expand Up @@ -103,7 +103,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table() {
val moveBetweenUnitsTable = Table().apply {
add(prevIdleUnitButton)
unitIconNameGroup.add(unitIconHolder)
unitIconNameGroup.add(unitNameLabel).pad(5f)
unitIconNameGroup.add(unitNameLabel).apply { Fonts.font.descent }
unitIconHolder.touchable = Touchable.enabled
unitNameLabel.touchable = Touchable.enabled
add(unitIconNameGroup)
Expand Down Expand Up @@ -276,7 +276,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table() {
unitIconHolder.add(UnitIconGroup(selectedUnit!!, 30f)).pad(5f)

for (promotion in selectedUnit!!.promotions.getPromotions(true))
promotionsTable.add(ImageGetter.getPromotionPortrait(promotion.name)).padBottom(2f)
promotionsTable.add(ImageGetter.getPromotionPortrait(promotion.name, 20f)).padBottom(2f)

for (status in selectedUnit!!.statuses) {
val group = ImageGetter.getPromotionPortrait(status.name)
Expand Down

0 comments on commit dcaf9c4

Please sign in to comment.