mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07:00
ImprovementPicker screen displays tile owner civ and city (#9942)
* Added owner civ and city to the ImprovementPicker screen with translation * Switched tileOwnerText from var to val * Changed unowned tile message and city name link to city screen
This commit is contained in:
parent
ff806b5f3c
commit
1ef883ecdd
@ -1170,6 +1170,9 @@ No space available to place [unit] near [city] =
|
||||
Maintenance cost =
|
||||
Pick construction =
|
||||
Pick improvement =
|
||||
Tile owned by [civName] - [cityName] =
|
||||
Tile owned by [civName] (You) =
|
||||
Unowned tile =
|
||||
Provides [resource] =
|
||||
Provides [amount] [resource] =
|
||||
Replaces [improvement] =
|
||||
|
@ -16,10 +16,12 @@ import com.unciv.ui.components.Fonts
|
||||
import com.unciv.ui.components.UncivTooltip.Companion.addTooltip
|
||||
import com.unciv.ui.components.extensions.disable
|
||||
import com.unciv.ui.components.extensions.toLabel
|
||||
import com.unciv.ui.components.extensions.toTextButton
|
||||
import com.unciv.ui.components.input.keyShortcuts
|
||||
import com.unciv.ui.components.input.onClick
|
||||
import com.unciv.ui.components.input.onDoubleClick
|
||||
import com.unciv.ui.images.ImageGetter
|
||||
import com.unciv.ui.screens.cityscreen.CityScreen
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class ImprovementPickerScreen(
|
||||
@ -203,6 +205,22 @@ class ImprovementPickerScreen(
|
||||
regularImprovements.row()
|
||||
}
|
||||
|
||||
var ownerTable = Table()
|
||||
if (tile.getOwner() == null) {
|
||||
ownerTable.add("Unowned tile".tr().toLabel())
|
||||
} else if (tile.getOwner()!!.isCurrentPlayer()) {
|
||||
val button = tile.getCity()!!.name.toTextButton(hideIcons = true)
|
||||
button.onClick {
|
||||
this.game.pushScreen(CityScreen(tile.getCity()!!,null,tile))
|
||||
}
|
||||
ownerTable.add("Tile owned by [${tile.getOwner()!!.civName}] (You)".tr().toLabel()).padLeft(10f)
|
||||
ownerTable.add(button).padLeft(20f)
|
||||
} else {
|
||||
ownerTable.add("Tile owned by [${tile.getOwner()!!.civName}] - [${tile.getCity()!!.name}]".tr().toLabel()).padLeft(10f)
|
||||
}
|
||||
|
||||
topTable.add(ownerTable)
|
||||
topTable.row()
|
||||
topTable.add(regularImprovements)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user