More minor emoji changes

They do make the whole setup seem much more professional
This commit is contained in:
Yair Morgenstern 2020-08-24 23:17:34 +03:00
parent bed7fe4c64
commit a6b89b9885
8 changed files with 257 additions and 259 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 KiB

After

Width:  |  Height:  |  Size: 485 KiB

View file

@ -41,14 +41,14 @@ class BaseUnit : INamed, IConstruction {
fun getShortDescription(): String {
val infoList= mutableListOf<String>()
for(unique in uniques)
infoList+= Translations.translateBonusOrPenalty(unique)
for(promotion in promotions)
val infoList = mutableListOf<String>()
if (strength != 0) infoList += "$strength${Fonts.strength}"
if (rangedStrength != 0) infoList += "$rangedStrength${Fonts.rangedStrength}"
if (movement != 2) infoList += "$movement${Fonts.movement}"
for (promotion in promotions)
infoList += promotion.tr()
if(strength!=0) infoList += "$strength${Fonts.strength}"
if(rangedStrength!=0) infoList += "$rangedStrength${Fonts.rangedStrength}"
if(movement!=2) infoList+="$movement${Fonts.movement}"
for (unique in uniques)
infoList += Translations.translateBonusOrPenalty(unique)
return infoList.joinToString()
}

View file

@ -123,10 +123,10 @@ open class Stats() {
}
}
class StatMap:LinkedHashMap<String,Stats>(){
fun add(source:String,stats:Stats){
if(!containsKey(source)) put(source,stats)
else put(source, get(source)!!+stats)
class StatMap:LinkedHashMap<String,Stats>() {
fun add(source: String, stats: Stats) {
if (!containsKey(source)) put(source, stats)
else put(source, get(source)!! + stats)
// This CAN'T be get(source)!!.add() because the initial stats we get are sometimes from other places -
// for instance the Cities is from the currentCityStats and if we add to that we change the value in the cities themselves!
}

View file

@ -57,15 +57,7 @@ class NativeBitmapFontData(val fontImplementation: NativeFontImplementation) : B
var glyph: Glyph? = super.getGlyph(ch)
if (glyph == null) {
if(ch == '\uD83D' || ch == '\uD83C' ) return Glyph() // This is the 'first character' of an emoji - empty space
val charPixmap =
when (ch) {
Fonts.strength[1] -> Fonts.extractPixmapFromTextureRegion(ImageGetter.getDrawable("StatIcons/Strength").region)
Fonts.rangedStrength[1] -> Fonts.extractPixmapFromTextureRegion(ImageGetter.getDrawable("StatIcons/RangedStrength").region)
Fonts.range[1] -> Fonts.extractPixmapFromTextureRegion(ImageGetter.getDrawable("StatIcons/Range").region)
Fonts.movement -> Fonts.extractPixmapFromTextureRegion(ImageGetter.getDrawable("StatIcons/Movement").region)
Fonts.turn -> Fonts.extractPixmapFromTextureRegion(ImageGetter.getDrawable("EmojiIcons/Turn").region)
else -> fontImplementation.getCharPixmap(ch)
}
val charPixmap = getPixmapFromChar(ch)
glyph = Glyph()
glyph.id = ch.toInt()
@ -90,6 +82,17 @@ class NativeBitmapFontData(val fontImplementation: NativeFontImplementation) : B
return glyph
}
private fun getPixmapFromChar(ch: Char): Pixmap {
return when (ch) {
Fonts.strength[1] -> Fonts.extractPixmapFromTextureRegion(ImageGetter.getDrawable("StatIcons/Strength").region)
Fonts.rangedStrength[1] -> Fonts.extractPixmapFromTextureRegion(ImageGetter.getDrawable("StatIcons/RangedStrength").region)
Fonts.range[1] -> Fonts.extractPixmapFromTextureRegion(ImageGetter.getDrawable("StatIcons/Range").region)
Fonts.movement -> Fonts.extractPixmapFromTextureRegion(ImageGetter.getDrawable("StatIcons/Movement").region)
Fonts.turn -> Fonts.extractPixmapFromTextureRegion(ImageGetter.getDrawable("EmojiIcons/Turn").region)
else -> fontImplementation.getCharPixmap(ch)
}
}
override fun getGlyphs(run: GlyphLayout.GlyphRun, str: CharSequence, start: Int, end: Int, lastGlyph: Glyph?) {
packer.packToTexture = true // All glyphs added after this are packed directly to the texture.
super.getGlyphs(run, str, start, end, lastGlyph)
@ -142,4 +145,6 @@ object Fonts {
const val rangedStrength = "\uD83C\uDFF9"
const val movement = '➡'
const val range = "\uD83D\uDCCF"
// const val production = '⚙'
}

View file

@ -618,7 +618,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
}
else ->
NextTurnAction("Next turn", Color.WHITE) {
NextTurnAction("${Fonts.turn} {Next turn}", Color.WHITE) {
game.settings.addCompletedTutorialTask("Pass a turn")
nextTurn()
}