Re-added language picker, hope it won't generate negative reviews again =\

This commit is contained in:
Yair Morgenstern 2018-12-01 22:22:30 +02:00
parent ec65268099
commit 8ec63f2e94
2 changed files with 8 additions and 5 deletions

View File

@ -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){

View File

@ -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 } )