mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 03:18:18 +07:00
Removed city center icon from Civ VI - it's not legally ours!
This commit is contained in:
parent
e599a2007e
commit
95fd51acc5
Binary file not shown.
Before Width: | Height: | Size: 10 KiB |
@ -16,10 +16,11 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo, tileSetStrin
|
|||||||
private var yieldGroup = YieldGroup()
|
private var yieldGroup = YieldGroup()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
isTransform=false // performance helper - nothing here is rotated or scaled
|
isTransform = false // performance helper - nothing here is rotated or scaled
|
||||||
addActor(yieldGroup)
|
addActor(yieldGroup)
|
||||||
if (city.location == tileInfo.position) {
|
if (city.location == tileInfo.position) {
|
||||||
icons.addPopulationIcon(ImageGetter.getImage("StatIcons/City_Center_(Civ6)"))
|
icons.addPopulationIcon(ImageGetter.getImage("OtherIcons/Star")
|
||||||
|
.apply { color = Color.GOLD })
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,13 +18,13 @@ import kotlin.concurrent.thread
|
|||||||
|
|
||||||
private data class UnitIconAndKey (val Icon: Actor, val key: Char = 0.toChar())
|
private data class UnitIconAndKey (val Icon: Actor, val key: Char = 0.toChar())
|
||||||
|
|
||||||
class UnitActionsTable(val worldScreen: WorldScreen) : Table(){
|
class UnitActionsTable(val worldScreen: WorldScreen) : Table() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
touchable = Touchable.enabled
|
touchable = Touchable.enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getIconAnKeyForUnitAction(unitAction:String): UnitIconAndKey {
|
private fun getIconAnKeyForUnitAction(unitAction: String): UnitIconAndKey {
|
||||||
when {
|
when {
|
||||||
unitAction.startsWith("Upgrade to") -> {
|
unitAction.startsWith("Upgrade to") -> {
|
||||||
// Regexplaination: start with a [, take as many non-] chars as you can, until you reach a ].
|
// Regexplaination: start with a [, take as many non-] chars as you can, until you reach a ].
|
||||||
@ -38,16 +38,16 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table(){
|
|||||||
val improvementName = Regex("""Create \[([^]]*)]""").find(unitAction)!!.groups[1]!!.value
|
val improvementName = Regex("""Create \[([^]]*)]""").find(unitAction)!!.groups[1]!!.value
|
||||||
return UnitIconAndKey(ImageGetter.getImprovementIcon(improvementName), 'i')
|
return UnitIconAndKey(ImageGetter.getImprovementIcon(improvementName), 'i')
|
||||||
}
|
}
|
||||||
unitAction.startsWith("Sleep") -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Sleep"),'f')
|
unitAction.startsWith("Sleep") -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Sleep"), 'f')
|
||||||
unitAction.startsWith("Fortify") -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Shield").apply { color= Color.BLACK },'f')
|
unitAction.startsWith("Fortify") -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Shield").apply { color = Color.BLACK }, 'f')
|
||||||
else -> when(unitAction){
|
else -> when (unitAction) {
|
||||||
"Move unit" -> return UnitIconAndKey(ImageGetter.getStatIcon("Movement"))
|
"Move unit" -> return UnitIconAndKey(ImageGetter.getStatIcon("Movement"))
|
||||||
"Stop movement"-> return UnitIconAndKey(ImageGetter.getStatIcon("Movement").apply { color= Color.RED }, '.')
|
"Stop movement" -> return UnitIconAndKey(ImageGetter.getStatIcon("Movement").apply { color = Color.RED }, '.')
|
||||||
"Promote" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Star").apply { color= Color.GOLD }, 'o')
|
"Promote" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Star").apply { color = Color.GOLD }, 'o')
|
||||||
"Construct improvement" -> return UnitIconAndKey(ImageGetter.getUnitIcon(Constants.worker),'i')
|
"Construct improvement" -> return UnitIconAndKey(ImageGetter.getUnitIcon(Constants.worker), 'i')
|
||||||
"Automate" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Great Engineer"), 'm')
|
"Automate" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Great Engineer"), 'm')
|
||||||
"Stop automation" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Stop"), 'm')
|
"Stop automation" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Stop"), 'm')
|
||||||
"Found city" -> return UnitIconAndKey(ImageGetter.getUnitIcon(Constants.settler),'f')
|
"Found city" -> return UnitIconAndKey(ImageGetter.getUnitIcon(Constants.settler), 'c')
|
||||||
"Hurry Research" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Great Scientist"), 'g')
|
"Hurry Research" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Great Scientist"), 'g')
|
||||||
"Start Golden Age" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Great Artist"), 'g')
|
"Start Golden Age" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Great Artist"), 'g')
|
||||||
"Hurry Wonder" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Great Engineer"), 'g')
|
"Hurry Wonder" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Great Engineer"), 'g')
|
||||||
@ -56,17 +56,17 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table(){
|
|||||||
"Disband unit" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/DisbandUnit"))
|
"Disband unit" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/DisbandUnit"))
|
||||||
"Explore" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Scout"), 'x')
|
"Explore" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Scout"), 'x')
|
||||||
"Stop exploration" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Stop"), 'x')
|
"Stop exploration" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Stop"), 'x')
|
||||||
"Pillage" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Pillage"),'p')
|
"Pillage" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Pillage"), 'p')
|
||||||
"Construct road" -> return UnitIconAndKey(ImageGetter.getImprovementIcon("Road"),'r')
|
"Construct road" -> return UnitIconAndKey(ImageGetter.getImprovementIcon("Road"), 'r')
|
||||||
else -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Star"))
|
else -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Star"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun update(unit: MapUnit?){
|
fun update(unit: MapUnit?) {
|
||||||
clear()
|
clear()
|
||||||
if (unit == null) return
|
if (unit == null) return
|
||||||
if(!worldScreen.isPlayersTurn) return // No actions when it's not your turn!
|
if (!worldScreen.isPlayersTurn) return // No actions when it's not your turn!
|
||||||
for (button in UnitActions.getUnitActions(unit, worldScreen).map { getUnitActionButton(it) })
|
for (button in UnitActions.getUnitActions(unit, worldScreen).map { getUnitActionButton(it) })
|
||||||
add(button).left().padBottom(2f).row()
|
add(button).left().padBottom(2f).row()
|
||||||
pack()
|
pack()
|
||||||
@ -77,7 +77,7 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table(){
|
|||||||
val iconAndKey = getIconAnKeyForUnitAction(unitAction.title)
|
val iconAndKey = getIconAnKeyForUnitAction(unitAction.title)
|
||||||
val actionButton = Button(CameraStageBaseScreen.skin)
|
val actionButton = Button(CameraStageBaseScreen.skin)
|
||||||
actionButton.add(iconAndKey.Icon).size(20f).pad(5f)
|
actionButton.add(iconAndKey.Icon).size(20f).pad(5f)
|
||||||
val fontColor = if(unitAction.isCurrentAction) Color.YELLOW else Color.WHITE
|
val fontColor = if (unitAction.isCurrentAction) Color.YELLOW else Color.WHITE
|
||||||
actionButton.add(unitAction.title.toLabel(fontColor)).pad(5f)
|
actionButton.add(unitAction.title.toLabel(fontColor)).pad(5f)
|
||||||
if (iconAndKey.key != 0.toChar()) {
|
if (iconAndKey.key != 0.toChar()) {
|
||||||
val keyLabel = "(${iconAndKey.key.toUpperCase()})".toLabel(Color.WHITE)
|
val keyLabel = "(${iconAndKey.key.toUpperCase()})".toLabel(Color.WHITE)
|
||||||
@ -90,10 +90,10 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table(){
|
|||||||
}
|
}
|
||||||
if (unitAction.action == null) actionButton.disable()
|
if (unitAction.action == null) actionButton.disable()
|
||||||
else {
|
else {
|
||||||
actionButton.onClick(unitAction.uncivSound,action)
|
actionButton.onClick(unitAction.uncivSound, action)
|
||||||
if (iconAndKey.key != 0.toChar())
|
if (iconAndKey.key != 0.toChar())
|
||||||
worldScreen.keyPressDispatcher[iconAndKey.key] = {
|
worldScreen.keyPressDispatcher[iconAndKey.key] = {
|
||||||
thread(name="Sound") { Sounds.play(unitAction.uncivSound) }
|
thread(name = "Sound") { Sounds.play(unitAction.uncivSound) }
|
||||||
action()
|
action()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user