diff options
author | tpart <tpart120@proton.me> | 2024-07-12 01:12:51 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-07-12 01:12:51 +0200 |
commit | ca482a7b052883bd1d830a88d104bab366eeadeb (patch) | |
tree | 0d06c10b8c67d88f441c199d34f0bd93d65fdc58 | |
parent | f6f183a22bfc023130cb4d32a381f8804344c119 (diff) | |
download | hurrycurry-ca482a7b052883bd1d830a88d104bab366eeadeb.tar hurrycurry-ca482a7b052883bd1d830a88d104bab366eeadeb.tar.bz2 hurrycurry-ca482a7b052883bd1d830a88d104bab366eeadeb.tar.zst |
Only display relevant keybinding in hints
-rw-r--r-- | client/menu/popup_message.gd | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/client/menu/popup_message.gd b/client/menu/popup_message.gd index b4afbf3c..b3654416 100644 --- a/client/menu/popup_message.gd +++ b/client/menu/popup_message.gd @@ -58,12 +58,17 @@ func _input(_event): func _on_boost_timeout(): if not Global.get_profile("hint_boost_seen") and not Global.get_setting("touch_controls"): - display_hint_msg(tr("Press SHIFT/Controller B to boost")) + display_hint_msg(tr("Press %s to boost") % display_keybind(tr("SHIFT"), "B")) func _on_move_timeout(): if not Global.get_profile("hint_move_seen") and not Global.get_setting("touch_controls"): - display_hint_msg(tr("Use WASD/Controller left stick to move")) + display_hint_msg(tr("Use %s to move") % display_keybind("WASD", tr("left stick"))) func _on_interact_timeout(): if not Global.get_profile("hint_interact_seen") and not Global.get_setting("touch_controls"): - display_hint_msg(tr("Press SPACE/Controller A to pick up items and interact with tools")) + display_hint_msg(tr("Press %s to pick up items and interact with tools") % display_keybind(tr("SPACE"), "A")) + +func display_keybind(keyboard: String, joypad: String) -> String: + if Global.using_joypad: + return joypad + " (Joypad)" + return keyboard |