Improved UI

This commit is contained in:
Eduard Urbach 2024-02-12 12:38:31 +01:00
parent 019d382abd
commit d8d0c690bd
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
4 changed files with 43 additions and 27 deletions

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=14 format=3 uid="uid://dagn5bf7ou3sd"]
[gd_scene load_steps=15 format=3 uid="uid://dagn5bf7ou3sd"]
[ext_resource type="PackedScene" uid="uid://cch67vqpsmtej" path="res://ui/debug/DebugLabel.tscn" id="1_7s8uu"]
[ext_resource type="Script" path="res://ui/UI.gd" id="1_l5b6o"]
@ -7,6 +7,7 @@
[ext_resource type="Script" path="res://ui/debug/PositionLabel.gd" id="4_beqf6"]
[ext_resource type="Script" path="res://ui/debug/VelocityLabel.gd" id="5_8lm6a"]
[ext_resource type="Script" path="res://ui/chat/ChatBox.gd" id="5_43juw"]
[ext_resource type="Script" path="res://ui/debug/PerformanceLabel.gd" id="5_ab7ln"]
[ext_resource type="Script" path="res://ui/chat/ChatInput.gd" id="6_cg2h5"]
[ext_resource type="Script" path="res://ui/debug/UploadLabel.gd" id="7_cfnpx"]
[ext_resource type="Script" path="res://ui/debug/DownloadLabel.gd" id="8_ogt38"]
@ -32,6 +33,14 @@ layout_mode = 2
layout_mode = 2
script = ExtResource("2_i200p")
[node name="Frame" parent="Canvas/TopLeft/VBoxContainer" instance=ExtResource("1_7s8uu")]
layout_mode = 2
script = ExtResource("5_ab7ln")
monitor = 1
multiply = 1000.0
precision = 0.1
suffix = " ms"
[node name="Ping" parent="Canvas/TopLeft/VBoxContainer" instance=ExtResource("1_7s8uu")]
layout_mode = 2
script = ExtResource("3_xjdws")

View File

@ -1,6 +1,9 @@
extends DebugLabel
@export var monitor: Performance.Monitor
@export var multiply := 1.0
@export var precision := 0.1
@export var suffix := ""
func _process(_delta):
text = str(Performance.get_monitor(monitor))
text = str(snapped(Performance.get_monitor(monitor) * multiply, precision)) + suffix

View File

@ -1,15 +1,4 @@
extends OptionButton
func on_item_selected(index: int):
match index:
0:
preset_low()
1:
preset_medium()
2:
preset_high()
get_tree().call_group("video_preset_setting", "_ready")
extends Node
func preset_low():
get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_BILINEAR
@ -20,6 +9,7 @@ func preset_low():
Global.environment.volumetric_fog_enabled = false
Global.camera_attributes.dof_blur_far_enabled = false
Global.camera_attributes.dof_blur_near_enabled = false
get_tree().call_group("video_preset_setting", "_ready")
func preset_medium():
get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR2
@ -30,6 +20,7 @@ func preset_medium():
Global.environment.volumetric_fog_enabled = false
Global.camera_attributes.dof_blur_far_enabled = false
Global.camera_attributes.dof_blur_near_enabled = false
get_tree().call_group("video_preset_setting", "_ready")
func preset_high():
get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR2
@ -40,3 +31,4 @@ func preset_high():
Global.environment.volumetric_fog_enabled = true
Global.camera_attributes.dof_blur_far_enabled = true
Global.camera_attributes.dof_blur_near_enabled = true
get_tree().call_group("video_preset_setting", "_ready")

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://bqpbrju7mc7d5"]
[gd_scene load_steps=14 format=3 uid="uid://bqpbrju7mc7d5"]
[ext_resource type="Script" path="res://ui/settings/Settings.gd" id="1_gx3lf"]
[ext_resource type="Script" path="res://ui/settings/Glow.gd" id="1_vkhbt"]
@ -12,6 +12,7 @@
[ext_resource type="Script" path="res://ui/settings/SSIL.gd" id="7_wt6tg"]
[ext_resource type="Script" path="res://ui/settings/Contrast.gd" id="8_q4hif"]
[ext_resource type="Script" path="res://ui/settings/Saturation.gd" id="9_wbvcu"]
[ext_resource type="Script" path="res://ui/settings/VolumetricFog.gd" id="10_enf67"]
[node name="Settings" type="Control"]
layout_mode = 3
@ -47,17 +48,26 @@ size_flags_horizontal = 3
text = "Preset:"
script = ExtResource("2_72a3s")
[node name="OptionButton" type="OptionButton" parent="TabContainer/Video/VBoxContainer/Preset"]
[node name="HBoxContainer" type="HBoxContainer" parent="TabContainer/Video/VBoxContainer/Preset"]
layout_mode = 2
size_flags_horizontal = 3
item_count = 3
selected = 2
popup/item_0/text = "Low"
popup/item_0/id = 0
popup/item_1/text = "Medium"
popup/item_1/id = 1
popup/item_2/text = "High"
popup/item_2/id = 2
[node name="Low" type="Button" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Low"
[node name="Medium" type="Button" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Medium"
[node name="High" type="Button" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "High"
[node name="Preset" type="Node" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer"]
script = ExtResource("3_6lki0")
[node name="Render Scale" type="HBoxContainer" parent="TabContainer/Video/VBoxContainer"]
@ -181,7 +191,7 @@ script = ExtResource("2_72a3s")
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/Volumetric Fog" groups=["video_preset_setting"]]
layout_mode = 2
size_flags_horizontal = 3
script = ExtResource("7_wt6tg")
script = ExtResource("10_enf67")
[node name="Brightness" type="HBoxContainer" parent="TabContainer/Video/VBoxContainer"]
custom_minimum_size = Vector2(0, 32)
@ -244,7 +254,9 @@ layout_mode = 2
[node name="Volume" type="HSlider" parent="TabContainer/Audio"]
layout_mode = 2
[connection signal="item_selected" from="TabContainer/Video/VBoxContainer/Preset/OptionButton" to="TabContainer/Video/VBoxContainer/Preset/OptionButton" method="on_item_selected"]
[connection signal="pressed" from="TabContainer/Video/VBoxContainer/Preset/HBoxContainer/Low" to="TabContainer/Video/VBoxContainer/Preset/HBoxContainer/Preset" method="preset_low"]
[connection signal="pressed" from="TabContainer/Video/VBoxContainer/Preset/HBoxContainer/Medium" to="TabContainer/Video/VBoxContainer/Preset/HBoxContainer/Preset" method="preset_medium"]
[connection signal="pressed" from="TabContainer/Video/VBoxContainer/Preset/HBoxContainer/High" to="TabContainer/Video/VBoxContainer/Preset/HBoxContainer/Preset" method="preset_high"]
[connection signal="item_selected" from="TabContainer/Video/VBoxContainer/Render Scale/OptionButton" to="TabContainer/Video/VBoxContainer/Render Scale/OptionButton" method="on_item_selected"]
[connection signal="item_selected" from="TabContainer/Video/VBoxContainer/Scale Mode/OptionButton" to="TabContainer/Video/VBoxContainer/Scale Mode/OptionButton" method="on_item_selected"]
[connection signal="toggled" from="TabContainer/Video/VBoxContainer/Glow/CheckButton" to="TabContainer/Video/VBoxContainer/Glow/CheckButton" method="on_toggled"]