Add a component to enable/disable interactions on a UI node #16270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Project goal: Component type for enabling/disabling UI widget interactions (allow inactive buttons, etc…)
Solution
The
Interactivity
component.It stores a state describing whether an Interactive Node can be interacted with or not.
An interactive node can be described as an entity containing both the
Node
andInteraction
components.The
Interactivity
component can be defined with the following properties:It is used by the
ui_focus_system
to determine whether an interactive node should have it'sInteraction
component updated when an interaction does occur. Furthermore, the assertion should be made that a "disabled" entity will always have it'sInteraction
component set toInteraction::None
.It can also be used by secondary systems to, for example, change the visual appearance of a UI node, or to decide whether or not to use
FocusPolicy::Block
.Testing
Not yet
Migration Guide
Migrations are not necessary as the absence of the
Interactivity
component is interpreted as the component being enabled.