diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-06-18 16:43:22 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-06-18 16:43:22 +0200 |
commit | 395c25b1fbe51f42decf402f97e51eabcc8c0a77 (patch) | |
tree | 72a17c71a39b53d328a76e111ae205d9538d64d0 /UI/Menu | |
parent | 2686ec6d4af6b5437a5f5a5cac008f3d38295f78 (diff) |
Godot v3 -> v4
Diffstat (limited to 'UI/Menu')
-rw-r--r-- | UI/Menu/KeyBindings.gd | 4 | ||||
-rw-r--r-- | UI/Menu/KeyBindings.tscn | 116 | ||||
-rw-r--r-- | UI/Menu/Menu.gd | 2 | ||||
-rw-r--r-- | UI/Menu/Menu.tscn | 47 | ||||
-rw-r--r-- | UI/Menu/MenuButton.tscn | 15 |
5 files changed, 74 insertions, 110 deletions
diff --git a/UI/Menu/KeyBindings.gd b/UI/Menu/KeyBindings.gd index 4650be9..eca3d22 100644 --- a/UI/Menu/KeyBindings.gd +++ b/UI/Menu/KeyBindings.gd @@ -24,8 +24,8 @@ func set_keys(): var input = get_node("Panel/VBoxContainer/" + str(action) + "/Input") input.set_pressed(false) - var action_list = InputMap.get_action_list(action) - if action_list.empty(): + var action_list = InputMap.action_get_events(action) + if action_list.is_empty(): input.set_text("SET BUTTON") else: var text = "" diff --git a/UI/Menu/KeyBindings.tscn b/UI/Menu/KeyBindings.tscn index 948b44b..76efdde 100644 --- a/UI/Menu/KeyBindings.tscn +++ b/UI/Menu/KeyBindings.tscn @@ -1,123 +1,91 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=2 format=3 uid="uid://bs0r1xpkaxjr0"] -[ext_resource path="res://UI/Menu/KeyBindings.gd" type="Script" id=1] +[ext_resource type="Script" path="res://UI/Menu/KeyBindings.gd" id="1"] [node name="KeyBindings" type="Control"] +layout_mode = 3 +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -margin_left = 64.0 -margin_top = 64.0 -margin_right = -64.0 -margin_bottom = -88.0 -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} +offset_left = 64.0 +offset_top = 64.0 +offset_right = -64.0 +offset_bottom = -88.0 +script = ExtResource("1") [node name="Panel" type="Panel" parent="."] -margin_right = 896.0 -margin_bottom = 448.0 +layout_mode = 0 +offset_right = 896.0 +offset_bottom = 448.0 [node name="VBoxContainer" type="VBoxContainer" parent="Panel"] -margin_left = 256.0 -margin_top = 24.0 -margin_right = 640.0 -margin_bottom = 424.0 -__meta__ = { -"_edit_use_anchors_": false -} +layout_mode = 0 +offset_left = 256.0 +offset_top = 24.0 +offset_right = 640.0 +offset_bottom = 424.0 [node name="DIRECTION_LEFT" type="HBoxContainer" parent="Panel/VBoxContainer"] -margin_right = 384.0 -margin_bottom = 20.0 +layout_mode = 2 [node name="Label" type="Label" parent="Panel/VBoxContainer/DIRECTION_LEFT"] -margin_top = 3.0 -margin_right = 24.0 -margin_bottom = 17.0 +layout_mode = 2 text = "Left" [node name="Input" type="Button" parent="Panel/VBoxContainer/DIRECTION_LEFT"] -margin_left = 28.0 -margin_right = 40.0 -margin_bottom = 20.0 +layout_mode = 2 [node name="Clear" type="Button" parent="Panel/VBoxContainer/DIRECTION_LEFT"] -margin_left = 44.0 -margin_right = 88.0 -margin_bottom = 20.0 +layout_mode = 2 text = "Clear" [node name="DIRECTION_RIGHT" type="HBoxContainer" parent="Panel/VBoxContainer"] -margin_top = 24.0 -margin_right = 384.0 -margin_bottom = 44.0 +layout_mode = 2 [node name="Label" type="Label" parent="Panel/VBoxContainer/DIRECTION_RIGHT"] -margin_top = 3.0 -margin_right = 32.0 -margin_bottom = 17.0 +layout_mode = 2 text = "Right" [node name="Input" type="Button" parent="Panel/VBoxContainer/DIRECTION_RIGHT"] -margin_left = 36.0 -margin_right = 48.0 -margin_bottom = 20.0 +layout_mode = 2 [node name="Clear" type="Button" parent="Panel/VBoxContainer/DIRECTION_RIGHT"] -margin_left = 52.0 -margin_right = 96.0 -margin_bottom = 20.0 +layout_mode = 2 text = "Clear" [node name="JUMP" type="HBoxContainer" parent="Panel/VBoxContainer"] -margin_top = 48.0 -margin_right = 384.0 -margin_bottom = 68.0 +layout_mode = 2 [node name="Label" type="Label" parent="Panel/VBoxContainer/JUMP"] -margin_top = 3.0 -margin_right = 32.0 -margin_bottom = 17.0 +layout_mode = 2 text = "Jump" [node name="Input" type="Button" parent="Panel/VBoxContainer/JUMP"] -margin_left = 36.0 -margin_right = 48.0 -margin_bottom = 20.0 +layout_mode = 2 [node name="Clear" type="Button" parent="Panel/VBoxContainer/JUMP"] -margin_left = 52.0 -margin_right = 96.0 -margin_bottom = 20.0 +layout_mode = 2 text = "Clear" [node name="RUN" type="HBoxContainer" parent="Panel/VBoxContainer"] -margin_top = 72.0 -margin_right = 384.0 -margin_bottom = 92.0 +layout_mode = 2 [node name="Label" type="Label" parent="Panel/VBoxContainer/RUN"] -margin_top = 3.0 -margin_right = 24.0 -margin_bottom = 17.0 +layout_mode = 2 text = "Run" [node name="Input" type="Button" parent="Panel/VBoxContainer/RUN"] -margin_left = 28.0 -margin_right = 40.0 -margin_bottom = 20.0 +layout_mode = 2 [node name="Clear" type="Button" parent="Panel/VBoxContainer/RUN"] -margin_left = 44.0 -margin_right = 88.0 -margin_bottom = 20.0 +layout_mode = 2 text = "Clear" -[connection signal="pressed" from="Panel/VBoxContainer/DIRECTION_LEFT/Input" to="." method="_on_Input_pressed" binds= [ "DIRECTION_LEFT" ]] -[connection signal="pressed" from="Panel/VBoxContainer/DIRECTION_LEFT/Clear" to="." method="_on_Clear_pressed" binds= [ "DIRECTION_LEFT" ]] -[connection signal="pressed" from="Panel/VBoxContainer/DIRECTION_RIGHT/Input" to="." method="_on_Input_pressed" binds= [ "DIRECTION_RIGHT" ]] -[connection signal="pressed" from="Panel/VBoxContainer/DIRECTION_RIGHT/Clear" to="." method="_on_Clear_pressed" binds= [ "DIRECTION_RIGHT" ]] -[connection signal="pressed" from="Panel/VBoxContainer/JUMP/Input" to="." method="_on_Input_pressed" binds= [ "JUMP" ]] -[connection signal="pressed" from="Panel/VBoxContainer/JUMP/Clear" to="." method="_on_Clear_pressed" binds= [ "JUMP" ]] -[connection signal="pressed" from="Panel/VBoxContainer/RUN/Input" to="." method="_on_Input_pressed" binds= [ "RUN" ]] -[connection signal="pressed" from="Panel/VBoxContainer/RUN/Clear" to="." method="_on_Clear_pressed" binds= [ "RUN" ]] + +[connection signal="pressed" from="Panel/VBoxContainer/DIRECTION_LEFT/Input" to="." method="_on_Input_pressed" binds= ["DIRECTION_LEFT"]] +[connection signal="pressed" from="Panel/VBoxContainer/DIRECTION_LEFT/Clear" to="." method="_on_Clear_pressed" binds= ["DIRECTION_LEFT"]] +[connection signal="pressed" from="Panel/VBoxContainer/DIRECTION_RIGHT/Input" to="." method="_on_Input_pressed" binds= ["DIRECTION_RIGHT"]] +[connection signal="pressed" from="Panel/VBoxContainer/DIRECTION_RIGHT/Clear" to="." method="_on_Clear_pressed" binds= ["DIRECTION_RIGHT"]] +[connection signal="pressed" from="Panel/VBoxContainer/JUMP/Input" to="." method="_on_Input_pressed" binds= ["JUMP"]] +[connection signal="pressed" from="Panel/VBoxContainer/JUMP/Clear" to="." method="_on_Clear_pressed" binds= ["JUMP"]] +[connection signal="pressed" from="Panel/VBoxContainer/RUN/Input" to="." method="_on_Input_pressed" binds= ["RUN"]] +[connection signal="pressed" from="Panel/VBoxContainer/RUN/Clear" to="." method="_on_Clear_pressed" binds= ["RUN"]] diff --git a/UI/Menu/Menu.gd b/UI/Menu/Menu.gd index 400f669..02971e5 100644 --- a/UI/Menu/Menu.gd +++ b/UI/Menu/Menu.gd @@ -3,7 +3,7 @@ extends CanvasLayer func _ready(): - self.pause_mode = PAUSE_MODE_PROCESS + self.process_mode = PROCESS_MODE_ALWAYS func close(): diff --git a/UI/Menu/Menu.tscn b/UI/Menu/Menu.tscn index 69c14c2..c29cf22 100644 --- a/UI/Menu/Menu.tscn +++ b/UI/Menu/Menu.tscn @@ -1,41 +1,38 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=5 format=3 uid="uid://dg1cuxm1da1rh"] -[ext_resource path="res://UI/Menu/Menu.gd" type="Script" id=1] -[ext_resource path="res://UI/Menu/KeyBindings.tscn" type="PackedScene" id=2] +[ext_resource type="Script" path="res://UI/Menu/Menu.gd" id="1"] +[ext_resource type="PackedScene" path="res://UI/Menu/KeyBindings.tscn" id="2"] -[sub_resource type="StyleBoxFlat" id=3] -bg_color = Color( 0, 0, 0, 0.882353 ) +[sub_resource type="StyleBoxFlat" id="3"] +bg_color = Color(0, 0, 0, 0.882353) -[sub_resource type="StyleBoxFlat" id=2] -bg_color = Color( 1, 1, 1, 0 ) +[sub_resource type="StyleBoxFlat" id="2"] +bg_color = Color(1, 1, 1, 0) border_width_left = 1 border_width_top = 1 border_width_right = 1 border_width_bottom = 1 [node name="Menu" type="CanvasLayer"] -pause_mode = 2 -script = ExtResource( 1 ) +process_mode = 2 +script = ExtResource("1") [node name="Container" type="Panel" parent="."] -margin_right = 1024.0 -margin_bottom = 600.0 -custom_styles/panel = SubResource( 3 ) -__meta__ = { -"_edit_use_anchors_": false -} +offset_right = 1024.0 +offset_bottom = 600.0 +theme_override_styles/panel = SubResource("3") [node name="Close" type="Button" parent="Container"] -margin_left = 976.0 -margin_right = 1023.0 -margin_bottom = 20.0 -custom_styles/normal = SubResource( 2 ) +layout_mode = 0 +offset_left = 976.0 +offset_right = 1023.0 +offset_bottom = 20.0 +theme_override_styles/normal = SubResource("2") text = "Close" -__meta__ = { -"_edit_use_anchors_": false -} -[node name="KeyBindings" parent="Container" instance=ExtResource( 2 )] -margin_right = 24.0 -margin_bottom = 24.0 +[node name="KeyBindings" parent="Container" instance=ExtResource("2")] +anchors_preset = 0 +offset_right = 24.0 +offset_bottom = 24.0 + [connection signal="pressed" from="Container/Close" to="." method="_on_Close_pressed"] diff --git a/UI/Menu/MenuButton.tscn b/UI/Menu/MenuButton.tscn index b5626fb..763420c 100644 --- a/UI/Menu/MenuButton.tscn +++ b/UI/Menu/MenuButton.tscn @@ -1,15 +1,14 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=2 format=3 uid="uid://b0fuyoa5jbxn0"] -[ext_resource path="res://UI/Menu/MenuButton.gd" type="Script" id=1] +[ext_resource type="Script" path="res://UI/Menu/MenuButton.gd" id="1"] [node name="MenuButton" type="Button"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -margin_right = -976.0 -margin_bottom = -580.0 +offset_right = -976.0 +offset_bottom = -580.0 text = "Menu" -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} +script = ExtResource("1") + [connection signal="pressed" from="." to="." method="_on_MenuButton_pressed"] |