DialogueResponsesMenu is a specialized Container node that manages and displays dialogue response options. It handles keyboard and mouse navigation, focus management, and response selection automatically.
Exports
Optionally specify a control to duplicate for each response. If not set, the menu will create a default
Button for each response.The template control can have a response property to receive the full DialogueResponse object, or it will fall back to setting the text property.The action for accepting a response. If empty, defaults to
ui_accept. This can be overridden by a parent dialogue balloon.Automatically set up focus neighbours when the responses list changes. This configures keyboard navigation between response items.
Automatically focus the first item when the menu becomes visible.
Hide any responses where
is_allowed is false. When disabled, failed responses are shown but disabled.Properties
The list of dialogue responses to display. Setting this property automatically rebuilds the menu with the new responses.Each response should be a
DialogueResponse object from the dialogue line.Signals
response_focused
response- TheDialogueResponseobject that was focused
response_selected
response- TheDialogueResponseobject that was selected
Methods
get_menu_items()
Control nodes representing the response items.
configure_focus()
This method is automatically called when
auto_configure_focus is enabled and the responses list changes. You typically only need to call this manually if you’ve disabled auto-configuration.Usage Example
Custom Response Template
You can create a custom response button with additional styling and behavior:response_template export of your DialogueResponsesMenu.
Focus Management
The menu automatically handles focus in several ways:- Keyboard Navigation: Arrow keys (up/down) navigate between responses
- Mouse Navigation: Hovering over a response automatically focuses it
- Automatic Focus: The first response is focused when the menu becomes visible
- Focus Neighbors: All responses are properly linked for seamless navigation
Disallowed responses (where
is_allowed is false) are automatically excluded from navigation and marked as disabled.Integration with Dialogue Lines
The responses menu works seamlessly with dialogue lines returned byDialogueManager.get_next_dialogue_line():
DialogueResponse in the array contains:
id- The ID of the responsenext_id- The ID of the next dialogue line if this response is chosenis_allowed- Whether the response passed its condition checktext- The text to display for this responsecharacter- The character name (or empty string)tags- A list of tags for this response