From 4c4299a6df48384961d075b24e87e52f4cc73bf2 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Tue, 12 Aug 2025 21:42:43 -0700 Subject: [PATCH] options menu courtesy of noelle/pizzaperp --- Scenes/FreeRoam/Generic/Generic1Stage.tscn | 15 ++ Scenes/GUI/MainMenu.tscn | 209 ++++++++++++++++++++- Scripts/MainMenu.gd | 13 ++ Scripts/Player/player.gd | 4 + Scripts/globalvariables.gd | 44 +++++ Scripts/globalvariables.gd.uid | 1 + UI/options_panel.gd | 37 ++++ UI/options_panel.gd.uid | 1 + project.godot | 1 + 9 files changed, 322 insertions(+), 3 deletions(-) create mode 100644 Scripts/globalvariables.gd create mode 100644 Scripts/globalvariables.gd.uid create mode 100644 UI/options_panel.gd create mode 100644 UI/options_panel.gd.uid diff --git a/Scenes/FreeRoam/Generic/Generic1Stage.tscn b/Scenes/FreeRoam/Generic/Generic1Stage.tscn index b26b9f6..6c22054 100644 --- a/Scenes/FreeRoam/Generic/Generic1Stage.tscn +++ b/Scenes/FreeRoam/Generic/Generic1Stage.tscn @@ -50,90 +50,105 @@ environment = SubResource("Environment_0tsrs") transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 4, 3.5, 2) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D2" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -4, 3.5, 2) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D3" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 3.5, 2) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D4" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 6.86654, 3.5, 1.90623) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D5" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -7, 3.5, 2) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D6" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 4, 3.5, 11) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D7" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -4, 3.5, 11) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D8" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 3.5, 11) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D9" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 6.86654, 3.5, 10.9062) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D10" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -7, 3.5, 11) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D11" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 4, 3.5, 6.5) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D12" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -4, 3.5, 6.5) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D13" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 3.5, 6.5) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D14" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 6.86654, 3.5, 6.5) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="OmniLight3D15" type="SpotLight3D" parent="Room Lights"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -7, 3.5, 6.5) light_color = Color(1, 0.960784, 0.85098, 1) shadow_enabled = true +shadow_bias = 0.1 spot_angle = 80.0 [node name="Player" parent="." instance=ExtResource("14_ncqi6")] diff --git a/Scenes/GUI/MainMenu.tscn b/Scenes/GUI/MainMenu.tscn index 6dabf7b..08052dc 100644 --- a/Scenes/GUI/MainMenu.tscn +++ b/Scenes/GUI/MainMenu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=20 format=3 uid="uid://1ikkb4b8mw1w"] +[gd_scene load_steps=21 format=3 uid="uid://1ikkb4b8mw1w"] [ext_resource type="Theme" uid="uid://dbgs4id7y5d1c" path="res://UI/Themes/Dark.tres" id="1_dkd36"] [ext_resource type="Script" uid="uid://b5nh5td5bdsfd" path="res://Scripts/MainMenu.gd" id="1_ocgay"] @@ -7,6 +7,7 @@ [ext_resource type="Texture2D" uid="uid://dr6ir8mgbjrs7" path="res://UI/MenuBG/CStageBG.png" id="3_vaoig"] [ext_resource type="Texture2D" uid="uid://dyyyg85g3jwip" path="res://UI/MenuBG/ProtoRoadBG.png" id="4_dkd36"] [ext_resource type="Texture2D" uid="uid://cdp1csnrbd46w" path="res://UI/MenuBG/1StageBG.png" id="6_ha2rd"] +[ext_resource type="Script" uid="uid://c8dhm0nhxqlth" path="res://UI/options_panel.gd" id="8_wdeli"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_dkd36"] @@ -116,7 +117,7 @@ anchor_bottom = 1.0 offset_left = 60.0 offset_top = -380.0 offset_right = 324.0 -offset_bottom = -64.0 +offset_bottom = -11.0 grow_vertical = 0 [node name="EditorButton" type="Button" parent="Buttons"] @@ -170,12 +171,22 @@ focus_next = NodePath("../ExitButton") focus_previous = NodePath("../ControlsButton") text = "Credits" -[node name="ExitButton" type="Button" parent="Buttons"] +[node name="SettingsButton" type="Button" parent="Buttons"] layout_mode = 0 offset_left = 4.0 offset_top = 264.0 offset_right = 260.0 offset_bottom = 312.0 +focus_next = NodePath("../ExitButton") +focus_previous = NodePath("../ControlsButton") +text = "Settings" + +[node name="ExitButton" type="Button" parent="Buttons"] +layout_mode = 0 +offset_left = 4.0 +offset_top = 316.0 +offset_right = 260.0 +offset_bottom = 364.0 focus_next = NodePath("../EditorButton") focus_previous = NodePath("../CreditsButton") text = "Exit to Desktop" @@ -657,6 +668,192 @@ This project is not associated with CEC Entertainment LLC. or Creative Engineering Inc." horizontal_alignment = 1 +[node name="SettingsScreen" type="Control" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="ColorRect" type="ColorRect" parent="SettingsScreen"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0.121569, 0.121569, 0.121569, 0.501961) + +[node name="InputEater" type="Button" parent="SettingsScreen"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/focus = SubResource("StyleBoxEmpty_dkd36") +theme_override_styles/disabled_mirrored = SubResource("StyleBoxEmpty_ha2rd") +theme_override_styles/disabled = SubResource("StyleBoxEmpty_wdeli") +theme_override_styles/hover_pressed_mirrored = SubResource("StyleBoxEmpty_wyv1s") +theme_override_styles/hover_pressed = SubResource("StyleBoxEmpty_drn21") +theme_override_styles/hover_mirrored = SubResource("StyleBoxEmpty_pcbci") +theme_override_styles/hover = SubResource("StyleBoxEmpty_he4sq") +theme_override_styles/pressed_mirrored = SubResource("StyleBoxEmpty_rsjs4") +theme_override_styles/pressed = SubResource("StyleBoxEmpty_rj3vb") +theme_override_styles/normal_mirrored = SubResource("StyleBoxEmpty_pocyv") +theme_override_styles/normal = SubResource("StyleBoxEmpty_8uhic") + +[node name="DialogPanel" type="Panel" parent="SettingsScreen"] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.5 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = 64.0 +offset_right = -64.0 +offset_bottom = -64.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Label" type="Label" parent="SettingsScreen/DialogPanel"] +layout_mode = 1 +anchors_preset = -1 +anchor_right = 1.0 +offset_left = 8.0 +offset_top = 8.0 +offset_right = -8.0 +offset_bottom = 112.0 +grow_horizontal = 2 +text = "Settings" +label_settings = SubResource("LabelSettings_dkd36") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="TabBar" type="TabBar" parent="SettingsScreen/DialogPanel"] +layout_mode = 1 +anchors_preset = -1 +anchor_top = 0.173 +anchor_right = 1.019 +anchor_bottom = 0.252 +offset_left = -1.0 +offset_top = -3.41601 +offset_right = -10.0 +offset_bottom = -19.184 +grow_horizontal = 2 +grow_vertical = 2 +current_tab = 0 +tab_count = 1 +tab_0/title = "Graphics" + +[node name="GraphicsPanel" type="Panel" parent="SettingsScreen/DialogPanel"] +layout_mode = 1 +anchors_preset = -1 +anchor_top = 0.218 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = 0.944 +offset_right = 1.0 +offset_bottom = -2.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("8_wdeli") + +[node name="HBoxContainer" type="HBoxContainer" parent="SettingsScreen/DialogPanel/GraphicsPanel"] +layout_direction = 2 +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/separation = -25 + +[node name="labels" type="VBoxContainer" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer"] +custom_minimum_size = Vector2(180, 0) +layout_mode = 2 +theme_override_constants/separation = 15 + +[node name="antialiasing_msaa" type="Label" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/labels"] +layout_mode = 2 +text = "Antialiasing (MSAA):" +horizontal_alignment = 2 + +[node name="aa_screenspace" type="Label" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/labels"] +layout_mode = 2 +text = "Screenspace AA:" +horizontal_alignment = 2 + +[node name="FOV" type="Label" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/labels"] +layout_mode = 2 +text = "Field of View:" +horizontal_alignment = 2 + +[node name="settings" type="VBoxContainer" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +size_flags_horizontal = 6 + +[node name="option_aa_msaa" type="OptionButton" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings"] +layout_mode = 2 +alignment = 1 +selected = 1 +item_count = 4 +popup/item_0/text = "Disabled" +popup/item_0/id = 0 +popup/item_1/text = "2x" +popup/item_1/id = 1 +popup/item_2/text = "4x" +popup/item_2/id = 2 +popup/item_3/text = "8x" +popup/item_3/id = 3 + +[node name="option_aa_ss" type="OptionButton" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings"] +layout_mode = 2 +alignment = 1 +selected = 1 +item_count = 2 +popup/item_0/text = "Disabled" +popup/item_0/id = 0 +popup/item_1/text = "FXAA" +popup/item_1/id = 1 + +[node name="fov_slider" type="HSlider" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings"] +custom_minimum_size = Vector2(215, 0) +layout_mode = 2 +min_value = 60.0 +value = 60.0 +ticks_on_borders = true + +[node name="Label" type="Label" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings/fov_slider"] +layout_mode = 0 +offset_left = -2.0 +offset_top = 9.0 +offset_right = 38.0 +offset_bottom = 32.0 +text = "60" + +[node name="Label2" type="Label" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings/fov_slider"] +layout_mode = 0 +offset_left = 197.0 +offset_top = 8.0 +offset_right = 237.0 +offset_bottom = 31.0 +text = "100" + +[node name="Label3" type="Label" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings/fov_slider"] +layout_mode = 0 +offset_left = 87.0 +offset_top = 12.0 +offset_right = 127.0 +offset_bottom = 35.0 +text = "FOV" +horizontal_alignment = 1 + +[node name="spacer" type="Container" parent="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings"] +custom_minimum_size = Vector2(0, 18.18) +layout_mode = 2 + [node name="VersionLabel" type="Label" parent="."] layout_mode = 1 anchors_preset = -1 @@ -679,6 +876,7 @@ vertical_alignment = 1 [connection signal="pressed" from="Buttons/ModsButton" to="." method="_on_mods_button_pressed"] [connection signal="pressed" from="Buttons/ControlsButton" to="." method="_on_controls_button_pressed"] [connection signal="pressed" from="Buttons/CreditsButton" to="." method="_on_credits_button_pressed"] +[connection signal="pressed" from="Buttons/SettingsButton" to="." method="_on_settings_button_pressed"] [connection signal="pressed" from="Buttons/ExitButton" to="." method="_on_exit_button_pressed"] [connection signal="pressed" from="FreeRoamChooseScreen/InputEater" to="." method="_on_input_eater_pressed"] [connection signal="pressed" from="FreeRoamChooseScreen/DialogPanel/LoadMapButton" to="." method="_on_load_map_button_pressed"] @@ -687,3 +885,8 @@ vertical_alignment = 1 [connection signal="pressed" from="ModsScreen/DialogPanel/OpenFolderButton" to="." method="_on_open_folder_button_pressed"] [connection signal="pressed" from="ControlsScreen/InputEater" to="." method="_on_input_eater_pressed"] [connection signal="pressed" from="CreditsScreen/InputEater" to="." method="_on_input_eater_pressed"] +[connection signal="pressed" from="SettingsScreen/InputEater" to="." method="_on_input_eater_pressed"] +[connection signal="tab_changed" from="SettingsScreen/DialogPanel/TabBar" to="SettingsScreen/DialogPanel/GraphicsPanel" method="_on_tab_bar_tab_changed"] +[connection signal="item_selected" from="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings/option_aa_msaa" to="SettingsScreen/DialogPanel/GraphicsPanel" method="_on_option_aa_msaa_item_selected"] +[connection signal="item_selected" from="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings/option_aa_ss" to="SettingsScreen/DialogPanel/GraphicsPanel" method="_on_option_aa_ss_item_selected"] +[connection signal="value_changed" from="SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings/fov_slider" to="SettingsScreen/DialogPanel/GraphicsPanel" method="_on_fov_slider_value_changed"] diff --git a/Scripts/MainMenu.gd b/Scripts/MainMenu.gd index 51987d7..355b1fa 100644 --- a/Scripts/MainMenu.gd +++ b/Scripts/MainMenu.gd @@ -7,6 +7,13 @@ func _ready(): $Backgrounds.get_child(randi() % $Backgrounds.get_child_count()).visible = true $Buttons/EditorButton.grab_focus() + Globalvariables.loadConfig() + print(Globalvariables.FOV) + print(Globalvariables.msaa) + $SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings/fov_slider.value = Globalvariables.FOV + $SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings/option_aa_msaa.selected = Globalvariables.msaa + $SettingsScreen/DialogPanel/GraphicsPanel/HBoxContainer/settings/option_aa_ss.selected = Globalvariables.ssaa + var moddir = DirAccess.open("user://Mods") if moddir == null: print("Mod folder was not found. Creating.") @@ -41,6 +48,7 @@ func _on_button_pressed() -> void: get_tree().change_scene_to_file("res://Scenes/GUI/EditorScreen.tscn") func _on_exit_button_pressed() -> void: + Globalvariables.updateConfig() get_tree().quit() func _on_credits_button_pressed() -> void: @@ -55,11 +63,16 @@ func _on_free_roam_button_pressed() -> void: func _on_mods_button_pressed() -> void: $ModsScreen.visible = true +func _on_settings_button_pressed() -> void: + $SettingsScreen.visible = true + func _on_input_eater_pressed() -> void: + Globalvariables.updateConfig() $CreditsScreen.visible = false $ControlsScreen.visible = false $FreeRoamChooseScreen.visible = false $ModsScreen.visible = false + $SettingsScreen.visible = false func _input(event: InputEvent) -> void: if event.is_action_pressed("fullscreen"): diff --git a/Scripts/Player/player.gd b/Scripts/Player/player.gd index 4f06215..3dd7e01 100644 --- a/Scripts/Player/player.gd +++ b/Scripts/Player/player.gd @@ -63,6 +63,10 @@ func _unhandled_input(event: InputEvent) -> void: elif event.is_action_pressed(&"freeroam_debug_menu"): $DebugMenu.visible = !$DebugMenu.visible +func _process(delta: float) -> void: + if ($Camera.fov != Globalvariables.FOV): + $Camera.fov = Globalvariables.FOV + func _physics_process(delta: float) -> void: if (interact): if Input.is_action_just_pressed(&"freeroam_jump"): jumping = true diff --git a/Scripts/globalvariables.gd b/Scripts/globalvariables.gd new file mode 100644 index 0000000..4f64b3e --- /dev/null +++ b/Scripts/globalvariables.gd @@ -0,0 +1,44 @@ +extends Node + +var FOV = 80 +var config = ConfigFile.new() +var msaa = 1 +var ssaa = 1 + +func _ready() -> void: + msaa = get_viewport().msaa_3d + ssaa = get_viewport().screen_space_aa + +func updateConfig(): + msaa = get_viewport().msaa_3d + ssaa = get_viewport().screen_space_aa + config.set_value("GRAPHICS", "fov", FOV) + config.set_value("GRAPHICS", "msaa", msaa) + config.set_value("GRAPHICS", "ssaa", ssaa) + config.save("user://settings.cfg") + +func loadConfig(): + var err = config.load("user://settings.cfg") + print("loading config...") + if err != OK: + print("Couldn't load config!") + return + + FOV = config.get_value("GRAPHICS", "fov") + msaa = config.get_value("GRAPHICS", "msaa") + ssaa = config.get_value("GRAPHICS", "ssaa") + print("config loaded.") + + # set msaa + var index = msaa + if index == 0: # Disabled + get_viewport().msaa_3d = Viewport.MSAA_DISABLED + elif index == 1: # 2× + get_viewport().msaa_3d = Viewport.MSAA_2X + elif index == 2: # 4× + get_viewport().msaa_3d = Viewport.MSAA_4X + elif index == 3: # 8× + get_viewport().msaa_3d = Viewport.MSAA_8X + + # set ssaa + get_viewport().screen_space_aa = int(index == 1) as Viewport.ScreenSpaceAA diff --git a/Scripts/globalvariables.gd.uid b/Scripts/globalvariables.gd.uid new file mode 100644 index 0000000..da52a6c --- /dev/null +++ b/Scripts/globalvariables.gd.uid @@ -0,0 +1 @@ +uid://dfafaty8dlmgj diff --git a/UI/options_panel.gd b/UI/options_panel.gd new file mode 100644 index 0000000..5b2f888 --- /dev/null +++ b/UI/options_panel.gd @@ -0,0 +1,37 @@ +extends Panel + +@export var thisTab = 0 # The tab that must be active in the settings screen for the panel to appear. + +func _ready() -> void: + $HBoxContainer/settings/option_aa_msaa.selected = get_viewport().msaa_3d + $HBoxContainer/settings/option_aa_ss.selected = get_viewport().screen_space_aa + $HBoxContainer/settings/fov_slider.value = Globalvariables.FOV + +func _on_tab_bar_tab_changed(tab: int) -> void: + if (thisTab == tab): + self.show() + else: + self.hide() + +func updateconfig(): + Globalvariables.updateConfig() + +func _on_fov_slider_value_changed(value: float) -> void: + Globalvariables.FOV = value + $HBoxContainer/settings/fov_slider/Label3.text = str(int(value)) + + +func _on_option_aa_ss_item_selected(index: int) -> void: + get_viewport().screen_space_aa = int(index == 1) as Viewport.ScreenSpaceAA + + +func _on_option_aa_msaa_item_selected(index: int) -> void: + if index == 0: # Disabled + get_viewport().msaa_3d = Viewport.MSAA_DISABLED + elif index == 1: # 2× + get_viewport().msaa_3d = Viewport.MSAA_2X + elif index == 2: # 4× + get_viewport().msaa_3d = Viewport.MSAA_4X + elif index == 3: # 8× + get_viewport().msaa_3d = Viewport.MSAA_8X + diff --git a/UI/options_panel.gd.uid b/UI/options_panel.gd.uid new file mode 100644 index 0000000..d3a8b8f --- /dev/null +++ b/UI/options_panel.gd.uid @@ -0,0 +1 @@ +uid://c8dhm0nhxqlth diff --git a/project.godot b/project.godot index 412de36..ae2b51e 100644 --- a/project.godot +++ b/project.godot @@ -25,6 +25,7 @@ config/windows_native_icon="res://UI/icon.ico" Cosmetics="*res://Scripts/Configs/Cosmetics.gd" Stages="*res://Scripts/Configs/Stages.gd" FreeRoamMaps="*res://Scripts/Configs/FreeRoamMaps.gd" +Globalvariables="*res://Scripts/globalvariables.gd" [display]