options to change atlas texture size

This commit is contained in:
minjaesong
2023-08-14 03:53:25 +09:00
parent 9919a99032
commit f8f75fb7b6
16 changed files with 133 additions and 73 deletions

View File

@@ -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 = {