Not directly, it works like this:
FirstOptionBox script:
func _on_FirstButton_toggled(button_pressed):
if button_pressed:
clear()
add_item("item a", 11)
add_item("item b", 12)
add_item("item c", 13)
add_item("item d", 14)
func _on_SecondButton_toggled(button_pressed):
if button_pressed:
clear()
add_item("item a", 21)
add_item("item b", 22)
add_item("item c", 23)
func _on_ThirdButton_toggled(button_pressed):
if button_pressed:
clear()
add_item("item a", 31)
add_item("item b", 32)
The buttons are normal TextureButtons connected with my OptionBox. My OptionBox is connected with a item_selected signal with another OptionBox. It is supposed to work like categories (eg. you pick category a and it displays four options in a second optionbox; if you pick category b you'll get another 4 options in the second optionbox)
it looks like this:
SecondOptionBox script:
func _on_FirstOptionBox_item_selected(ID):
if ID >= 10 and ID <= 20:
clear()
add_item("first option a",101)
add_item("second option a",102)
add_item("third option a",103)
add_item("fourth option a",104)
if ID >= 20 and ID <= 30:
clear()
add_item("first option b",101)
add_item("second option b",102)
add_item("third option b",103)
add_item("fourth option b",104)
if ID >= 30 and ID <= 40:
clear()
add_item("first option c",101)
add_item("second option c",102)
add_item("third option c",103)
add_item("fourth option c",104)
So, I want it to pick the id of the selection option from my first optionbutton and then display the right options on my second option box.
What I get is simply 0 for the first, 1 for the second...