diff options
author | tpart <tpart120@proton.me> | 2024-07-07 18:52:49 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-07-07 18:52:54 +0200 |
commit | 44499c6e81dc5cc014f502cf6cb4db0c96081d7e (patch) | |
tree | 7cf07ee27ba517d7d4766677cc367bd1f9a16fbd /client/global.gd | |
parent | a72f4466c568dd7d7fe6f76a295fdd1162c1d312 (diff) | |
download | hurrycurry-44499c6e81dc5cc014f502cf6cb4db0c96081d7e.tar hurrycurry-44499c6e81dc5cc014f502cf6cb4db0c96081d7e.tar.bz2 hurrycurry-44499c6e81dc5cc014f502cf6cb4db0c96081d7e.tar.zst |
Add lobby menu
Diffstat (limited to 'client/global.gd')
-rw-r--r-- | client/global.gd | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/client/global.gd b/client/global.gd index 2d0c0cb2..d50788ba 100644 --- a/client/global.gd +++ b/client/global.gd @@ -18,14 +18,15 @@ extends Node signal settings_changed() +signal using_joypad_change(using: bool) var default_profile := { "username": "Giovanni", "character": 0, "last_server_url": "" } - var languages := [tr("System default"), "en", "de"] +var using_joypad := false var default_settings := { "language": DropdownSetting.new(tr("Language"), 0, languages), @@ -63,12 +64,23 @@ func _ready(): get_viewport().gui_focus_changed.connect(Sound.play_hover_maybe) get_viewport().gui_focus_changed.connect(func (node): focused_node = node) + -func _input(_event): +func _input(event): if Input.is_action_just_pressed("fullscreen"): Global.set_setting("fullscreen", not Global.get_setting("fullscreen")) save_settings() update_fullscreen() + + # Update using_joypad variable + if event is InputEventMouseButton or event is InputEventKey: + if using_joypad: + using_joypad = false + using_joypad_change.emit(using_joypad) + elif event is InputEventJoypadButton or event is InputEventJoypadMotion: + if not using_joypad: + using_joypad = true + using_joypad_change.emit(using_joypad) func apply_settings(): update_fullscreen() |