UnitTable no longer scrolls when unnecessary

This commit is contained in:
Yair Morgenstern 2020-03-09 22:13:47 +02:00
parent 13def8739e
commit 30a2eda15f
4 changed files with 55 additions and 58 deletions

View File

@ -33,8 +33,8 @@ allprojects {
version = '1.0.1'
ext {
appName = "Unciv"
appCodeNumber = 391
appVersion = "3.6.6"
appCodeNumber = 392
appVersion = "3.6.6-resubmit"
gdxVersion = '1.9.10'
roboVMVersion = '2.3.1'

View File

@ -280,7 +280,6 @@ class NextTurnAutomation{
otherCiv.tradeRequests.add(tradeRequest)
}
}
}
fun getMinDistanceBetweenCities(civ1: CivilizationInfo, civ2: CivilizationInfo): Int {

View File

@ -127,8 +127,8 @@ class TradeEvaluation{
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(offer.name)
val threatToThem = Automation().threatAssessment(civInfo,civToDeclareWarOn)
if(civInfo.isAtWarWith(civToDeclareWarOn)){
when (threatToThem) {
if (!civInfo.isAtWarWith(civToDeclareWarOn)) return 0 // why should we pay you to go fight someone...?
else when (threatToThem) {
ThreatLevel.VeryLow -> return 0
ThreatLevel.Low -> return 0
ThreatLevel.Medium -> return 100
@ -136,8 +136,6 @@ class TradeEvaluation{
ThreatLevel.VeryHigh -> return 1000
}
}
else return 0 // why should we pay you to go fight someone...?
}
TradeType.City -> {
val city = tradePartner.cities.first { it.id==offer.name }
val stats = city.cityStats.currentCityStats

View File

@ -70,7 +70,7 @@ class EmpireOverviewScreen(private val viewingPlayer:CivilizationInfo) : CameraS
val setUnitsButton = TextButton("Units".tr(), skin)
setUnitsButton.onClick {
centerTable.clear()
centerTable.add(ScrollPane(getUnitTable())).height(stage.height * 0.8f)
centerTable.add(ScrollPane(getUnitTable()).apply { setOverscroll(false,false) }).height(stage.height * 0.8f)
centerTable.pack()
}
topTable.add(setUnitsButton)