Civilopedia page now looks normal

This commit is contained in:
Yair Morgenstern 2018-06-14 20:49:36 +03:00
parent d2cb7173c1
commit 2df88c8517
3 changed files with 10 additions and 5 deletions

View File

@ -46,7 +46,6 @@ class PopulationManager {
// starvation!
{
population--
unassignExtraPopulation()
foodStored = 0
cityInfo.civInfo.addNotification(cityInfo.name + " is starving!", cityInfo.location, Color.RED)
}

View File

@ -117,9 +117,15 @@ class MapUnit {
doPreTurnAction()
}
fun hasUnique(unique:String): Boolean {
fun getUniques(): MutableList<String> {
val uniques = mutableListOf<String>()
val baseUnit = getBaseUnit()
return baseUnit.uniques!=null && baseUnit.uniques!!.contains(unique)
if(baseUnit.uniques!=null) uniques.addAll(baseUnit.uniques!!)
return uniques
}
fun hasUnique(unique:String): Boolean {
return getUniques().contains(unique)
}
fun movementAlgs() = UnitMovementAlgorithms(this)
@ -130,6 +136,7 @@ class MapUnit {
fun getViewableTiles(): MutableList<TileInfo> {
var visibilityRange = 2
visibilityRange += getUniques().count{it=="+1 Visibility Range"}
if(hasUnique("Limited Visibility")) visibilityRange-=1
return getTile().getViewableTiles(visibilityRange)
}

View File

@ -50,7 +50,6 @@ class CivilopediaScreen : CameraStageBaseScreen() {
nameList.style = List.ListStyle(nameList.style)
nameList.style.fontColorSelected = Color.BLACK
nameList.style.font.data.setScale(1.5f)
val buttons = ArrayList<Button>()
var first = true
@ -74,7 +73,7 @@ class CivilopediaScreen : CameraStageBaseScreen() {
first = false
buttonClicked()
}
button.label.setFontScale(0.7f)
buttonTable.add(button).width(button.width * 0.7f)
}