mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
options to change atlas texture size
This commit is contained in:
@@ -56,10 +56,10 @@ object ControlPanelCommon {
|
||||
|
||||
val initialSel = optionsList.indexOf(App.getConfigString(optionName))
|
||||
|
||||
println("labelFuns = ${labelFuns.map { it.invoke() }}")
|
||||
println("optionsList = $optionsList")
|
||||
println("optionName = $optionName; value = ${App.getConfigString(optionName)}")
|
||||
println("initialSel = $initialSel")
|
||||
// println("labelFuns = ${labelFuns.map { it.invoke() }}")
|
||||
// println("optionsList = $optionsList")
|
||||
// println("optionName = $optionName; value = ${App.getConfigString(optionName)}")
|
||||
// println("initialSel = $initialSel")
|
||||
|
||||
if (initialSel < 0) throw IllegalArgumentException("config value '${App.getConfigString(optionName)}' for option '$optionName' is not found on the options list")
|
||||
|
||||
@@ -69,6 +69,19 @@ object ControlPanelCommon {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (args.startsWith("spinnersel,")) {
|
||||
val labelFuns = arg.subList(1, arg.size).map { { it } }
|
||||
val optionsList = arg.subList(1, arg.size).map { it.toInt() }
|
||||
|
||||
val initialSel = optionsList.indexOf(App.getConfigInt(optionName))
|
||||
if (initialSel < 0) throw IllegalArgumentException("config value '${App.getConfigString(optionName)}' for option '$optionName' is not found on the options list")
|
||||
|
||||
UIItemTextSelector(parent, x, y, labelFuns, initialSel, CONFIG_SPINNER_WIDTH, clickToShowPalette = false, useSpinnerButtons = true) to { it: UIItem, optionStr: String ->
|
||||
(it as UIItemTextSelector).selectionChangeListener = {
|
||||
App.setConfig(optionStr, optionsList[it])
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (args.startsWith("spinner,")) {
|
||||
UIItemSpinner(parent, x, y, App.getConfigInt(optionName), arg[1].toInt(), arg[2].toInt(), arg[3].toInt(), CONFIG_SPINNER_WIDTH, numberToTextFunction = { "${it.toLong()}" }) to { it: UIItem, optionStr: String ->
|
||||
(it as UIItemSpinner).selectionChangeListener = {
|
||||
|
||||
Reference in New Issue
Block a user