Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 15 additions & 29 deletions scenes/game_elements/props/hint/input_key/interact_input.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,30 @@
extends TextureRect

@export var action_name: StringName
@export var keyboard_texture: Texture2D
@export var xbox_controller_texture: Texture2D
@export var playstation_controller_texture: Texture2D
@export var nintendo_controller_texture: Texture2D
@export var steam_controller_texture: Texture2D
@export var alternative: bool = false
@export var devices: InputHintManager


func _physics_process(_delta: float) -> void:
func _process(_delta: float) -> void:
if Input.is_action_pressed(action_name):
modulate = Color.GRAY
else:
modulate = Color.WHITE


func _ready() -> void:
InputHelper.device_changed.connect(_on_input_device_changed)
_on_input_device_changed(InputHelper.device, InputHelper.device_index)
if devices:
InputHelper.device_changed.connect(_on_input_device_changed)
_on_input_device_changed(InputHelper.device, InputHelper.device_index)
else:
push_warning("%s: Per-device textures not configured" % get_path())


func _on_input_device_changed(device: String, _device_index: int) -> void:
visible = true # Always visible (hybrid)

match device:
InputHelper.DEVICE_KEYBOARD:
if keyboard_texture:
texture = keyboard_texture

InputHelper.DEVICE_XBOX_CONTROLLER:
texture = xbox_controller_texture

InputHelper.DEVICE_PLAYSTATION_CONTROLLER:
texture = playstation_controller_texture

InputHelper.DEVICE_SWITCH_CONTROLLER:
texture = nintendo_controller_texture

InputHelper.DEVICE_STEAMDECK_CONTROLLER:
texture = steam_controller_texture

_:
texture = xbox_controller_texture
var textures := devices.device_map[InputHelper.device]
if alternative:
texture = textures.get(action_name + "_alt")
visible = texture != null
else:
texture = textures.get(action_name)
visible = true
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,35 @@ extends Resource
## Textures for the [code]aim_*[/code] actions
@export var aim: DirectionalInputTextures

## Texture for the [code]running[/code] action
@export var running: Texture2D

## Texture for the [code]interact[/code] action
@export var interact: Texture2D

## Texture for the [code]repel[/code] action
@export var repel: Texture2D

## Alternative texture for the [code]repel[/code] action (i.e. the keyboard key
## as opposed to mouse button)
@export var repel_alt: Texture2D

## Texture for the [code]throw[/code] action
@export var throw: Texture2D

## Alternative texture for the [code]throw[/code] action (i.e. the keyboard key
## as opposed to mouse button)
@export var throw_alt: Texture2D

## Texture for the [code]sokoban_undo[/code] action
@export var sokoban_undo: Texture2D

## Texture for the [code]sokoban_reset[/code] action
@export var sokoban_reset: Texture2D

## Texture for the [code]sokoban_skip[/code] action
@export var sokoban_skip: Texture2D


