diff --git a/android/build.gradle b/android/build.gradle index ec45b61696..58237f7285 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.game" minSdkVersion 14 targetSdkVersion 26 - versionCode 80 - versionName "2.4.10" + versionCode 81 + versionName "2.4.11" } buildTypes { release { diff --git a/core/src/com/unciv/logic/city/CityConstructions.kt b/core/src/com/unciv/logic/city/CityConstructions.kt index 4358f265a3..1fb9671c86 100644 --- a/core/src/com/unciv/logic/city/CityConstructions.kt +++ b/core/src/com/unciv/logic/city/CityConstructions.kt @@ -51,7 +51,7 @@ class CityConstructions { fun getProductionForTileInfo(): String { var result = currentConstruction if (result != "Science" && result != "Gold") - result += "\r\nin " + turnsToConstruction(currentConstruction) + " turns,\r\n" + result += "\r\nin " + turnsToConstruction(currentConstruction) + " turns" return result } diff --git a/core/src/com/unciv/ui/utils/CameraStageBaseScreen.kt b/core/src/com/unciv/ui/utils/CameraStageBaseScreen.kt index e85b9de2c5..0a25701597 100644 --- a/core/src/com/unciv/ui/utils/CameraStageBaseScreen.kt +++ b/core/src/com/unciv/ui/utils/CameraStageBaseScreen.kt @@ -126,7 +126,11 @@ fun Actor.center(parent:Stage){ centerX(parent); centerY(parent)} fun Label.setFontColor(color:Color): Label {style=Label.LabelStyle(style).apply { fontColor=color }; return this} fun String.tr(): String {return GameBasics.Translations.get(this,UnCivGame.Current.settings.language)} + + +val fontCache = HashMap() fun getFont(size: Int): BitmapFont { + if(fontCache.containsKey(size)) return fontCache[size]!! // var screenScale = Gdx.graphics.width / 1000f // screen virtual width as defined in CameraStageBaseScreen // if(screenScale<1) screenScale=1f @@ -140,9 +144,10 @@ fun getFont(size: Int): BitmapFont { //generator.scaleForPixelHeight(size) - val font = generator.generateFont(parameter) // font size 12 pixels + val font = generator.generateFont(parameter) // font.data.setScale(1f/screenScale) generator.dispose() // don't forget to dispose to avoid memory leaks! + fontCache[size]=font return font }