From ab16194c3975f09c775930e4b4b73d12cff8c2f6 Mon Sep 17 00:00:00 2001 From: Elrinth Date: Sun, 11 Jan 2026 14:26:22 +0100 Subject: [PATCH] fix chat ui --- src/export_presets.cfg | 71 ++++++++++++++++++++++++++++++++++++ src/scenes/chat_ui.tscn | 39 ++++++++------------ src/scripts/chat_ui.gd | 2 +- src/scripts/debug_overlay.gd | 16 ++++---- 4 files changed, 96 insertions(+), 32 deletions(-) create mode 100644 src/export_presets.cfg diff --git a/src/export_presets.cfg b/src/export_presets.cfg new file mode 100644 index 0000000..e5bccec --- /dev/null +++ b/src/export_presets.cfg @@ -0,0 +1,71 @@ +[preset.0] + +name="Windows Desktop" +platform="Windows Desktop" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../export/windows/game.exe" +patches=PackedStringArray() +patch_delta_encoding=false +patch_delta_compression_level_zstd=19 +patch_delta_min_reduction=0.1 +patch_delta_include_filters="*" +patch_delta_exclude_filters="" +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +shader_baker/enabled=false +binary_format/architecture="x86_64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +application/export_angle=0 +application/export_d3d12=0 +application/d3d12_agility_sdk_multiarch=true +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" diff --git a/src/scenes/chat_ui.tscn b/src/scenes/chat_ui.tscn index 642e936..a5d0b53 100644 --- a/src/scenes/chat_ui.tscn +++ b/src/scenes/chat_ui.tscn @@ -1,7 +1,7 @@ -[gd_scene format=3 uid="uid://chatui1234567"] +[gd_scene format=3 uid="uid://cpvi6t0yrunsu"] -[ext_resource type="Script" path="res://scripts/chat_ui.gd" id="1_chat_ui"] -[ext_resource type="FontFile" path="res://assets/fonts/Metropolis/TrueType/Metropolis-Regular.ttf" id="2_metropolis"] +[ext_resource type="Script" uid="uid://dxglerf7e7p5j" path="res://scripts/chat_ui.gd" id="1_chat_ui"] +[ext_resource type="FontFile" uid="uid://chp4isvj6x8bm" path="res://assets/fonts/Metropolis/TrueType/Metropolis-Regular.ttf" id="2_metropolis"] [sub_resource type="Theme" id="Theme_metropolis"] default_font = ExtResource("2_metropolis") @@ -11,7 +11,7 @@ default_font_size = 12 layer = 200 script = ExtResource("1_chat_ui") -[node name="ChatContainer" type="Control" parent="." unique_id=3000000000] +[node name="ChatContainer" type="Control" parent="." unique_id=-1294967296] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -20,12 +20,10 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 1 -[node name="BottomLeft" type="MarginContainer" parent="ChatContainer" unique_id=4000000000] +[node name="BottomLeft" type="MarginContainer" parent="ChatContainer" unique_id=-294967296] layout_mode = 1 -anchors_preset = 1 -anchor_left = 0.0 +anchors_preset = 2 anchor_top = 1.0 -anchor_right = 0.0 anchor_bottom = 1.0 offset_left = 10.0 offset_top = -200.0 @@ -34,33 +32,28 @@ offset_bottom = -10.0 grow_horizontal = 0 grow_vertical = 0 -[node name="Background" type="ColorRect" parent="ChatContainer/BottomLeft" unique_id=5000000000] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -color = Color(0, 0, 0, 0.5) -mouse_filter = 1 +[node name="Background" type="ColorRect" parent="ChatContainer/BottomLeft" unique_id=705032704] visible = false +layout_mode = 2 +mouse_filter = 1 +color = Color(0, 0, 0, 0.5) -[node name="VBox" type="VBoxContainer" parent="ChatContainer/BottomLeft" unique_id=6000000000] +[node name="VBox" type="VBoxContainer" parent="ChatContainer/BottomLeft" unique_id=1705032704] layout_mode = 2 -[node name="MessageScroll" type="ScrollContainer" parent="ChatContainer/BottomLeft/VBox" unique_id=7000000000] +[node name="MessageScroll" type="ScrollContainer" parent="ChatContainer/BottomLeft/VBox" unique_id=-1589934592] +custom_minimum_size = Vector2(380, 150) layout_mode = 2 size_flags_vertical = 3 -custom_minimum_size = Vector2(380, 150) -[node name="MessageList" type="VBoxContainer" parent="ChatContainer/BottomLeft/VBox/MessageScroll" unique_id=8000000000] +[node name="MessageList" type="VBoxContainer" parent="ChatContainer/BottomLeft/VBox/MessageScroll" unique_id=-589934592] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="ChatInput" type="LineEdit" parent="ChatContainer/BottomLeft/VBox" unique_id=10000000000] +[node name="ChatInput" type="LineEdit" parent="ChatContainer/BottomLeft/VBox" unique_id=1410065408] +visible = false layout_mode = 2 size_flags_horizontal = 3 theme = SubResource("Theme_metropolis") placeholder_text = "Type a message..." -visible = false diff --git a/src/scripts/chat_ui.gd b/src/scripts/chat_ui.gd index 526c6da..f031d86 100644 --- a/src/scripts/chat_ui.gd +++ b/src/scripts/chat_ui.gd @@ -117,7 +117,7 @@ func _send_and_close_chat(): # Update background visibility _update_background_visibility() -func _on_chat_input_submitted(text: String): +func _on_chat_input_submitted(_text: String): _send_and_close_chat() func _on_chat_input_focus_exited(): diff --git a/src/scripts/debug_overlay.gd b/src/scripts/debug_overlay.gd index 48d7797..67480a0 100644 --- a/src/scripts/debug_overlay.gd +++ b/src/scripts/debug_overlay.gd @@ -24,7 +24,7 @@ func _ready(): info_label.name = "InfoLabel" info_label.add_theme_color_override("font_color", Color.WHITE) info_label.add_theme_font_size_override("font_size", 20) - info_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT + info_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT # Text grows from right to left # Load standard_font.png as bitmap font var standard_font_resource = null @@ -35,13 +35,13 @@ func _ready(): add_child(info_label) - # Position in top right - info_label.anchor_left = 1.0 - info_label.anchor_right = 1.0 - info_label.offset_left = -200 - info_label.offset_right = -10 - info_label.offset_top = 10 - info_label.offset_bottom = 100 + # Anchor to top right corner - text grows from right to left + # set_anchors_preset automatically sets layout_mode to anchors + info_label.set_anchors_preset(Control.PRESET_TOP_RIGHT) + info_label.offset_left = -400 # Width of label (grows leftward) - increased for longer text like "CLIENT" and large IDs + info_label.offset_right = -10 # Right edge at 10px from screen edge + info_label.offset_top = 10 # Top edge at 10px from screen top + info_label.offset_bottom = 150 # Height of label - increased for multiple lines func _process(_delta): # Toggle debug with F3