classname CogitoTabMenu extends TabContainer This class can be extended to create a tab…
- User
class_name CogitoTabMenu extends TabContainer
This class can be extended to create a tab menu with controller support.
Helper for controller input. Sets the node to focus on for each tab.
The array index corresponds to the tabs.
@export var nodes_to_focus: Array[Control]
func _input(event): if !is_visible_in_tree(): return
#Tab navigation if (event.is_action_pressed("ui_next_tab")): if current_tab + 1 == get_tab_count(): current_tab = 0 else: current_tab += 1 if nodes_to_focus[current_tab]: #print("Grabbing focus of : ", tab_container.current_tab, " - ", nodes_to_focus[tab_container.current_tab]) nodes_to_focus[current_tab].grab_focus.call_deferred() if (event.is_action_pressed("ui_prev_tab")): if current_tab == 0: current_tab = get_tab_count()-1 else: current_tab -= 1 if nodes_to_focus[current_tab]: #print("Grabbing focus of : ", tab_container.current_tab, " - ", nodes_to_focus[tab_container.current_tab]) nodes_to_focus[current_tab].grab_focus.call_deferred() - Assistant
- User
extends OptionButton
Called when the node enters the scene tree for the first time.
func _ready(): get_popup().connect("window_input", propagate_input) pass # Replace with function body.
func propagate_input(event): if MenuTemplateManager.ControllerEchoInputGenerator: MenuTemplateManager.ControllerEchoInputGenerator._input(event)
- Assistant
Your script extends
OptionButtonand connects thewindow_inputsignal from the popup to thepropagate_inputmethod. This is typically used in UI that requires controller support, allowing specific events to bubble up or be handled by another component (in this case, ).