mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
language menu to highlight current language on startup
This commit is contained in:
@@ -8,7 +8,6 @@ import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.ui.UIItemTextButtonList
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class UITitleLanguage : UICanvas() {
|
||||
|
||||
@@ -77,6 +76,18 @@ class UITitleLanguage : UICanvas() {
|
||||
textArea1.deselect()
|
||||
}
|
||||
|
||||
// highlight initial
|
||||
textArea1.buttons.forEachIndexed { index, it ->
|
||||
if (it.labelText == Lang["MENU_LANGUAGE_THIS"]) {
|
||||
textArea1.select(index)
|
||||
}
|
||||
}
|
||||
textArea2.buttons.forEachIndexed { index, it ->
|
||||
if (it.labelText == Lang["MENU_LANGUAGE_THIS"]) {
|
||||
textArea2.select(index)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
|
||||
Reference in New Issue
Block a user