Using InputPrompt for interact prompt

This commit is contained in:
Rob Kelly 2025-04-19 10:01:37 -06:00
parent db2507048f
commit ecdedfc58c
4 changed files with 23 additions and 11 deletions

View File

@ -39,6 +39,8 @@ SETTINGS_AUDIO_HEADING,"Audio Settings"
SETTINGS_CONTROLS,Controls SETTINGS_CONTROLS,Controls
SETTINGS_CONTROLS_HEADING,"Control Bindings" SETTINGS_CONTROLS_HEADING,"Control Bindings"
, ,
ACTION_HOLD_MODIFIER,Hold
,
ACTION_move_forward,"Move forward" ACTION_move_forward,"Move forward"
ACTION_move_left,"Move left" ACTION_move_left,"Move left"
ACTION_move_back,"Move back" ACTION_move_back,"Move back"

1 keys en
39 SETTINGS_CONTROLS Controls
40 SETTINGS_CONTROLS_HEADING Control Bindings
41
42 ACTION_HOLD_MODIFIER Hold
43
44 ACTION_move_forward Move forward
45 ACTION_move_left Move left
46 ACTION_move_back Move back

View File

@ -31,6 +31,7 @@ const ACTION_HOLD_KEY := "ACTION_HOLD_MODIFIER"
func _ready() -> void: func _ready() -> void:
ProjectSettings.settings_changed.connect(_update)
_update() _update()

View File

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://b47goj32i6sdh"] [gd_scene load_steps=3 format=3 uid="uid://b47goj32i6sdh"]
[ext_resource type="Script" path="res://src/ui/elements/input_prompt/input_prompt.gd" id="1_qq6w5"] [ext_resource type="Theme" uid="uid://doq7ay6f7dgfo" path="res://src/ui/menus/menu.theme" id="1_br7b0"]
[ext_resource type="Script" uid="uid://dn50ip335p7oh" path="res://src/ui/elements/input_prompt/input_prompt.gd" id="1_qq6w5"]
[node name="InputPrompt" type="Label"] [node name="InputPrompt" type="Label"]
anchors_preset = 15 anchors_preset = 15
@ -8,7 +9,7 @@ anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme = ExtResource("1_br7b0")
theme_type_variation = &"InputPrompt" theme_type_variation = &"InputPrompt"
text = "❓ - ACTION_" text = "❓ - ACTION_"
script = ExtResource("1_qq6w5") script = ExtResource("1_qq6w5")
hold = null

View File

@ -1,9 +1,10 @@
[gd_scene load_steps=10 format=3 uid="uid://dq1x21tq06dud"] [gd_scene load_steps=11 format=3 uid="uid://dq1x21tq06dud"]
[ext_resource type="Theme" uid="uid://b07fevr214mmr" path="res://src/ui/hud/hud_theme.tres" id="1_lirk3"] [ext_resource type="Theme" uid="uid://b07fevr214mmr" path="res://src/ui/hud/hud_theme.tres" id="1_lirk3"]
[ext_resource type="Script" uid="uid://lrsv0185bfu" path="res://src/ui/hud/player_hud.gd" id="2_j6lpx"] [ext_resource type="Script" uid="uid://lrsv0185bfu" path="res://src/ui/hud/player_hud.gd" id="2_j6lpx"]
[ext_resource type="Script" uid="uid://bdsv404evn4fk" path="res://src/ui/hud/interact_hud.gd" id="3_n6jee"] [ext_resource type="Script" uid="uid://bdsv404evn4fk" path="res://src/ui/hud/interact_hud.gd" id="3_n6jee"]
[ext_resource type="FontFile" uid="uid://qadtckvw0t3l" path="res://assets/fonts/fontawesome-free-6.7.2-desktop/otfs/Font Awesome 6 Free-Solid-900.otf" id="4_2q5it"] [ext_resource type="FontFile" uid="uid://qadtckvw0t3l" path="res://assets/fonts/fontawesome-free-6.7.2-desktop/otfs/Font Awesome 6 Free-Solid-900.otf" id="4_2q5it"]
[ext_resource type="PackedScene" uid="uid://b47goj32i6sdh" path="res://src/ui/elements/input_prompt/input_prompt.tscn" id="4_iwjh7"]
[ext_resource type="Script" uid="uid://cjs2fen6jo0g0" path="res://src/ui/rumbler.gd" id="4_ud8na"] [ext_resource type="Script" uid="uid://cjs2fen6jo0g0" path="res://src/ui/rumbler.gd" id="4_ud8na"]
[sub_resource type="Animation" id="Animation_n6jee"] [sub_resource type="Animation" id="Animation_n6jee"]
@ -153,10 +154,17 @@ offset_right = 85.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 0 grow_vertical = 0
[node name="Label" type="Label" parent="InteractHUD/HBoxContainer"] [node name="InputPrompt" parent="InteractHUD/HBoxContainer" instance=ExtResource("4_iwjh7")]
layout_mode = 2 layout_mode = 2
text = "Press [E] to " theme_override_colors/font_color = Color(1, 1, 1, 1)
horizontal_alignment = 2 theme_override_constants/outline_size = 16
text = "❓"
action = &"interact"
show_name = false
[node name="Spacer" type="Label" parent="InteractHUD/HBoxContainer"]
layout_mode = 2
text = " - "
[node name="InteractVerb" type="Label" parent="InteractHUD/HBoxContainer"] [node name="InteractVerb" type="Label" parent="InteractHUD/HBoxContainer"]
unique_name_in_owner = true unique_name_in_owner = true
@ -234,10 +242,10 @@ anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
anchor_right = 0.5 anchor_right = 0.5
anchor_bottom = 0.5 anchor_bottom = 0.5
offset_left = -396.518 offset_left = -398.862
offset_top = -302.686 offset_top = -301.076
offset_right = -396.518 offset_right = -398.862
offset_bottom = -302.686 offset_bottom = -301.076
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("4_ud8na") script = ExtResource("4_ud8na")