Unit table now displays ranged strength for ranged units

This commit is contained in:
Yair Morgenstern 2018-04-09 19:09:08 +03:00
parent 2bac292ce6
commit 32efae340b
2 changed files with 12 additions and 12 deletions

View file

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.game"
minSdkVersion 14
targetSdkVersion 26
versionCode 37
versionName "1.4.4"
versionCode 38
versionName "1.4.5"
}
buildTypes {
release {

View file

@ -40,17 +40,17 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
if(selectedUnit!=null) {
val unit = selectedUnit!!
if (unit.getBaseUnit().unitType == UnitType.Civilian) {
unitLabel.setText(unit.name
+ "\r\nMovement: " + unit.getMovementString()
)
} else {
unitLabel.setText(unit.name
+ "\r\nMovement: " + unit.getMovementString()
+ "\r\nHealth: " + unit.health
+ "\r\nStrength: " + unit.getBaseUnit().strength
)
var unitLabelText = unit.name +
"\r\nMovement: " + unit.getMovementString()
if (unit.getBaseUnit().unitType != UnitType.Civilian) {
unitLabelText += "\r\nHealth: " + unit.health +
"\r\nStrength: " + unit.getBaseUnit().strength
}
if (unit.getBaseUnit().unitType == UnitType.Ranged)
unitLabelText += "\r\nRanged strength: "+unit.getBaseUnit().rangedStrength
unitLabel.setText(unitLabelText)
for (button in UnitActions().getUnitActions(selectedUnit!!, worldScreen))
unitActionsTable.add(button).colspan(2).pad(5f)
.size(button.width * worldScreen.buttonScale, button.height * worldScreen.buttonScale).row()