mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 15:29:32 +07:00
4.5.0-patch2
Lazy loading of system fonts so startup is fast
This commit is contained in:
@ -20,13 +20,14 @@ import kotlin.math.abs
|
||||
|
||||
class FontAndroid : FontImplementation {
|
||||
|
||||
private val fontList: HashSet<Font> = hashSetOf()
|
||||
private val fontList by lazy {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) emptySet()
|
||||
else SystemFonts.getAvailableFonts()
|
||||
}
|
||||
private val paint: Paint = Paint()
|
||||
private var currentFontFamily: String? = null
|
||||
|
||||
init {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||
fontList.addAll(SystemFonts.getAvailableFonts())
|
||||
paint.isAntiAlias = true
|
||||
paint.strokeWidth = 0f
|
||||
paint.setARGB(255, 255, 255, 255)
|
||||
@ -49,7 +50,6 @@ class FontAndroid : FontImplementation {
|
||||
else
|
||||
{
|
||||
paint.typeface = createTypefaceSystem(fontFamilyData.invariantName)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,8 +3,8 @@ package com.unciv.build
|
||||
object BuildConfig {
|
||||
const val kotlinVersion = "1.8.0"
|
||||
const val appName = "Unciv"
|
||||
const val appCodeNumber = 820
|
||||
const val appVersion = "4.5.0-patch1"
|
||||
const val appCodeNumber = 821
|
||||
const val appVersion = "4.5.0-patch2"
|
||||
|
||||
const val gdxVersion = "1.11.0"
|
||||
const val roboVMVersion = "2.3.1"
|
||||
|
@ -21,11 +21,11 @@ import com.unciv.models.stats.Stat
|
||||
import com.unciv.models.stats.Stats
|
||||
import com.unciv.models.translations.fillPlaceholders
|
||||
import com.unciv.models.translations.tr
|
||||
import com.unciv.ui.screens.civilopediascreen.FormattedLine
|
||||
import com.unciv.ui.components.Fonts
|
||||
import com.unciv.ui.components.extensions.getConsumesAmountString
|
||||
import com.unciv.ui.components.extensions.getNeedMoreAmountString
|
||||
import com.unciv.ui.components.extensions.toPercent
|
||||
import com.unciv.ui.screens.civilopediascreen.FormattedLine
|
||||
import kotlin.math.pow
|
||||
|
||||
|
||||
@ -382,7 +382,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
||||
&& matchesFilter(it.params[0])
|
||||
&& city.matchesFilter(it.params[3])
|
||||
}
|
||||
|| return super.canBePurchasedWithStat(city, stat)
|
||||
|| super.canBePurchasedWithStat(city, stat)
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user