소스 검색

:lipstick: Add jump prompt

DricomDragon 2 주 전
부모
커밋
154311bf05

+ 16 - 0
godot/component/ui/input_prompts/input_prompts_center.gd

@@ -0,0 +1,16 @@
+class_name InputPromptsCenter
+extends CenterContainer
+## Manage the display of several inputs prompts
+
+
+func _on_title_screen_start_game() -> void:
+	_enable()
+
+
+func _on_victory_menu_visibility_changed() -> void:
+	queue_free()
+
+
+func _enable() -> void:
+	set_visible(true)
+	set_process_mode(Node.PROCESS_MODE_PAUSABLE)

+ 31 - 0
godot/component/ui/input_prompts/jump/jump_container.tscn

@@ -0,0 +1,31 @@
+[gd_scene load_steps=6 format=3 uid="uid://d6a3dml2i2qm"]
+
+[ext_resource type="Script" path="res://component/ui/input_prompts/prompt_container.gd" id="1_vkqjn"]
+[ext_resource type="Texture2D" uid="uid://b1e23gj3k1klg" path="res://addons/input_prompts/icons/xbox/a.png" id="2_ax62s"]
+[ext_resource type="Script" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="3_85i3m"]
+
+[sub_resource type="InputEventKey" id="InputEventKey_a1wgn"]
+device = -1
+physical_keycode = 32
+unicode = 32
+
+[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_qke2f"]
+device = -1
+
+[node name="JumpPromptContainer" type="HBoxContainer"]
+script = ExtResource("1_vkqjn")
+
+[node name="JumpLabel" type="Label" parent="."]
+layout_mode = 2
+theme_override_font_sizes/font_size = 34
+text = "Jump"
+
+[node name="JumpActionPrompt" type="TextureRect" parent="."]
+custom_minimum_size = Vector2(100, 100)
+layout_mode = 2
+texture = ExtResource("2_ax62s")
+stretch_mode = 5
+script = ExtResource("3_85i3m")
+action = "main"
+icon = 0
+events = Array[InputEvent]([SubResource("InputEventKey_a1wgn"), SubResource("InputEventJoypadButton_qke2f")])

+ 1 - 1
godot/component/ui/input_prompts/move/move_container.tscn

@@ -45,7 +45,7 @@ device = -1
 axis = 1
 axis_value = 1.0
 
-[node name="MoveContainer" type="HBoxContainer"]
+[node name="MovePromptContainer" type="HBoxContainer"]
 script = ExtResource("1_b1cf6")
 
 [node name="MoveLabel" type="Label" parent="."]

+ 16 - 3
godot/run/levels/infinite_level.tscn

@@ -1,4 +1,4 @@
-[gd_scene load_steps=28 format=3 uid="uid://7ivipmwaw24t"]
+[gd_scene load_steps=30 format=3 uid="uid://7ivipmwaw24t"]
 
 [ext_resource type="Texture2D" uid="uid://cgwafs6ukpm7y" path="res://component/entity/ground/ground051.jpg" id="1_3ytcp"]
 [ext_resource type="Script" path="res://run/levels/camera_tracker.gd" id="1_qdm47"]
@@ -16,9 +16,11 @@
 [ext_resource type="PackedScene" uid="uid://da7q7i7pqa5pw" path="res://component/entity/primitives/long_bridge.tscn" id="13_06kfi"]
 [ext_resource type="PackedScene" uid="uid://bohus0ptrc77h" path="res://component/entity/buildings/summit_gate/summit_gate.tscn" id="14_ky6m3"]
 [ext_resource type="Texture2D" uid="uid://daewyr44tkkm0" path="res://effect/sky/sky_stk.jpg" id="15_5bqty"]
+[ext_resource type="Script" path="res://component/ui/input_prompts/input_prompts_center.gd" id="15_k0ijo"]
 [ext_resource type="PackedScene" uid="uid://y4gc5uinkcqj" path="res://component/ui/input_prompts/move/move_container.tscn" id="15_wc547"]
 [ext_resource type="PackedScene" uid="uid://c68bdcjpdm1y2" path="res://component/ui/pause/pause_menu.tscn" id="16_orqqe"]
 [ext_resource type="PackedScene" uid="uid://bmgwhm6ejsden" path="res://component/ui/victory/victory_menu.tscn" id="17_1u7wg"]
+[ext_resource type="PackedScene" uid="uid://d6a3dml2i2qm" path="res://component/ui/input_prompts/jump/jump_container.tscn" id="17_6r3c0"]
 [ext_resource type="Script" path="res://flow/signal_wire/space_limit.gd" id="19_3qyrt"]
 
 [sub_resource type="BoxShape3D" id="BoxShape3D_ctk0t"]
@@ -398,14 +400,23 @@ script = ExtResource("8_iulsm")
 
 [node name="UI" type="Node" parent="."]
 
-[node name="InputPrompts" type="CenterContainer" parent="UI"]
+[node name="InputPromptsCenter" type="CenterContainer" parent="UI"]
+process_mode = 4
+visible = false
 anchors_preset = 15
 anchor_right = 1.0
 anchor_bottom = 1.0
 grow_horizontal = 2
 grow_vertical = 2
+script = ExtResource("15_k0ijo")
+
+[node name="InputPromptsCollection" type="VBoxContainer" parent="UI/InputPromptsCenter"]
+layout_mode = 2
+
+[node name="MovePromptContainer" parent="UI/InputPromptsCenter/InputPromptsCollection" instance=ExtResource("15_wc547")]
+layout_mode = 2
 
-[node name="MoveContainer" parent="UI/InputPrompts" instance=ExtResource("15_wc547")]
+[node name="JumpPromptContainer" parent="UI/InputPromptsCenter/InputPromptsCollection" instance=ExtResource("17_6r3c0")]
 layout_mode = 2
 
 [node name="TitleScreen" parent="UI" instance=ExtResource("13_2xijd")]
@@ -453,7 +464,9 @@ shape = SubResource("WorldBoundaryShape3D_cdiox")
 [connection signal="get_in_action" from="MainWalker/Control" to="MainWalker" method="_on_get_in_action"]
 [connection signal="main_action" from="MainWalker/Control" to="MainWalker" method="_on_main_action"]
 [connection signal="start_game" from="UI/TitleScreen" to="MainWalker/Control" method="_on_title_screen_start_game"]
+[connection signal="start_game" from="UI/TitleScreen" to="UI/InputPromptsCenter" method="_on_title_screen_start_game"]
 [connection signal="visibility_changed" from="UI/VictoryMenu" to="MainWalker/Control" method="_on_victory_menu_visibility_changed"]
+[connection signal="visibility_changed" from="UI/VictoryMenu" to="UI/InputPromptsCenter" method="_on_victory_menu_visibility_changed"]
 [connection signal="body_shape_entered" from="Limits/BottomLimitArea" to="Limits/BottomLimitArea" method="_on_body_shape_entered"]
 [connection signal="space_reached" from="Limits/BottomLimitArea" to="UI/VictoryMenu" method="_on_space_reached"]
 [connection signal="body_shape_entered" from="Limits/TopLimitArea" to="Limits/TopLimitArea" method="_on_body_shape_entered"]