2022-02-12 22:15:01 +00:00
|
|
|
extends HBoxContainer
|
|
|
|
|
|
|
|
|
|
|
|
signal add_pressed( command )
|
|
|
|
|
|
|
|
var action = null
|
|
|
|
|
|
|
|
func set_label( command ):
|
|
|
|
$Label.text = command
|
|
|
|
|
2022-02-24 22:08:03 +00:00
|
|
|
|
2022-02-12 22:15:01 +00:00
|
|
|
func set_action( _action ):
|
|
|
|
action = _action
|
2022-02-24 22:08:03 +00:00
|
|
|
|
|
|
|
|
2022-02-12 22:15:01 +00:00
|
|
|
func set_param(_action, _command, position):
|
|
|
|
set_label(_command)
|
|
|
|
set_action(_action)
|
|
|
|
if position:
|
|
|
|
$Add_front.visible = true
|
|
|
|
$Add.visible = false
|
|
|
|
else:
|
|
|
|
$Add_front.visible = false
|
|
|
|
$Add.visible = true
|
|
|
|
|
2022-02-24 22:08:03 +00:00
|
|
|
|
2022-02-12 22:15:01 +00:00
|
|
|
func _on_add_pressed():
|
|
|
|
emit_signal( "add_pressed", action, $Label.text )
|
2022-02-24 22:08:03 +00:00
|
|
|
|