Removed city center icon from Civ VI - it's not legally ours!

This commit is contained in:
Yair Morgenstern 2020-04-19 17:17:57 +03:00
parent e599a2007e
commit 95fd51acc5
3 changed files with 20 additions and 19 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@ -16,10 +16,11 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo, tileSetStrin
private var yieldGroup = YieldGroup()
init {
isTransform=false // performance helper - nothing here is rotated or scaled
isTransform = false // performance helper - nothing here is rotated or scaled
addActor(yieldGroup)
if (city.location == tileInfo.position) {
icons.addPopulationIcon(ImageGetter.getImage("StatIcons/City_Center_(Civ6)"))
icons.addPopulationIcon(ImageGetter.getImage("OtherIcons/Star")
.apply { color = Color.GOLD })
}
}

View File

@ -18,13 +18,13 @@ import kotlin.concurrent.thread
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 {
touchable = Touchable.enabled
}
private fun getIconAnKeyForUnitAction(unitAction:String): UnitIconAndKey {
private fun getIconAnKeyForUnitAction(unitAction: String): UnitIconAndKey {
when {
unitAction.startsWith("Upgrade to") -> {
// 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
return UnitIconAndKey(ImageGetter.getImprovementIcon(improvementName), 'i')
}
unitAction.startsWith("Sleep") -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Sleep"),'f')
unitAction.startsWith("Fortify") -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Shield").apply { color= Color.BLACK },'f')
else -> when(unitAction){
unitAction.startsWith("Sleep") -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Sleep"), 'f')
unitAction.startsWith("Fortify") -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Shield").apply { color = Color.BLACK }, 'f')
else -> when (unitAction) {
"Move unit" -> return UnitIconAndKey(ImageGetter.getStatIcon("Movement"))
"Stop movement"-> return UnitIconAndKey(ImageGetter.getStatIcon("Movement").apply { color= Color.RED }, '.')
"Promote" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Star").apply { color= Color.GOLD }, 'o')
"Construct improvement" -> return UnitIconAndKey(ImageGetter.getUnitIcon(Constants.worker),'i')
"Stop movement" -> return UnitIconAndKey(ImageGetter.getStatIcon("Movement").apply { color = Color.RED }, '.')
"Promote" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Star").apply { color = Color.GOLD }, 'o')
"Construct improvement" -> return UnitIconAndKey(ImageGetter.getUnitIcon(Constants.worker), 'i')
"Automate" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Great Engineer"), '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')
"Start Golden Age" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Great Artist"), '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"))
"Explore" -> return UnitIconAndKey(ImageGetter.getUnitIcon("Scout"), 'x')
"Stop exploration" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Stop"), 'x')
"Pillage" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Pillage"),'p')
"Construct road" -> return UnitIconAndKey(ImageGetter.getImprovementIcon("Road"),'r')
"Pillage" -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Pillage"), 'p')
"Construct road" -> return UnitIconAndKey(ImageGetter.getImprovementIcon("Road"), 'r')
else -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Star"))
}
}
}
fun update(unit: MapUnit?){
fun update(unit: MapUnit?) {
clear()
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) })
add(button).left().padBottom(2f).row()
pack()
@ -77,7 +77,7 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table(){
val iconAndKey = getIconAnKeyForUnitAction(unitAction.title)
val actionButton = Button(CameraStageBaseScreen.skin)
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)
if (iconAndKey.key != 0.toChar()) {
val keyLabel = "(${iconAndKey.key.toUpperCase()})".toLabel(Color.WHITE)
@ -90,10 +90,10 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table(){
}
if (unitAction.action == null) actionButton.disable()
else {
actionButton.onClick(unitAction.uncivSound,action)
actionButton.onClick(unitAction.uncivSound, action)
if (iconAndKey.key != 0.toChar())
worldScreen.keyPressDispatcher[iconAndKey.key] = {
thread(name="Sound") { Sounds.play(unitAction.uncivSound) }
thread(name = "Sound") { Sounds.play(unitAction.uncivSound) }
action()
}
}