## Returns the texture for a directional action. For instance, to get the
## correct texture for the [code]aim_left[/code] action, use:
Expand Down
16 changes: 16 additions & 0 deletions scenes/game_elements/props/hint/resources/keyboard.tres
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
[ext_resource type="Texture2D" uid="uid://bc8ffgelnq2nn" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_arrows_none.tres" id="4_8ua6o"]
[ext_resource type="Script" uid="uid://dhgm1dl0ohox5" path="res://scenes/game_elements/props/hint/resources/directional_input_textures.gd" id="4_ixpgq"]
[ext_resource type="Texture2D" uid="uid://bgcopu7b0q6iy" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_arrows_up_outline.tres" id="5_4b2ex"]
[ext_resource type="Texture2D" uid="uid://c6fggds355rko" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_space_outline.tres" id="7_xgsrv"]
[ext_resource type="Texture2D" uid="uid://dsre3bn521s4n" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/mouse_right_outline.tres" id="8_7o4sm"]
[ext_resource type="Texture2D" uid="uid://bko5l0he6rf5o" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_z_outline.tres" id="9_nexuq"]
[ext_resource type="Texture2D" uid="uid://00rpvlvvuems" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_shift_icon_outline.tres" id="10_jffwy"]
[ext_resource type="Texture2D" uid="uid://c88qkrdjmolti" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_r_outline.tres" id="12_ac6oh"]
[ext_resource type="Texture2D" uid="uid://cl3gxcavxrefq" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_x_outline.tres" id="13_12qfk"]
[ext_resource type="Texture2D" uid="uid://dug86v7cum1kf" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/mouse_left_outline.tres" id="14_gs4lw"]

[sub_resource type="Resource" id="Resource_j5qbp"]
script = ExtResource("4_ixpgq")
Expand All @@ -20,4 +27,13 @@ right = ExtResource("3_j5qbp")
script = ExtResource("1_cfqun")
move = SubResource("Resource_j5qbp")
aim = SubResource("Resource_j5qbp")
running = ExtResource("10_jffwy")
interact = ExtResource("7_xgsrv")
repel = ExtResource("8_7o4sm")
repel_alt = ExtResource("9_nexuq")
throw = ExtResource("14_gs4lw")
throw_alt = ExtResource("13_12qfk")
sokoban_undo = ExtResource("9_nexuq")
sokoban_reset = ExtResource("12_ac6oh")
sokoban_skip = ExtResource("13_12qfk")
metadata/_custom_type_script = "uid://c0haweg5svww1"
14 changes: 14 additions & 0 deletions scenes/game_elements/props/hint/resources/playstation.tres
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
[ext_resource type="Texture2D" uid="uid://dspkrq3jsh26x" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/playstation/playstation_stick_r.tres" id="5_jo447"]
[ext_resource type="Texture2D" uid="uid://b5k4atvuhf6xp" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/playstation/playstation_dpad_up_outline.tres" id="5_oi6ek"]
[ext_resource type="Texture2D" uid="uid://d2fkhf81x8u6d" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/playstation/playstation_stick_r_up.tres" id="6_q44m7"]
[ext_resource type="Texture2D" uid="uid://cjhshus64ytpq" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/playstation/playstation_button_cross_outline.tres" id="7_kkpem"]
[ext_resource type="Texture2D" uid="uid://c8cfu7jw7nnbs" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/playstation/playstation_trigger_r1_outline.tres" id="13_rd2vx"]
[ext_resource type="Texture2D" uid="uid://co0m0w1t84na8" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/playstation/playstation_trigger_l1_outline.tres" id="14_wqnvl"]
[ext_resource type="Texture2D" uid="uid://dltoru1w8ue7w" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/playstation/playstation_button_square_outline.tres" id="16_y4fr0"]
[ext_resource type="Texture2D" uid="uid://d3rhotqp5gg7h" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/playstation/playstation_button_triangle_outline.tres" id="17_8wf4n"]
[ext_resource type="Texture2D" uid="uid://7qdppn7p05b1" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/playstation/playstation_button_circle_outline.tres" id="18_0nat0"]
[ext_resource type="Texture2D" uid="uid://df8vlifau6x6w" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/playstation/playstation_trigger_r2_outline.tres" id="19_khsdn"]

[sub_resource type="Resource" id="Resource_emb5i"]
script = ExtResource("4_cghs7")
Expand All @@ -35,4 +42,11 @@ metadata/_custom_type_script = "uid://dhgm1dl0ohox5"
script = ExtResource("1_omqst")
move = SubResource("Resource_kkpem")
aim = SubResource("Resource_emb5i")
running = ExtResource("14_wqnvl")
interact = ExtResource("7_kkpem")
repel = ExtResource("13_rd2vx")
throw = ExtResource("19_khsdn")
sokoban_undo = ExtResource("18_0nat0")
sokoban_reset = ExtResource("16_y4fr0")
sokoban_skip = ExtResource("17_8wf4n")
metadata/_custom_type_script = "uid://c0haweg5svww1"
14 changes: 14 additions & 0 deletions scenes/game_elements/props/hint/resources/steamdeck.tres
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
[ext_resource type="Texture2D" uid="uid://bsxgtg4k28e61" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/steam-deck/steamdeck_dpad_up_outline.tres" id="5_1ctii"]
[ext_resource type="Texture2D" uid="uid://b01qu3gqd3ctu" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/steam-deck/steamdeck_stick_r.tres" id="5_3pkdl"]
[ext_resource type="Texture2D" uid="uid://7ob6261vwokk" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/steam-deck/steamdeck_stick_r_up.tres" id="6_poinc"]
[ext_resource type="Texture2D" uid="uid://d223ajwmavjy8" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/steam-deck/steamdeck_button_a_outline.tres" id="7_wb6ss"]
[ext_resource type="Texture2D" uid="uid://b7rygdiqbuuik" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/steam-deck/steamdeck_button_r1_outline.tres" id="13_enqan"]
[ext_resource type="Texture2D" uid="uid://c2dy27tlmsigy" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/steam-deck/steamdeck_button_l1_outline.tres" id="14_hxnoe"]
[ext_resource type="Texture2D" uid="uid://rrbih026ixaf" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/steam-deck/steamdeck_button_x_outline.tres" id="16_va1ks"]
[ext_resource type="Texture2D" uid="uid://dn8vx333yunpe" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/steam-deck/steamdeck_button_y_outline.tres" id="17_vbsy4"]
[ext_resource type="Texture2D" uid="uid://b2f4prnfhd1k1" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/steam-deck/steamdeck_button_b_outline.tres" id="18_otkfu"]
[ext_resource type="Texture2D" uid="uid://jp3e3lyaan40" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/steam-deck/steamdeck_button_r2_outline.tres" id="19_c7evk"]

[sub_resource type="Resource" id="Resource_domy7"]
script = ExtResource("4_3qkoy")
Expand All @@ -35,4 +42,11 @@ metadata/_custom_type_script = "uid://dhgm1dl0ohox5"
script = ExtResource("1_aumst")
move = SubResource("Resource_wb6ss")
aim = SubResource("Resource_domy7")
running = ExtResource("14_hxnoe")
interact = ExtResource("7_wb6ss")
repel = ExtResource("13_enqan")
throw = ExtResource("19_c7evk")
sokoban_undo = ExtResource("18_otkfu")
sokoban_reset = ExtResource("16_va1ks")
sokoban_skip = ExtResource("17_vbsy4")
metadata/_custom_type_script = "uid://c0haweg5svww1"
14 changes: 14 additions & 0 deletions scenes/game_elements/props/hint/resources/switch.tres
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
[ext_resource type="Texture2D" uid="uid://bk5kfa10mmwlb" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/nintendo_switch/switch_stick_r.tres" id="5_3yvyh"]
[ext_resource type="Texture2D" uid="uid://cbfuj8bkq6seu" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/nintendo_switch/switch_dpad_up_outline.tres" id="5_mujfa"]
[ext_resource type="Texture2D" uid="uid://cnnufqepabnm2" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/nintendo_switch/switch_stick_r_up.tres" id="6_0s2bm"]
[ext_resource type="Texture2D" uid="uid://cw4b0a55wdndp" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/nintendo_switch/switch_button_b_outline.tres" id="7_nqwbi"]
[ext_resource type="Texture2D" uid="uid://cren16wfvch5p" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/nintendo_switch/switch_button_r_outline.tres" id="13_x12kq"]
[ext_resource type="Texture2D" uid="uid://bfestobnif7sl" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/nintendo_switch/switch_button_l_outline.tres" id="14_lbflk"]
[ext_resource type="Texture2D" uid="uid://bkeqno6623dcj" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/nintendo_switch/switch_button_y_outline.tres" id="16_yfmui"]
[ext_resource type="Texture2D" uid="uid://cdgyk384ou7gp" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/nintendo_switch/switch_button_x_outline.tres" id="17_buody"]
[ext_resource type="Texture2D" uid="uid://bxvdat8x7qdm0" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/nintendo_switch/switch_button_a_outline.tres" id="18_poutv"]
[ext_resource type="Texture2D" uid="uid://dawyfturb2nwq" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/nintendo_switch/switch_button_zr_outline.tres" id="19_h0ie6"]

[sub_resource type="Resource" id="Resource_mv42c"]
script = ExtResource("4_56m3b")
Expand All @@ -34,4 +41,11 @@ right = ExtResource("3_c5mv4")
script = ExtResource("1_feeyu")
move = SubResource("Resource_c5mv4")
aim = SubResource("Resource_mv42c")
running = ExtResource("14_lbflk")
interact = ExtResource("7_nqwbi")
repel = ExtResource("13_x12kq")
throw = ExtResource("19_h0ie6")
sokoban_undo = ExtResource("18_poutv")
sokoban_reset = ExtResource("16_yfmui")
sokoban_skip = ExtResource("17_buody")
metadata/_custom_type_script = "uid://c0haweg5svww1"
14 changes: 14 additions & 0 deletions scenes/game_elements/props/hint/resources/xbox.tres
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
[ext_resource type="Texture2D" uid="uid://ci1j0k8leqa3o" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/xbox/xbox_stick_r.tres" id="5_g15f5"]
[ext_resource type="Texture2D" uid="uid://bcwquyrkyor4j" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/xbox/xbox_dpad_up_outline.tres" id="5_kariy"]
[ext_resource type="Texture2D" uid="uid://b45ky4pi3jety" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/xbox/xbox_stick_r_up.tres" id="6_tv03i"]
[ext_resource type="Texture2D" uid="uid://csbx81u4w37rp" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/xbox/xbox_button_a_outline.tres" id="7_tskv1"]
[ext_resource type="Texture2D" uid="uid://m1fgpc7ru2b5" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/xbox/xbox_rb_outline.tres" id="13_fvgft"]
[ext_resource type="Texture2D" uid="uid://dvkwc3688asij" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/xbox/xbox_lb_outline.tres" id="14_pukp1"]
[ext_resource type="Texture2D" uid="uid://b8oqqn2re8bb4" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/xbox/xbox_button_x_outline.tres" id="16_5vyqi"]
[ext_resource type="Texture2D" uid="uid://dk1g11haycllj" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/xbox/xbox_button_y_outline.tres" id="17_snkap"]
[ext_resource type="Texture2D" uid="uid://cpafwyrjkngt3" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/xbox/xbox_button_b_outline.tres" id="18_0iss4"]
[ext_resource type="Texture2D" uid="uid://bowdggq0c1ir4" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/xbox/xbox_rt_outline.tres" id="19_21ad5"]

[sub_resource type="Resource" id="Resource_cci5c"]
script = ExtResource("1_qwpf8")
Expand All @@ -34,4 +41,11 @@ right = ExtResource("3_nh82o")
script = ExtResource("1_bisyu")
move = SubResource("Resource_qwpf8")
aim = SubResource("Resource_cci5c")
running = ExtResource("14_pukp1")
interact = ExtResource("7_tskv1")
repel = ExtResource("13_fvgft")
throw = ExtResource("19_21ad5")
sokoban_undo = ExtResource("18_0iss4")
sokoban_reset = ExtResource("16_5vyqi")
sokoban_skip = ExtResource("17_snkap")
metadata/_custom_type_script = "uid://c0haweg5svww1"
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
[ext_resource type="Resource" uid="uid://dl6n1ifa5ktnp" path="res://scenes/quests/story_quests/champ/3_stealth/stealth_components/champ_incomplete_stealth_movement_hint.dialogue" id="28_fqjr6"]
[ext_resource type="PackedScene" uid="uid://drew54gcfpekn" path="res://scenes/quests/story_quests/champ/3_stealth/stealth_components/champ_water_rock/champ_water_rock.tscn" id="29_rik0t"]
[ext_resource type="Script" uid="uid://cbj0406q05dly" path="res://scenes/game_elements/props/hint/input_key/interact_input.gd" id="30_nyycj"]
[ext_resource type="Texture2D" uid="uid://c63g4rx3fvw4o" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_c_outline.tres" id="31_8k5n0"]
[ext_resource type="Texture2D" uid="uid://djen1whwwin1w" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_f_outline.tres" id="33_1n21b"]
[ext_resource type="Resource" uid="uid://bmharix12w26t" path="res://scenes/quests/story_quests/champ/3_stealth/stealth_components/champ_blink.dialogue" id="34_g76pt"]
[ext_resource type="Texture2D" uid="uid://djen1whwwin1w" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_f_outline.tres" id="37_yfmpo"]
[ext_resource type="Texture2D" uid="uid://c63g4rx3fvw4o" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_c_outline.tres" id="38_wbd51"]
[ext_resource type="Texture2D" uid="uid://h606ovawbm0x" path="res://scenes/quests/story_quests/champ/3_stealth/stealth_components/BlinkMarker.png" id="44_onp74"]
[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="46_8k5n0"]
[ext_resource type="Resource" uid="uid://cxjgjjb44ssnm" path="res://scenes/quests/story_quests/champ/3_stealth/stealth_components/champ_walking_on_water.dialogue" id="55_rosy4"]
Expand Down Expand Up @@ -1752,7 +1752,7 @@ layout_mode = 2

[node name="Interaction_hint" type="TextureRect" parent="ScreenOverlay/Hint/Blink_Hint" unique_id=207495647]
layout_mode = 2
texture = ExtResource("38_wbd51")
texture = ExtResource("31_8k5n0")
script = ExtResource("30_nyycj")
action_name = &"champ_blink"

Expand All @@ -1765,7 +1765,7 @@ layout_mode = 2

[node name="Water_hint" type="TextureRect" parent="ScreenOverlay/Hint/walking_on_water" unique_id=506122502]
layout_mode = 2
texture = ExtResource("37_yfmpo")
texture = ExtResource("33_1n21b")
script = ExtResource("30_nyycj")
action_name = &"champ_walk_on_water"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
extends VideoStreamPlayer

func _input(event):
if event.is_action_pressed("ui_select"):
get_tree().change_scene_to_file("res://scenes/quests/story_quests/shjourney/1_IntroAnimacion/SleepingBros.tscn")
if event.is_action_pressed(&"interact"):
SceneSwitcher.change_to_file(
"res://scenes/quests/story_quests/shjourney/1_IntroAnimacion/SleepingBros.tscn"
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
extends AnimatedSprite2D

func _input(event):
if event.is_action_pressed("ui_select"):
get_tree().change_scene_to_file("res://scenes/quests/story_quests/shjourney/2_shjourney_intro/template_intro.tscn")
if event.is_action_pressed("interact"):
SceneSwitcher.change_to_file("res://scenes/quests/story_quests/shjourney/2_shjourney_intro/template_intro.tscn")
Loading
Loading