From 5bc1c6e0f959690403d82774cb44eb117c184313 Mon Sep 17 00:00:00 2001 From: dingo Date: Mon, 19 Jan 2026 15:47:59 -0500 Subject: [PATCH] Player changes + projectile fixes2 --- project.godot | 2 +- scripts/ui/chat_ui.gd | 6 ++++-- scripts/ui/hub_ui.gd | 5 ++++- scripts/ui/hud.gd | 5 ++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/project.godot b/project.godot index 2d6d2ee..c65e4ab 100644 --- a/project.godot +++ b/project.godot @@ -150,7 +150,7 @@ stash={ } crafting={ "deadzone": 0.2, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":99,"location":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":88,"key_label":0,"unicode":120,"location":0,"echo":false,"script":null) ] } diff --git a/scripts/ui/chat_ui.gd b/scripts/ui/chat_ui.gd index d833fe7..975037e 100644 --- a/scripts/ui/chat_ui.gd +++ b/scripts/ui/chat_ui.gd @@ -32,9 +32,11 @@ func _connect_gamestate(): func _on_chat_message(sender: String, message: String, type: String): print("[ChatUI] _on_chat_message received - Sender: '%s', Message: '%s', Type: '%s'" % [sender, message, type]) - + _add_message(sender, message, type) - chat_messages_container.visible = true; + + # Show chat panel when a message is received + visible = true func _add_message(sender: String, message: String, type: String = "normal"): print("[ChatUI] Adding message to chat log") diff --git a/scripts/ui/hub_ui.gd b/scripts/ui/hub_ui.gd index f1263c2..660a0cf 100644 --- a/scripts/ui/hub_ui.gd +++ b/scripts/ui/hub_ui.gd @@ -252,7 +252,10 @@ func _toggle_settings_panel(): func _get_mobile_controls_enabled() -> bool: # Check if mobile controls are enabled (stored in config or default to true on mobile) - if OS.has_feature("mobile"): + # Detect touch-capable devices (mobile native or web on tablets/phones) + var is_touch_device = OS.has_feature("mobile") or DisplayServer.is_touchscreen_available() + + if is_touch_device: return ProjectSettings.get_setting("application/config/mobile_controls_enabled", true) return ProjectSettings.get_setting("application/config/mobile_controls_enabled", false) diff --git a/scripts/ui/hud.gd b/scripts/ui/hud.gd index 965cd69..b48cea1 100644 --- a/scripts/ui/hud.gd +++ b/scripts/ui/hud.gd @@ -425,7 +425,10 @@ func add_log_entry(text: String, color: Color): child.queue_free() func _get_mobile_controls_enabled() -> bool: - if OS.has_feature("mobile"): + # Check if we're on a touch-capable device (mobile native or web on tablets/phones) + var is_touch_device = OS.has_feature("mobile") or DisplayServer.is_touchscreen_available() + + if is_touch_device: return ProjectSettings.get_setting("application/config/mobile_controls_enabled", true) return ProjectSettings.get_setting("application/config/mobile_controls_enabled", false)