2024-09-27 20:02:28 +00:00
[gd_scene load_steps=3 format=3 uid="uid://gmxenhavh1lp"]
2025-03-23 13:20:50 +00:00
[ext_resource type="Script" uid="uid://16y8yg750rxm" path="res://logic-scenes/main menu/video_settings.gd" id="1_sii8g"]
2024-09-27 20:02:28 +00:00
[sub_resource type="GDScript" id="GDScript_24hb5"]
script/source = "@tool
extends SpinBox
func reset():
value = 1
var normal_stylebox:StyleBoxFlat = get_line_edit().get_theme_stylebox(\"normal\")
var focus_stylebox:StyleBoxFlat
var edit_stylebox:StyleBoxFlat
@export var hold_down_delay: float = 0.5
@export var repeat_delay: float = 0.1
@export_range(1, 100) var repeat_multiplier: int = 1
@export var pressed: bool = false:
set(value):
pressed = value
if pressed:
prefix = \"<\"
suffix = \">\"
get_line_edit().add_theme_stylebox_override(\"normal\", edit_stylebox)
else:
prefix = \" \"
suffix = \" \"
get_line_edit().add_theme_stylebox_override(\"normal\", focus_stylebox)
func _ready() -> void:
edit_stylebox = normal_stylebox.duplicate(true)
edit_stylebox.bg_color = Color(\"#022635\")
focus_stylebox = normal_stylebox.duplicate(true)
focus_stylebox.border_width_bottom = 2
focus_stylebox.border_width_left = 2
focus_stylebox.border_width_right = 2
focus_stylebox.border_width_top = 2
focus_stylebox.border_color = Color.WHITE
focus_entered.connect(_on_focus_enter)
focus_exited.connect(_on_focus_exit)
func _input(event: InputEvent) -> void:
if has_focus():
2025-03-24 16:17:25 +00:00
if event.is_action_pressed(\"ui_accept\"):
2024-09-27 20:02:28 +00:00
pressed = not pressed
get_viewport().set_input_as_handled()
if pressed:
2025-03-24 16:17:25 +00:00
grab_focus()
#
if event.is_action_pressed(\"ui_up\") or event.is_action_pressed(\"ui_right\"):
2024-09-27 20:02:28 +00:00
value += step
2025-03-24 16:17:25 +00:00
call_deferred(\"check_input_held\", true)
2024-09-27 20:02:28 +00:00
2025-03-24 16:17:25 +00:00
elif event.is_action_pressed(\"ui_down\", true) or event.is_action_pressed(\"ui_left\", true):
2024-09-27 20:02:28 +00:00
value -= step
2025-03-24 16:17:25 +00:00
call_deferred(\"check_input_held\", false)
get_viewport().set_input_as_handled()
2024-09-27 20:02:28 +00:00
func _on_focus_enter():
get_line_edit().add_theme_stylebox_override(\"normal\", focus_stylebox)
func _on_focus_exit():
get_line_edit().remove_theme_stylebox_override(\"normal\")
2025-03-24 16:17:25 +00:00
func check_input_held(upward: bool):
await(get_tree().create_timer(repeat_delay).timeout)
while ((Input.is_action_pressed(\"ui_up\", true) or Input.is_action_pressed(\"ui_right\", true) and upward) or (Input.is_action_pressed(\"ui_down\", true) or Input.is_action_pressed(\"ui_left\", true) and not upward)):
value += step * repeat_multiplier * (1 if upward else -1)
await(get_tree().create_timer(repeat_delay).timeout)
2024-09-27 20:02:28 +00:00
"
2024-10-01 23:32:59 +00:00
[node name="Video Settings" type="VBoxContainer"]
2024-09-27 20:02:28 +00:00
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_sii8g")
2024-10-01 23:32:59 +00:00
[node name="Label" type="Label" parent="."]
2024-09-27 20:02:28 +00:00
layout_mode = 2
theme_type_variation = &"HeaderLarge"
text = "Video Settings"
2024-10-01 23:32:59 +00:00
[node name="GridContainer" type="GridContainer" parent="."]
2024-09-27 20:02:28 +00:00
layout_mode = 2
columns = 2
2024-10-01 23:32:59 +00:00
[node name="General" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
theme_type_variation = &"HeaderMedium"
text = "General"
2024-10-01 23:32:59 +00:00
[node name="HSeparator" type="HSeparator" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
2024-10-01 23:32:59 +00:00
[node name="Preset" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "apply preset"
2024-10-01 23:32:59 +00:00
[node name="HBoxContainer2" type="HBoxContainer" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
2024-10-01 23:32:59 +00:00
[node name="PerformancePreset" type="Button" parent="GridContainer/HBoxContainer2"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
text = "Performance"
2024-10-01 23:32:59 +00:00
[node name="BalancedPreset" type="Button" parent="GridContainer/HBoxContainer2"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
text = "Balanced"
2024-10-01 23:32:59 +00:00
[node name="QualityPreset" type="Button" parent="GridContainer/HBoxContainer2"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
text = "Quality"
2024-10-01 23:32:59 +00:00
[node name="Label" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "Fulscreen Mode"
2024-10-01 23:32:59 +00:00
[node name="FullscreenMode" type="OptionButton" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
selected = 1
item_count = 3
popup/item_0/text = "Windowed"
2025-03-24 16:17:25 +00:00
popup/item_0/id = 0
2024-09-27 20:02:28 +00:00
popup/item_1/text = "Fullscreen"
popup/item_1/id = 1
popup/item_2/text = "exclusive Fullscreen"
popup/item_2/id = 2
2024-10-01 23:32:59 +00:00
[node name="Scale_Label" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "Rendering Scale"
2024-10-01 23:32:59 +00:00
[node name="HBoxContainer" type="HBoxContainer" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
2024-10-01 23:32:59 +00:00
[node name="Button" type="Button" parent="GridContainer/HBoxContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "reset"
2024-10-01 23:32:59 +00:00
[node name="RenderScale" type="SpinBox" parent="GridContainer/HBoxContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
2025-03-24 16:17:25 +00:00
custom_minimum_size = Vector2(120, 0)
2024-09-27 20:02:28 +00:00
layout_mode = 2
focus_mode = 2
min_value = 0.25
max_value = 2.0
step = 0.05
value = 1.0
prefix = " "
suffix = " "
custom_arrow_step = 0.25
select_all_on_focus = true
script = SubResource("GDScript_24hb5")
2024-10-01 23:32:59 +00:00
[node name="Label3" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "Super Resolution"
2024-10-01 23:32:59 +00:00
[node name="SuperResolution" type="OptionButton" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
selected = 0
item_count = 3
popup/item_0/text = "disabled"
2025-03-24 16:17:25 +00:00
popup/item_0/id = 0
2025-05-10 13:23:58 +00:00
popup/item_1/text = "FSR 1.0"
2024-09-27 20:02:28 +00:00
popup/item_1/id = 1
popup/item_2/text = "FSR 2.2"
popup/item_2/id = 2
2024-10-01 23:32:59 +00:00
[node name="EnableFps" type="CheckBox" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
text = "limit FPS"
2024-10-01 23:32:59 +00:00
[node name="MaxFps" type="SpinBox" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
focus_mode = 2
min_value = 24.0
max_value = 144.0
value = 60.0
prefix = " "
suffix = " "
script = SubResource("GDScript_24hb5")
repeat_multiplier = 5
2024-10-01 23:32:59 +00:00
[node name="Rendering" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
theme_type_variation = &"HeaderMedium"
2024-10-01 23:32:59 +00:00
text = "Graphic Fidelity"
2024-09-27 20:02:28 +00:00
2024-10-01 23:32:59 +00:00
[node name="HSeparator2" type="HSeparator" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
2024-10-01 23:32:59 +00:00
[node name="Label4" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "Lighting Quality"
2024-10-01 23:32:59 +00:00
[node name="LightingQuality" type="OptionButton" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
selected = 1
item_count = 4
popup/item_0/text = "minimum"
2025-03-24 16:17:25 +00:00
popup/item_0/id = 0
2024-10-01 23:32:59 +00:00
popup/item_1/text = "low (SDF Global Illumination)"
2024-09-27 20:02:28 +00:00
popup/item_1/id = 1
2024-10-01 23:32:59 +00:00
popup/item_2/text = "medium (SDF and Screen Space Global Illumination)"
2024-09-27 20:02:28 +00:00
popup/item_2/id = 2
2024-10-01 23:32:59 +00:00
popup/item_3/text = "high (SDF and Screen Space Global Illumination)"
2024-09-27 20:02:28 +00:00
popup/item_3/id = 3
2024-10-01 23:32:59 +00:00
[node name="ShadowLabel" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "Shadow Quality"
2024-10-01 23:32:59 +00:00
[node name="ShadowQuality" type="OptionButton" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
selected = 1
item_count = 3
popup/item_0/text = "performance"
2025-03-24 16:17:25 +00:00
popup/item_0/id = 0
2024-09-27 20:02:28 +00:00
popup/item_1/text = "balanced"
popup/item_1/id = 1
popup/item_2/text = "quality"
popup/item_2/id = 2
2024-10-01 23:32:59 +00:00
[node name="FilterLabel" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "Texture Filtering"
2024-10-01 23:32:59 +00:00
[node name="TextureFiltering" type="OptionButton" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
selected = 1
item_count = 6
popup/item_0/text = "disabled"
2025-03-24 16:17:25 +00:00
popup/item_0/id = 0
2024-09-27 20:02:28 +00:00
popup/item_1/text = "1x (very fast)"
popup/item_1/id = 1
popup/item_2/text = "2x (fast)"
popup/item_2/id = 2
popup/item_3/text = "4x (average)"
popup/item_3/id = 3
popup/item_4/text = "8x (slow)"
popup/item_4/id = 4
popup/item_5/text = "16x (slowest)"
popup/item_5/id = 5
2024-10-01 23:32:59 +00:00
[node name="AlaisingLabel" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "Anti Aliasing"
2024-10-01 23:32:59 +00:00
[node name="AntiAlaising" type="OptionButton" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
selected = 1
item_count = 4
popup/item_0/text = "disabled"
2025-03-24 16:17:25 +00:00
popup/item_0/id = 0
2024-09-27 20:02:28 +00:00
popup/item_1/text = "2x MSAA"
popup/item_1/id = 1
popup/item_2/text = "4x MSAA"
popup/item_2/id = 2
popup/item_3/text = "8x MSAA"
popup/item_3/id = 3
2024-10-01 23:32:59 +00:00
[node name="SyncLabel" type="Label" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "v-Sync"
2024-10-01 23:32:59 +00:00
[node name="vSync" type="OptionButton" parent="GridContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
selected = 1
item_count = 4
popup/item_0/text = "disabled"
2025-03-24 16:17:25 +00:00
popup/item_0/id = 0
2024-09-27 20:02:28 +00:00
popup/item_1/text = "enabled"
popup/item_1/id = 1
popup/item_2/text = "adaptive"
popup/item_2/id = 2
popup/item_3/text = "Letterbox"
popup/item_3/id = 3
2024-10-01 23:32:59 +00:00
[node name="ExitButton" type="Button" parent="GridContainer"]
2024-09-27 22:34:54 +00:00
unique_name_in_owner = true
2024-09-27 20:02:28 +00:00
layout_mode = 2
2024-09-27 22:34:54 +00:00
text = "close"
2024-09-27 20:02:28 +00:00
2024-10-01 23:32:59 +00:00
[node name="ConfirmButton" type="Button" parent="GridContainer"]
2024-09-27 22:34:54 +00:00
unique_name_in_owner = true
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "save and apply"
2024-10-06 09:40:42 +00:00
[node name="Popup" type="Popup" parent="."]
2024-09-27 20:02:28 +00:00
initial_position = 2
size = Vector2i(546, 123)
2024-10-06 09:40:42 +00:00
[node name="VBoxContainer" type="VBoxContainer" parent="Popup"]
2024-09-27 20:02:28 +00:00
offset_left = 113.0
offset_right = 153.0
offset_bottom = 40.0
2024-10-06 09:40:42 +00:00
[node name="Label" type="Label" parent="Popup/VBoxContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
text = "Settings have been modified.
Do you really want to leave without saving?"
horizontal_alignment = 1
2024-10-06 09:40:42 +00:00
[node name="HBoxContainer" type="HBoxContainer" parent="Popup/VBoxContainer"]
2024-09-27 20:02:28 +00:00
layout_mode = 2
alignment = 1
2024-10-06 09:40:42 +00:00
[node name="ConfirmExit" type="Button" parent="Popup/VBoxContainer/HBoxContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
text = "leave"
2024-10-06 09:40:42 +00:00
[node name="ConfirmSave" type="Button" parent="Popup/VBoxContainer/HBoxContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
text = "save"
2024-10-06 09:40:42 +00:00
[node name="ConfirmAbort" type="Button" parent="Popup/VBoxContainer/HBoxContainer"]
2024-09-27 20:02:28 +00:00
unique_name_in_owner = true
layout_mode = 2
text = "abort"
2024-10-01 23:32:59 +00:00
[connection signal="pressed" from="GridContainer/HBoxContainer/Button" to="GridContainer/HBoxContainer/RenderScale" method="reset"]