You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Input glyph displays for a 2D game that show control hints on screen
Describe the problem or limitation you are having in your project
I have a resource that exports a StringName property corresponding to the action in the InputMap that should be displayed as a button glyph. This works fine, but I feel that it would help to have a way to select an action from a dropdown, reducing the chance of mistyping an action name, and reducing trips to the Input Map project settings in case one forgets the correct name. In addition, the built-in TouchScreenButton node also simply has a StringName property that should correspond to an action in the InputMap.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I think an @export_action annotation, similar to other annotations that use project context like @export_file, would provide a nice experience for specifying InputMap actions for nodes/resources that require one.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The inspector would display the property similar to @export_enum, allowing the user to pick from a list of actions defined in the project settings' InputMap.
This would be used in GDScript as follows:
@export_action varhint_action: StringName=&"run"
This could also be applied to the TouchScreenButton node so that an action can be quickly selected.
If TouchScreenButton does use this action dropdown, there is possibility for a regression if a project uses dynamically created actions since the default inspector enum behavior does not allow the user to type in a value manually, so it should probably use PROPERTY_HINT_ENUM_SUGGESTION.
If this enhancement will not be used often, can it be worked around with a few lines of script?
As far as I'm aware, @export_enum nor @export_custom allow a dynamic list of options, like options taken from project settings, so they are not suitable for this. You could possibly implement this using get_property_list() but this seems rather inconvenient.
Is there a reason why this should be core and not an add-on in the asset library?
Currently GDScript does not support custom annotations (#1316) so an add-on could not implement it. In addition, this change could also improve the built-in node TouchScreenButton.
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
Input glyph displays for a 2D game that show control hints on screen
Describe the problem or limitation you are having in your project
I have a resource that exports a
StringName
property corresponding to the action in the InputMap that should be displayed as a button glyph. This works fine, but I feel that it would help to have a way to select an action from a dropdown, reducing the chance of mistyping an action name, and reducing trips to the Input Map project settings in case one forgets the correct name. In addition, the built-inTouchScreenButton
node also simply has aStringName
property that should correspond to an action in the InputMap.Describe the feature / enhancement and how it helps to overcome the problem or limitation
I think an
@export_action
annotation, similar to other annotations that use project context like@export_file
, would provide a nice experience for specifying InputMap actions for nodes/resources that require one.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The inspector would display the property similar to
@export_enum
, allowing the user to pick from a list of actions defined in the project settings' InputMap.This would be used in GDScript as follows:
This could also be applied to the
TouchScreenButton
node so that an action can be quickly selected.If
TouchScreenButton
does use this action dropdown, there is possibility for a regression if a project uses dynamically created actions since the default inspector enum behavior does not allow the user to type in a value manually, so it should probably usePROPERTY_HINT_ENUM_SUGGESTION
.If this enhancement will not be used often, can it be worked around with a few lines of script?
As far as I'm aware,
@export_enum
nor@export_custom
allow a dynamic list of options, like options taken from project settings, so they are not suitable for this. You could possibly implement this usingget_property_list()
but this seems rather inconvenient.Is there a reason why this should be core and not an add-on in the asset library?
Currently GDScript does not support custom annotations (#1316) so an add-on could not implement it. In addition, this change could also improve the built-in node
TouchScreenButton
.The text was updated successfully, but these errors were encountered: