mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 12:48:56 +07:00
Fixed Embarkation tutorial
This commit is contained in:
@ -301,10 +301,9 @@
|
|||||||
|
|
||||||
CanEmbark:[
|
CanEmbark:[
|
||||||
[
|
[
|
||||||
"Your land units can now embark!",
|
"Your land units can now embark, allowing them to traverse water tiles!",
|
||||||
"Siege units are extremely powerful against cities, but need to be Set Up before they can attack.",
|
"Entering or leaving water takes the entire turn.",
|
||||||
"Once your siege unit is set up, it can attack from the current tile,",
|
"Units are defenseless while embarked, so be careful!"
|
||||||
" but once moved to another tile, it will need to be set up again."
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.game"
|
applicationId "com.unciv.game"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 161
|
versionCode 163
|
||||||
versionName "2.10.2"
|
versionName "2.10.3"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
@ -82,7 +82,7 @@ class BuildingsTable(private val cityScreen: CityScreen) : Table() {
|
|||||||
add(specialistBuildingsExpander).row()
|
add(specialistBuildingsExpander).row()
|
||||||
|
|
||||||
// specialist allocation
|
// specialist allocation
|
||||||
addSpecialistAllocation(skin, specialistBuildings, cityInfo)
|
addSpecialistAllocation(skin, cityInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!others.isEmpty()) {
|
if (!others.isEmpty()) {
|
||||||
@ -96,7 +96,7 @@ class BuildingsTable(private val cityScreen: CityScreen) : Table() {
|
|||||||
pack()
|
pack()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addSpecialistAllocation(skin: Skin, specialistBuildings: MutableList<Building>, cityInfo: CityInfo) {
|
private fun addSpecialistAllocation(skin: Skin, cityInfo: CityInfo) {
|
||||||
val specialistAllocationExpander = ExpanderTab("Specialist allocation", skin)
|
val specialistAllocationExpander = ExpanderTab("Specialist allocation", skin)
|
||||||
specialistAllocationExpander.innerTable.defaults().pad(5f)
|
specialistAllocationExpander.innerTable.defaults().pad(5f)
|
||||||
|
|
||||||
@ -104,17 +104,17 @@ class BuildingsTable(private val cityScreen: CityScreen) : Table() {
|
|||||||
val currentSpecialists = cityInfo.population.specialists.toHashMap()
|
val currentSpecialists = cityInfo.population.specialists.toHashMap()
|
||||||
val maximumSpecialists = cityInfo.population.getMaxSpecialists()
|
val maximumSpecialists = cityInfo.population.getMaxSpecialists()
|
||||||
|
|
||||||
for (entry in maximumSpecialists.toHashMap()) {
|
for (statToMaximumSpecialist in maximumSpecialists.toHashMap()) {
|
||||||
if (entry.value == 0f) continue
|
if (statToMaximumSpecialist.value == 0f) continue
|
||||||
val stat = entry.key
|
val stat = statToMaximumSpecialist.key
|
||||||
// these two are conflictingly named compared to above...
|
// these two are conflictingly named compared to above...
|
||||||
val assignedSpecialists = currentSpecialists[entry.key]!!.toInt()
|
val assignedSpecialists = currentSpecialists[statToMaximumSpecialist.key]!!.toInt()
|
||||||
val maxSpecialists = entry.value.toInt()
|
val maxSpecialists = statToMaximumSpecialist.value.toInt()
|
||||||
if (assignedSpecialists > 0) {
|
if (assignedSpecialists > 0) {
|
||||||
val unassignButton = TextButton("-", skin)
|
val unassignButton = TextButton("-", skin)
|
||||||
unassignButton.label.setFontSize(24)
|
unassignButton.label.setFontSize(24)
|
||||||
unassignButton.onClick {
|
unassignButton.onClick {
|
||||||
cityInfo.population.specialists.add(entry.key, -1f)
|
cityInfo.population.specialists.add(statToMaximumSpecialist.key, -1f)
|
||||||
cityInfo.cityStats.update()
|
cityInfo.cityStats.update()
|
||||||
cityScreen.update()
|
cityScreen.update()
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ class BuildingsTable(private val cityScreen: CityScreen) : Table() {
|
|||||||
val assignButton = TextButton("+", skin)
|
val assignButton = TextButton("+", skin)
|
||||||
assignButton.label.setFontSize(24)
|
assignButton.label.setFontSize(24)
|
||||||
assignButton.onClick {
|
assignButton.onClick {
|
||||||
cityInfo.population.specialists.add(entry.key, +1f)
|
cityInfo.population.specialists.add(statToMaximumSpecialist.key, +1f)
|
||||||
cityInfo.cityStats.update()
|
cityInfo.cityStats.update()
|
||||||
cityScreen.update()
|
cityScreen.update()
|
||||||
}
|
}
|
||||||
|
@ -119,8 +119,8 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||||||
updateCityImage()
|
updateCityImage()
|
||||||
updateTileColor(isViewable)
|
updateTileColor(isViewable)
|
||||||
|
|
||||||
updateResourceImage(isViewable,showResourcesAndImprovements)
|
updateResourceImage(showResourcesAndImprovements)
|
||||||
updateImprovementImage(isViewable,showResourcesAndImprovements)
|
updateImprovementImage(showResourcesAndImprovements)
|
||||||
|
|
||||||
|
|
||||||
civilianUnitImage = newUnitImage(tileInfo.civilianUnit, civilianUnitImage, isViewable, -20f)
|
civilianUnitImage = newUnitImage(tileInfo.civilianUnit, civilianUnitImage, isViewable, -20f)
|
||||||
@ -272,7 +272,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateImprovementImage(viewable: Boolean, showResourcesAndImprovements: Boolean) {
|
private fun updateImprovementImage(showResourcesAndImprovements: Boolean) {
|
||||||
if (improvementImage != null) {
|
if (improvementImage != null) {
|
||||||
improvementImage!!.remove()
|
improvementImage!!.remove()
|
||||||
improvementImage = null
|
improvementImage = null
|
||||||
@ -293,7 +293,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateResourceImage(viewable: Boolean, showResourcesAndImprovements: Boolean) {
|
private fun updateResourceImage(showResourcesAndImprovements: Boolean) {
|
||||||
val shouldDisplayResource = showResourcesAndImprovements
|
val shouldDisplayResource = showResourcesAndImprovements
|
||||||
&& tileInfo.hasViewableResource(tileInfo.tileMap.gameInfo.getPlayerCivilization())
|
&& tileInfo.hasViewableResource(tileInfo.tileMap.gameInfo.getPlayerCivilization())
|
||||||
|
|
||||||
@ -365,9 +365,9 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||||||
|
|
||||||
fun showCircle(color: Color) {
|
fun showCircle(color: Color) {
|
||||||
circleImage.isVisible = true
|
circleImage.isVisible = true
|
||||||
val color = color.cpy()
|
val colorCopy = color.cpy()
|
||||||
color.a = 0.3f
|
colorCopy.a = 0.3f
|
||||||
circleImage.color = color
|
circleImage.color = colorCopy
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideCircle() {
|
fun hideCircle() {
|
||||||
|
Reference in New Issue
Block a user