mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 23:37:31 +07:00
Desktop no longer crashes/bugs on first initialization
This commit is contained in:
parent
b9487c1800
commit
110e7b7052
@ -2022,7 +2022,7 @@ Czech:"'Pro spásu duše jsou nezbytné tři věci: vědět čemu věřit; věd
|
||||
Portuguese:"Antiguidade Clássica"
|
||||
German:"Klassik"
|
||||
Czech:"Klasická starověká éra"
|
||||
Malau:"Era Klasik"
|
||||
Malay:"Era Klasik"
|
||||
Korean:"고전 시대"
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ class UncivGame(val version: String) : Game() {
|
||||
// Sometimes, resume() is called and the gameInfo doesn't have any civilizations.
|
||||
// My guess is that resume() was called but create() wasn't, or perhaps was aborted too early,
|
||||
// and the original (and empty) initial GameInfo remained.
|
||||
if(gameInfo.civilizations.isEmpty())
|
||||
if(!::gameInfo.isInitialized || gameInfo.civilizations.isEmpty())
|
||||
return create()
|
||||
|
||||
if(::worldScreen.isInitialized) worldScreen.dispose() // I hope this will solve some of the many OuOfMemory exceptions...
|
||||
|
@ -28,7 +28,7 @@ class LanguageTable(val language:String, ruleSet: RuleSet):Table(){
|
||||
val availableTranslations = translations.filter { it.value.containsKey(language) }
|
||||
|
||||
if(language=="English") percentComplete = 100
|
||||
else percentComplete = (availableTranslations.size*100 / translations.size) - 5
|
||||
else percentComplete = (availableTranslations.size*100 / translations.size) - 1 //-1 so if the user encounters anything not translated he'll be like "OK that's the 1% missing"
|
||||
|
||||
val spaceSplitLang = language.replace("_"," ")
|
||||
add("$spaceSplitLang ($percentComplete%)".toLabel())
|
||||
|
@ -64,7 +64,9 @@ internal object DesktopLauncher {
|
||||
|
||||
thread {
|
||||
while (true) {
|
||||
updateRpc(game)
|
||||
try {
|
||||
updateRpc(game)
|
||||
}catch (ex:Exception){}
|
||||
Thread.sleep(1000)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user