Hi,
I'm wondering if there is a way to modify items in params defined in a .con file after its definition?
For example:
Code
function data()
return {
type = "ASSET",
description = {
name = _("example_con"),
description = _("")
},
buildMode = "MULTI",
categories = { "" },
skipCollision = true,
autoRemovable = false,
params = {
{
key = "example_item_1",
name = _("example_item_1"),
uiType = "COMBOBOX",
values = { _("0"), _("1") }
},
{
key = "example_item_2",
name = _("example_item_2"),
uiType = "SLIDER",
values = { _("0"), _("1"), _("2"), _("3"), _("4"), _("5"), _("6"), _("7"), _("8") }
},
}
updateFn = function(params)
...REST OF THE SCRIPT...
Alles anzeigen
The params are defined with two items: "example_item_1" and "example_item_2"
Here are the things that I want to acheive:
1. Add items if a certain value of a certain item is selected, and reflect that change on the UI. For example, if "example_item_1" is 1, add "example_item_3" to params; if the value is 0, remove "example_item_3" if it exsists.
2. Modify the value of an exsisting item. For example, "example_item_2" was slide to "4". When the value of "example_item_1" is 0, the value of "example_item_2" is 0 and the slider on the UI is at 0 as well.
Thanks