From 8ec63f2e94096efbe6c539479982751940e9131a Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sat, 1 Dec 2018 22:22:30 +0200 Subject: [PATCH] Re-added language picker, hope it won't generate negative reviews again =\ --- core/src/com/unciv/UnCivGame.kt | 4 +++- core/src/com/unciv/ui/LanguagePickerScreen.kt | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/com/unciv/UnCivGame.kt b/core/src/com/unciv/UnCivGame.kt index 3b353427ab..59ef15b283 100644 --- a/core/src/com/unciv/UnCivGame.kt +++ b/core/src/com/unciv/UnCivGame.kt @@ -5,6 +5,7 @@ import com.badlogic.gdx.Gdx import com.unciv.logic.GameInfo import com.unciv.logic.GameSaver import com.unciv.models.gamebasics.GameBasics +import com.unciv.ui.LanguagePickerScreen import com.unciv.ui.NewGameScreen import com.unciv.ui.utils.ImageGetter import com.unciv.ui.worldscreen.WorldScreen @@ -33,7 +34,8 @@ class UnCivGame : Game() { startNewGame() } } - else startNewGame() // screen=LanguagePickerScreen() disabled because of people's negative reviews =( + //startNewGame() // + else screen= LanguagePickerScreen() // disabled because of people's negative reviews =( } fun loadGame(gameInfo:GameInfo){ diff --git a/core/src/com/unciv/ui/LanguagePickerScreen.kt b/core/src/com/unciv/ui/LanguagePickerScreen.kt index 4a79429049..efe51b0700 100644 --- a/core/src/com/unciv/ui/LanguagePickerScreen.kt +++ b/core/src/com/unciv/ui/LanguagePickerScreen.kt @@ -9,8 +9,8 @@ import com.unciv.UnCivGame import com.unciv.models.gamebasics.GameBasics import com.unciv.ui.pickerscreens.PickerScreen import com.unciv.ui.utils.ImageGetter -import com.unciv.ui.utils.onClick import com.unciv.ui.utils.enable +import com.unciv.ui.utils.onClick import com.unciv.ui.utils.tr @@ -22,11 +22,12 @@ class LanguageTable(val language:String,skin: Skin):Table(skin){ init{ pad(10f) defaults().pad(10f) - add(ImageGetter.getImage("FlagIcons/$language.png")).size(40f) + if(ImageGetter.imageExists("FlagIcons/$language")) + add(ImageGetter.getImage("FlagIcons/$language")).size(40f) val availableTranslations = GameBasics.Translations.filter { it.value.containsKey(language) } if(language=="English") percentComplete = 100 - else percentComplete = (availableTranslations.size*100 / GameBasics.Translations.size) - 10 + else percentComplete = (availableTranslations.size*100 / GameBasics.Translations.size) - 5 add("$language ($percentComplete%)") update("") touchable = Touchable.enabled // so click listener is activated when any part is clicked, not only children @@ -55,7 +56,7 @@ class LanguagePickerScreen: PickerScreen(){ "community-based work in progress and are INCOMPLETE! \n" + "The percentage shown is how much of the language is translated in-game.\n" + "If you want to help translating the game " + - "into your language, contact me!",skin)).pad(10f).row() + "into your language, send me an email to yairm210@hotmail.com!",skin)).pad(10f).row() languageTables.addAll(GameBasics.Translations.getLanguages().map { LanguageTable(it,skin) } .sortedByDescending { it.percentComplete } )