I don’t think there’s a proper way to do this. I’d use the hint_string
path to avoid possible collisions with engine updates or other plugins and possible issues if the plugin fails to load for some reason. something like @export_custom(PROPERTY_HINT_NONE, "input_action")
which should be safe.
As a side note, a plugin for this is not needed (as long as you are only need it in a couple places) You can achieve a similar result with Object._validate_property()
Example:
@tool
@tool
extends Node
@export var input_action:String
func _validate_property(property: Dictionary) -> void:
if property.name == "input_action":
property.hint = PROPERTY_HINT_ENUM_SUGGESTION
# Filter the inputs and map their names to remove input/
var entries = ProjectSettings.get_property_list().filter(func(entry):
return entry.name.begins_with("input/") and entry.name.find(".") == -1
).map(func(entry):
return entry.name.replace("input/", "")
)
property.hint_string = ",".join(entries)
Result: