mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 15:30:43 -04:00
Added info of tile's unit defence bonus to tile info (not everyone is a veteren Civ player...)
This commit is contained in:
parent
f7021154f3
commit
cc0e76ba00
@ -1046,6 +1046,8 @@
|
|||||||
Spanish:"Ataque"
|
Spanish:"Ataque"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"[percentage] to unit defence":{} // e.g. +25% to unit defence
|
||||||
|
|
||||||
// Terrains
|
// Terrains
|
||||||
|
|
||||||
"Grassland":{
|
"Grassland":{
|
||||||
|
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.game"
|
applicationId "com.unciv.game"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 150
|
versionCode 151
|
||||||
versionName "2.9.3"
|
versionName "2.9.5"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
@ -218,6 +218,12 @@ open class TileInfo {
|
|||||||
if(militaryUnit!!.health<100) milUnitString += "(" + militaryUnit!!.health + ")"
|
if(militaryUnit!!.health<100) milUnitString += "(" + militaryUnit!!.health + ")"
|
||||||
SB.appendln(milUnitString)
|
SB.appendln(milUnitString)
|
||||||
}
|
}
|
||||||
|
if(getDefensiveBonus()!=0f){
|
||||||
|
var defencePercentString = (getDefensiveBonus()*100).toInt().toString()+"%"
|
||||||
|
if(!defencePercentString.startsWith("-")) defencePercentString = "+$defencePercentString"
|
||||||
|
SB.appendln("[$defencePercentString] to unit defence".tr())
|
||||||
|
}
|
||||||
|
|
||||||
return SB.toString().trim()
|
return SB.toString().trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,21 +156,19 @@ fun String.tr(): String {
|
|||||||
val fontCache = HashMap<Int,BitmapFont>()
|
val fontCache = HashMap<Int,BitmapFont>()
|
||||||
fun getFont(size: Int): BitmapFont {
|
fun getFont(size: Int): BitmapFont {
|
||||||
if(fontCache.containsKey(size)) return fontCache[size]!!
|
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
|
|
||||||
|
|
||||||
val generator = FreeTypeFontGenerator(Gdx.files.internal("skin/Arial.ttf"))
|
val generator = FreeTypeFontGenerator(Gdx.files.internal("skin/Arial.ttf"))
|
||||||
val parameter = FreeTypeFontGenerator.FreeTypeFontParameter()
|
val parameter = FreeTypeFontGenerator.FreeTypeFontParameter()
|
||||||
parameter.size = size
|
parameter.size = size
|
||||||
// parameter.genMipMaps = true
|
|
||||||
parameter.minFilter = Texture.TextureFilter.Linear
|
parameter.minFilter = Texture.TextureFilter.Linear
|
||||||
parameter.magFilter = Texture.TextureFilter.Linear
|
parameter.magFilter = Texture.TextureFilter.Linear
|
||||||
parameter.characters = "ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽaäàâăbcčćdđeéfghiîjklmnoöpqrsșštțuüvwxyzžАБВГҐДЂЕЁЄЖЗЅИІЇЙЈКЛЉМНЊОПРСТЋУЎФХЦЧЏШЩЪЫЬЭЮЯабвгґдђеёєжзѕиіїйјклљмнњопрстћуўфхцчџшщъыьэюяΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρστυφχψωάΆέΈέΉίϊΐΊόΌύΰϋΎΫΏĂÂÊÔƠƯăâêôơưáéíóú1234567890‘?’'“!”(%)[#]{@}/&\\<-+÷×=>®©\$€£¥¢:;,.*|"
|
|
||||||
//generator.scaleForPixelHeight(size)
|
|
||||||
|
|
||||||
|
parameter.characters = "ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽaäàâăbcčćdđeéfghiîjklmnoöpqrsșštțuüvwxyzž" +
|
||||||
|
"АБВГҐДЂЕЁЄЖЗЅИІЇЙЈКЛЉМНЊОПРСТЋУЎФХЦЧЏШЩЪЫЬЭЮЯабвгґдђеёєжзѕиіїйјклљмнњопрстћуўфхцчџшщъыьэюя" +
|
||||||
|
"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρστυφχψωάΆέΈέΉίϊΐΊόΌύΰϋΎΫΏĂÂÊÔƠƯăâêôơưáéíóú1234567890" +
|
||||||
|
"‘?’'“!”(%)[#]{@}/&\\<-+÷×=>®©\$€£¥¢:;,.*|"
|
||||||
|
|
||||||
val font = generator.generateFont(parameter)
|
val font = generator.generateFont(parameter)
|
||||||
// font.data.setScale(1f/screenScale)
|
|
||||||
generator.dispose() // don't forget to dispose to avoid memory leaks!
|
generator.dispose() // don't forget to dispose to avoid memory leaks!
|
||||||
fontCache[size]=font
|
fontCache[size]=font
|
||||||
return font
|
return font
|
||||||
|
Loading…
x
Reference in New Issue
Block a user