From b6a83031f99812554e14570b9d340cc0907fbdff Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 16 Feb 2024 23:45:31 +0100 Subject: [PATCH] Improved UI --- client/ui/UI.tscn | 23 ++++++++++++++++++++--- client/ui/chat/ChatInput.gd | 7 +++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/client/ui/UI.tscn b/client/ui/UI.tscn index 063fad6..eb6bd6a 100644 --- a/client/ui/UI.tscn +++ b/client/ui/UI.tscn @@ -34,7 +34,7 @@ layout_mode = 2 layout_mode = 2 script = ExtResource("2_i200p") -[node name="Frame" parent="Canvas/TopLeft/VBoxContainer" instance=ExtResource("1_7s8uu")] +[node name="Process" parent="Canvas/TopLeft/VBoxContainer" instance=ExtResource("1_7s8uu")] layout_mode = 2 script = ExtResource("5_ab7ln") monitor = 1 @@ -42,9 +42,21 @@ multiply = 1000.0 precision = 0.1 suffix = " ms" -[node name="Ping" parent="Canvas/TopLeft/VBoxContainer" instance=ExtResource("1_7s8uu")] +[node name="Physics" parent="Canvas/TopLeft/VBoxContainer" instance=ExtResource("1_7s8uu")] layout_mode = 2 -script = ExtResource("3_xjdws") +script = ExtResource("5_ab7ln") +monitor = 2 +multiply = 1000.0 +precision = 0.1 +suffix = " ms" + +[node name="Draw calls" parent="Canvas/TopLeft/VBoxContainer" instance=ExtResource("1_7s8uu")] +layout_mode = 2 +script = ExtResource("5_ab7ln") +monitor = 13 +multiply = 1.0 +precision = 1.0 +suffix = "" [node name="BottomLeft" type="MarginContainer" parent="Canvas"] anchors_preset = 2 @@ -84,6 +96,11 @@ grow_vertical = 0 layout_mode = 2 alignment = 2 +[node name="Ping" parent="Canvas/BottomRight/VBoxContainer" instance=ExtResource("1_7s8uu")] +layout_mode = 2 +alignment = 2 +script = ExtResource("3_xjdws") + [node name="Send" parent="Canvas/BottomRight/VBoxContainer" instance=ExtResource("1_7s8uu")] layout_mode = 2 alignment = 2 diff --git a/client/ui/chat/ChatInput.gd b/client/ui/chat/ChatInput.gd index 2865279..b6123b4 100644 --- a/client/ui/chat/ChatInput.gd +++ b/client/ui/chat/ChatInput.gd @@ -1,5 +1,8 @@ extends LineEdit +func _ready(): + modulate.a = 0.0 + func _unhandled_input(event): if Global.interacting_with_ui: return @@ -9,9 +12,13 @@ func _unhandled_input(event): get_viewport().set_input_as_handled() func _on_focus_entered(): + var tween := get_tree().create_tween() + tween.tween_property(self, "modulate", Color(1, 1, 1, 1), 0.2) Global.interacting_with_ui = true func _on_focus_exited(): + var tween := get_tree().create_tween() + tween.tween_property(self, "modulate", Color(1, 1, 1, 0), 0.2) Global.interacting_with_ui = false func _on_text_submitted(message: String):