mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
writing config to disk
This commit is contained in:
@@ -10,6 +10,7 @@ import net.torvald.terrarum.App.printdbgerr
|
||||
import net.torvald.terrarum.QNDTreeNode
|
||||
import net.torvald.terrarum.TitleScreen
|
||||
import net.torvald.terrarum.Yaml
|
||||
import net.torvald.terrarum.serialise.WriteConfig
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.ui.UIItemTextButton
|
||||
import net.torvald.terrarum.ui.UIItemTextButtonList
|
||||
@@ -92,7 +93,13 @@ open class UIRemoCon(val parent: TitleScreen, treeRepresentation: QNDTreeNode<St
|
||||
//System.exit(0)
|
||||
Gdx.app.exit()
|
||||
}
|
||||
else if (it.labelText == "MENU_LABEL_RETURN") {
|
||||
else if (it.labelText.startsWith("MENU_LABEL_RETURN")) {
|
||||
val tag = it.labelText.substringAfter('+')
|
||||
|
||||
when (tag) {
|
||||
"WRITETOCONFIG" -> WriteConfig()
|
||||
}
|
||||
|
||||
if (currentRemoConContents.parent != null) {
|
||||
remoConTray.consume()
|
||||
|
||||
|
||||
@@ -70,10 +70,12 @@ class UITitleLanguage : UICanvas() {
|
||||
// attach listeners
|
||||
textArea1.selectionChangeListener = { _, newSelectionIndex ->
|
||||
App.GAME_LOCALE = localeList[newSelectionIndex]
|
||||
App.setConfig("language", localeList[newSelectionIndex])
|
||||
textArea2.deselect()
|
||||
}
|
||||
textArea2.selectionChangeListener = { _, newSelectionIndex ->
|
||||
App.GAME_LOCALE = localeList[newSelectionIndex + localeFirstHalf.size]
|
||||
App.setConfig("language", localeList[newSelectionIndex + localeFirstHalf.size])
|
||||
textArea1.deselect()
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ object UITitleRemoConYaml {
|
||||
- MENU_OPTIONS_CONTROLS : net.torvald.terrarum.modulebasegame.ui.UIKeyboardControlPanel
|
||||
- MENU_LABEL_LANGUAGE : net.torvald.terrarum.modulebasegame.ui.UITitleLanguage
|
||||
- MENU_MODULES : net.torvald.terrarum.ModOptionsHost
|
||||
- MENU_LABEL_RETURN
|
||||
- MENU_LABEL_RETURN+WRITETOCONFIG
|
||||
- MENU_LABEL_CREDITS
|
||||
- MENU_LABEL_COPYRIGHT : net.torvald.terrarum.modulebasegame.ui.UITitleCredits
|
||||
- MENU_CREDIT_GPL_DNT : net.torvald.terrarum.modulebasegame.ui.UITitleGPL3
|
||||
|
||||
Reference in New Issue
Block a user