diff --git a/src/nodes/UI/UnitPopup.gd b/src/nodes/UI/UnitPopup.gd new file mode 100644 index 0000000..8a08071 --- /dev/null +++ b/src/nodes/UI/UnitPopup.gd @@ -0,0 +1,6 @@ +extends PopupPanel + + +func _move_selected(move_num: int) -> void: + print(move_num) + hide() diff --git a/src/nodes/UI/UnitPopup.tscn b/src/nodes/UI/UnitPopup.tscn index 536172a..81dcff2 100644 --- a/src/nodes/UI/UnitPopup.tscn +++ b/src/nodes/UI/UnitPopup.tscn @@ -1,11 +1,13 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://src/assets/theme.theme" type="Theme" id=1] +[ext_resource path="res://src/nodes/UI/UnitPopup.gd" type="Script" id=2] [node name="PopupMenu" type="PopupPanel"] margin_right = 39.0 margin_bottom = 97.0 theme = ExtResource( 1 ) +script = ExtResource( 2 ) [node name="VBoxContainer" type="VBoxContainer" parent="."] anchor_left = 0.5 @@ -32,6 +34,12 @@ margin_bottom = 24.0 text = "Damage" align = 1 +[node name="Move0" type="Button" parent="VBoxContainer"] +margin_top = 76.0 +margin_right = 32.0 +margin_bottom = 84.0 +text = "Move 0" + [node name="Move1" type="Button" parent="VBoxContainer"] margin_top = 28.0 margin_right = 32.0 @@ -56,14 +64,8 @@ margin_right = 32.0 margin_bottom = 72.0 text = "Move 4" -[node name="Move5" type="Button" parent="VBoxContainer"] -margin_top = 76.0 -margin_right = 32.0 -margin_bottom = 84.0 -text = "Move 5" - -[connection signal="button_down" from="VBoxContainer/Move1" to="." method="hide"] -[connection signal="button_down" from="VBoxContainer/Move2" to="." method="hide"] -[connection signal="button_down" from="VBoxContainer/Move3" to="." method="hide"] -[connection signal="button_down" from="VBoxContainer/Move4" to="." method="hide"] -[connection signal="button_down" from="VBoxContainer/Move5" to="." method="hide"] +[connection signal="pressed" from="VBoxContainer/Move0" to="." method="_move_selected" binds= [ 0 ]] +[connection signal="pressed" from="VBoxContainer/Move1" to="." method="_move_selected" binds= [ 1 ]] +[connection signal="pressed" from="VBoxContainer/Move2" to="." method="_move_selected" binds= [ 2 ]] +[connection signal="pressed" from="VBoxContainer/Move3" to="." method="_move_selected" binds= [ 3 ]] +[connection signal="pressed" from="VBoxContainer/Move4" to="." method="_move_selected" binds= [ 4 ]]