mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 05:41:11 +07:00
Desktop no longer crashes/bugs on first initialization
This commit is contained in:
@ -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"
|
Portuguese:"Antiguidade Clássica"
|
||||||
German:"Klassik"
|
German:"Klassik"
|
||||||
Czech:"Klasická starověká éra"
|
Czech:"Klasická starověká éra"
|
||||||
Malau:"Era Klasik"
|
Malay:"Era Klasik"
|
||||||
Korean:"고전 시대"
|
Korean:"고전 시대"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class UncivGame(val version: String) : Game() {
|
|||||||
// Sometimes, resume() is called and the gameInfo doesn't have any civilizations.
|
// 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,
|
// 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.
|
// and the original (and empty) initial GameInfo remained.
|
||||||
if(gameInfo.civilizations.isEmpty())
|
if(!::gameInfo.isInitialized || gameInfo.civilizations.isEmpty())
|
||||||
return create()
|
return create()
|
||||||
|
|
||||||
if(::worldScreen.isInitialized) worldScreen.dispose() // I hope this will solve some of the many OuOfMemory exceptions...
|
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) }
|
val availableTranslations = translations.filter { it.value.containsKey(language) }
|
||||||
|
|
||||||
if(language=="English") percentComplete = 100
|
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("_"," ")
|
val spaceSplitLang = language.replace("_"," ")
|
||||||
add("$spaceSplitLang ($percentComplete%)".toLabel())
|
add("$spaceSplitLang ($percentComplete%)".toLabel())
|
||||||
|
@ -64,7 +64,9 @@ internal object DesktopLauncher {
|
|||||||
|
|
||||||
thread {
|
thread {
|
||||||
while (true) {
|
while (true) {
|
||||||
|
try {
|
||||||
updateRpc(game)
|
updateRpc(game)
|
||||||
|
}catch (ex:Exception){}
|
||||||
Thread.sleep(1000)
|
Thread.sleep(1000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user