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

24 lines
569 B
GDScript3
Raw Normal View History

2022-02-12 22:15:01 +00:00
extends HBoxContainer
signal del_pressed( command, control, eventInput )
var command:String
var eventInput
2022-02-25 00:28:14 +00:00
func set_param( _command:String, control:String, param_comment:String, _eventInput ):
self.command = _command
2022-02-12 22:15:01 +00:00
$Label.text = control
2022-02-25 00:28:14 +00:00
self.eventInput = _eventInput
2022-02-12 22:15:01 +00:00
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 )