godot-third-person-basic-scene/scenes/controls/control_input.gd

23 lines
569 B
GDScript

extends HBoxContainer
signal del_pressed( command, control, eventInput )
var command:String
var eventInput
func set_param( _command:String, control:String, param_comment:String, _eventInput ):
self.command = _command
$Label.text = control
self.eventInput = _eventInput
if param_comment.length() > 0:
$Comment.text = param_comment
$Empty.visible = false
$Comment.visible = true
else:
$Comment.text = ""
$Empty.visible = true
$Comment.visible = false
func _on_del_pressed():
emit_signal( "del_pressed", self.command, $Label.text, self.eventInput )