Skip to content

Commit 5af7901

Browse files
committed
fixup! InputHud: Allow custom built player
1 parent 5481bb5 commit 5af7901

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

scenes/ui_elements/input_hints/components/input_hud.gd

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,17 @@ func _on_scene_changed() -> void:
4343
if player:
4444
normal_controls.visible = true
4545

46-
if "player_interaction" in player:
47-
player_interaction = player.player_interaction as PlayerInteraction
48-
if player_interaction:
49-
player_interaction.can_interact_changed.connect(_update_player_state)
50-
51-
if "player_repel" in player:
52-
player_repel = player.player_repel as PlayerRepel
53-
if player_repel:
54-
player_repel.visibility_changed.connect(_update_player_state)
55-
56-
if "player_hook" in player:
57-
player_hook = player.player_hook as PlayerHook
58-
if player_hook:
59-
player_hook.visibility_changed.connect(_update_player_state)
46+
player_interaction = player.get("player_interaction") as PlayerInteraction
47+
if player_interaction:
48+
player_interaction.can_interact_changed.connect(_update_player_state)
49+
50+
player_repel = player.get("player_repel") as PlayerRepel
51+
if player_repel:
52+
player_repel.visibility_changed.connect(_update_player_state)
53+
54+
player_hook = player.get("player_hook") as PlayerHook
55+
if player_hook:
56+
player_hook.visibility_changed.connect(_update_player_state)
6057

6158
_update_player_state()
6259
elif sokoban_ruleset:

0 commit comments

Comments
 (0)