I have two sliders that I can select using my keyboard. The black bar shows what currently is selected. It looks for current_position_in_option_buttons and positions itself as needed. When selected on either the sound or music option you can use the left and right arrows to change the setting. As you can see I have this hacky way to change each setting. if current_position_in_option_buttons == 0: change sound settingif current_position_in_option_buttons == 1: change music settingIs there a better way to do this? I'm wondering what I would do if there are hundreds of options to change. The current approach would lead to hundreds of if statements.global.gd:var sound_volume = 50 setget set_sound_volume, get_sound_volumevar music_volume = 50 setget set_music_volume, get_music_volumeoptions_menu.gd:var current_position_in_option_buttons# option slidersvar option_sliders = []var option_sliders_list_sizefunc change_slider_value_to_right():    if option_sliders[current_position_in_option_buttons].get_type() == HSlider:    var cur_val = 0    if current_position_in_option_buttons == 0:        #change the volume of sound        cur_val = global.get_sound_volume()        global.set_sound_volume(cur_val + 5) #TODO make 5 a const value    if current_position_in_option_buttons == 1:        #change the volume of music        cur_val = global.get_music_volume()        global.set_music_volume(cur_val + 5) #TODO make 5 a const value    option_sliders[current_position_in_option_buttons].set_value(cur_val + 5) #TODO make 5 a const valueI have taken out all superfluous code. If you need more code let me know and I'll post it.
List of options to change in a game menu using a list
gdscript