mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-18 14:34:04 +09:00
simplified a structure of UIs a bit
This commit is contained in:
@@ -150,10 +150,21 @@ object Terrarum : Game() {
|
||||
private val localeSimple = arrayOf("de", "en", "es", "it")
|
||||
var gameLocale = "lateinit"
|
||||
set(value) {
|
||||
if (localeSimple.contains(value.substring(0..1)))
|
||||
field = value.substring(0..1)
|
||||
else
|
||||
field = value
|
||||
if (value.isBlank() || value.isEmpty()) {
|
||||
field = sysLang
|
||||
}
|
||||
else {
|
||||
try {
|
||||
if (localeSimple.contains(value.substring(0..1)))
|
||||
field = value.substring(0..1)
|
||||
else
|
||||
field = value
|
||||
}
|
||||
catch (e: StringIndexOutOfBoundsException) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fontGame.reload(value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user