diff --git a/entities/components/match_participant_component.gd b/entities/components/match_participant_component.gd index 816ba11..2a450ee 100644 --- a/entities/components/match_participant_component.gd +++ b/entities/components/match_participant_component.gd @@ -3,24 +3,21 @@ class_name MatchParticipantComponent extends MultiplayerSynchronizer signal player_id_changed(new_player_id : int) signal nickname_changed(new_nickname : String) +@export var nickname : String = "": + set(value): + nickname = value + nickname_changed.emit(nickname) @export var player_id : int: set(value): player_id = value player_id_changed.emit(player_id) @export var team_id : int = 1 -@export var nickname : String = "": - set(value): - nickname = value - nickname_changed.emit(nickname) func _ready() -> void: - replication_config = SceneReplicationConfig.new() root_path = "." - - _set_replication_for(NodePath("player_id").get_as_property_path()) - _set_replication_for(NodePath("team_id").get_as_property_path()) - _set_replication_for(NodePath("nickname").get_as_property_path()) - -func _set_replication_for(property_node_path : NodePath) -> void: - replication_config.add_property(property_node_path) - replication_config.property_set_replication_mode(property_node_path, SceneReplicationConfig.REPLICATION_MODE_ON_CHANGE) + replication_config = SceneReplicationConfig.new() + for prop : String in ["player_id", "team_id", "nickname"]: + var prop_path : NodePath = NodePath(prop).get_as_property_path() + replication_config.add_property(prop_path) + replication_config.property_set_replication_mode( + prop_path, SceneReplicationConfig.REPLICATION_MODE_ON_CHANGE) diff --git a/entities/flag/flag.gd b/entities/flag/flag.gd index e8521a7..017fdbf 100644 --- a/entities/flag/flag.gd +++ b/entities/flag/flag.gd @@ -1,3 +1,17 @@ +# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . class_name Flag extends Node3D enum FlagState { FLAG_STATE_ON_STAND, FLAG_STATE_DROPPED, FLAG_STATE_TAKEN } diff --git a/entities/player/player.gd b/entities/player/player.gd index 81e7dd6..d39b20b 100644 --- a/entities/player/player.gd +++ b/entities/player/player.gd @@ -48,7 +48,6 @@ enum PlayerState { PLAYER_ALIVE, PLAYER_DEAD } @onready var spring_arm_height : float = $Smoothing/SpringArm3D.position.y @onready var _original_weapon_transform : Transform3D = weapon.transform @onready var tp_player : Vanguard = $Smoothing/ThirdPerson/PlayerMesh -@onready var _game_settings : Settings = get_node("/root/GlobalSettings") @onready var jetpack_particles : Array = $Smoothing/ThirdPerson/PlayerMesh/JetpackFX.get_children() @onready var match_participant_component : MatchParticipantComponent = $MatchParticipantComponent @@ -74,13 +73,13 @@ func _ready() -> void: input.jumped.connect(_jump) input.throwed_flag.connect(_throw_flag) - input.MOUSE_SENSITIVITY = _game_settings.mouse_sensitivity - input.inverted_y_axis = _game_settings.inverted_y_axis + input.MOUSE_SENSITIVITY = Settings.get_value("controls", "mouse_sensitivity") + input.inverted_y_axis = Settings.get_value("controls", "inverted_y_axis") func _setup_pawn(_new_player_id : int) -> void: if _is_pawn(): camera.current = true - camera.fov = _game_settings.fov + camera.fov = Settings.get_value("video", "fov") pawn_player = self # set the spring arm translation to be about head height level $Smoothing/SpringArm3D.transform = Transform3D().translated(Vector3(0, collision_shape.shape.height / 2, 0) * 0.9) @@ -154,7 +153,7 @@ func _process(_delta : float) -> void: if not _is_pawn(): tp_player.global_transform.basis = Basis.from_euler(Vector3(0.0, input.camera_rotation.x + PI, 0.0)) elif not %Inventory/SpaceGun/Mesh/AnimationPlayer.is_playing(): - %Inventory/SpaceGun/Mesh/AnimationPlayer.play("idle") + %Inventory/SpaceGun/Mesh/AnimationPlayer.play("idle") %SpringArm3D.global_transform.basis = Basis.from_euler(Vector3(input.camera_rotation.y, input.camera_rotation.x, 0.0)) func _physics_process(delta : float) -> void: diff --git a/entities/player/player_input.gd b/entities/player/player_input.gd index 520f7c4..0716d79 100644 --- a/entities/player/player_input.gd +++ b/entities/player/player_input.gd @@ -36,7 +36,6 @@ func update_multiplayer_authority(player_id : int) -> void: func _unhandled_input(event: InputEvent) -> void: var mouse_mode : Input.MouseMode = Input.get_mouse_mode() - # isolate mouse events if event is InputEventMouseMotion: if mouse_mode == Input.MOUSE_MODE_CAPTURED: @@ -44,14 +43,15 @@ func _unhandled_input(event: InputEvent) -> void: _update_camera(event.relative) func _update_camera(relative_motion : Vector2) -> void: - # clamp vertical rotation (head motion) + # reverse y axis if inverted_y_axis: relative_motion.y *= -1.0 + # clamp vertical rotation (head motion) camera_rotation.y -= relative_motion.y * MOUSE_SENSITIVITY / 100 - camera_rotation.y = clamp(camera_rotation.y, deg_to_rad(-90.0),deg_to_rad(90.0)) + camera_rotation.y = clamp(camera_rotation.y, deg_to_rad(-90.0), deg_to_rad(90.0)) # wrap horizontal rotation (to prevent accumulation) camera_rotation.x -= relative_motion.x * MOUSE_SENSITIVITY / 100 - camera_rotation.x = wrapf(camera_rotation.x, deg_to_rad(0.0),deg_to_rad(360.0)) + camera_rotation.x = wrapf(camera_rotation.x, deg_to_rad(0.0), deg_to_rad(360.0)) func _process(_delta : float) -> void: direction = Input.get_vector("left", "right", "forward", "backward") diff --git a/interfaces/hud/hud.tscn b/interfaces/hud/hud.tscn index d0f3493..7bed4de 100644 --- a/interfaces/hud/hud.tscn +++ b/interfaces/hud/hud.tscn @@ -4,7 +4,21 @@ [ext_resource type="StyleBox" uid="uid://bq7rjpm38pao7" path="res://interfaces/hud/vitals/health_foreground.tres" id="2_6ejsl"] [sub_resource type="GDScript" id="GDScript_2vxif"] -script/source = "class_name HUD extends CanvasLayer +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +class_name HUD extends CanvasLayer @export_category(\"Vitals\") @export var _health_bar : ProgressBar @@ -39,15 +53,15 @@ func _ready() -> void: # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(_delta : float) -> void: - - var velocity_xz : Vector3 = player.linear_velocity - velocity_xz.y = 0 - text = \"\" - text += \"fps: %s\\n\" % str(Engine.get_frames_per_second()) + text += \"fps: %d (%.2f mspf)\\n\" % [Engine.get_frames_per_second(), 1000.0 / Engine.get_frames_per_second()] text += \"position: %d, %d, %d\\n\" % [player.position.x, player.position.y, player.position.z] text += \"speed: %d km/h\\n\" % (player.linear_velocity.length() * 3.6) + var velocity_xz := Vector3(player.linear_velocity.x, 0., player.linear_velocity.z) text += \"speed_xz: %d km/h\\n\" % (velocity_xz.length() * 3.6) + var viewport_render_size : Vector2i = get_viewport().size * get_viewport().scaling_3d_scale + text += \"3D viewport resolution: %d × %d (%d%%)\\n\" \\ + % [viewport_render_size.x, viewport_render_size.y, round(get_viewport().scaling_3d_scale * 100)] " [sub_resource type="Shader" id="Shader_gaah5"] diff --git a/interfaces/menus/boot/boot.tscn b/interfaces/menus/boot/boot.tscn index 66fb986..f8a63d7 100644 --- a/interfaces/menus/boot/boot.tscn +++ b/interfaces/menus/boot/boot.tscn @@ -1,10 +1,24 @@ -[gd_scene load_steps=9 format=3 uid="uid://bjctlqvs33nqy"] +[gd_scene load_steps=28 format=3 uid="uid://bjctlqvs33nqy"] [ext_resource type="Texture2D" uid="uid://c1tjamjm8qjog" path="res://interfaces/menus/boot/background.webp" id="1_ph586"] [sub_resource type="GDScript" id="GDScript_jd8xf"] resource_name = "MainMenu" -script/source = "class_name BootMenu extends CanvasLayer +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +class_name BootMenu extends CanvasLayer signal start_demo @@ -12,31 +26,47 @@ func _on_demo_pressed() -> void: start_demo.emit() func _on_multiplayer_pressed() -> void: - _show_menu($Multiplayer) + $MultiplayerPanelContainer.hide() + $MultiplayerPanelContainer.tab_container.current_tab = 0 + $SettingsPanelContainer.hide() + $MainPanelContainer.hide() + $MultiplayerPanelContainer.show() func _on_settings_pressed() -> void: - _show_menu($Settings) + $MultiplayerPanelContainer.hide() + $MultiplayerPanelContainer.tab_container.current_tab = 0 + $SettingsPanelContainer.show() + $MainPanelContainer.hide() func _on_quit_pressed() -> void: get_tree().quit() func _on_main_menu_pressed() -> void: - _show_menu($Main) - -func _show_menu(menu : PanelContainer) -> void: - $Multiplayer.hide() - $Multiplayer.tab_container.current_tab = 0 - $Settings.hide() - $Settings.tab_container.current_tab = 0 - $Main.hide() - menu.show() + $MultiplayerPanelContainer.hide() + $MultiplayerPanelContainer.tab_container.current_tab = 0 + $SettingsPanelContainer.hide() + $MainPanelContainer.show() " [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_krqeq"] bg_color = Color(0.501961, 0.501961, 0.501961, 0.25098) [sub_resource type="GDScript" id="GDScript_tc1bm"] -script/source = "extends PanelContainer +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends PanelContainer const DEFAULT_HOST : String = \"localhost\" const DEFAULT_PORT : int = 9000 @@ -51,7 +81,7 @@ signal join_server(host : String, port : int) @onready var modal : Control = $Modal @onready var menu : CanvasLayer = get_parent() -@onready var game : Node3D = get_tree().current_scene +@onready var game : Node3D = get_tree().current_scene.get_node(\"/root/Game\") @onready var map_selector : OptionButton = %MapSelector @export var tab_container : TabContainer @@ -120,32 +150,897 @@ func _on_connection_failed() -> void: $Modal.hide() " -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ky5sv"] -bg_color = Color(0.5, 0.5, 0.5, 0.25) - [sub_resource type="GDScript" id="GDScript_gbnwv"] resource_name = "Settings" -script/source = "extends PanelContainer +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends PanelContainer -const WINDOW_MODE_OPTIONS = [DisplayServer.WINDOW_MODE_WINDOWED, DisplayServer.WINDOW_MODE_FULLSCREEN] +# Quality presets. -@onready var _game_settings : Settings = get_node(\"/root/GlobalSettings\") +func _on_very_low_preset_pressed() -> void: + %TAAOptionButton.selected = 0 + %MSAAOptionButton.selected = 0 + %FXAAOptionButton.selected = 0 + %ShadowSizeOptionButton.selected = 0 + %ShadowFilterOptionButton.selected = 0 + %MeshLODOptionButton.selected = 0 + %SDFGIOptionButton.selected = 0 + %GlowOptionButton.selected = 0 + %SSAOOptionButton.selected = 0 + %SSReflectionsOptionButton.selected = 0 + %SSILOptionButton.selected = 0 + %VolumetricFogOptionButton.selected = 0 + update_preset() -@export var tab_container : TabContainer +func _on_low_preset_pressed() -> void: + %TAAOptionButton.selected = 0 + %MSAAOptionButton.selected = 0 + %FXAAOptionButton.selected = 1 + %ShadowSizeOptionButton.selected = 1 + %ShadowFilterOptionButton.selected = 1 + %MeshLODOptionButton.selected = 1 + %SDFGIOptionButton.selected = 0 + %GlowOptionButton.selected = 0 + %SSAOOptionButton.selected = 0 + %SSReflectionsOptionButton.selected = 0 + %SSILOptionButton.selected = 0 + %VolumetricFogOptionButton.selected = 0 + update_preset() + + +func _on_medium_preset_pressed() -> void: + %TAAOptionButton.selected = 1 + %MSAAOptionButton.selected = 0 + %FXAAOptionButton.selected = 0 + %ShadowSizeOptionButton.selected = 2 + %ShadowFilterOptionButton.selected = 2 + %MeshLODOptionButton.selected = 1 + %SDFGIOptionButton.selected = 1 + %GlowOptionButton.selected = 1 + %SSAOOptionButton.selected = 1 + %SSReflectionsOptionButton.selected = 1 + %SSILOptionButton.selected = 0 + %VolumetricFogOptionButton.selected = 1 + update_preset() + + +func _on_high_preset_pressed() -> void: + %TAAOptionButton.selected = 1 + %MSAAOptionButton.selected = 0 + %FXAAOptionButton.selected = 0 + %ShadowSizeOptionButton.selected = 3 + %ShadowFilterOptionButton.selected = 3 + %MeshLODOptionButton.selected = 2 + %SDFGIOptionButton.selected = 1 + %GlowOptionButton.selected = 2 + %SSAOOptionButton.selected = 2 + %SSReflectionsOptionButton.selected = 2 + %SSILOptionButton.selected = 2 + %VolumetricFogOptionButton.selected = 2 + update_preset() + + +func _on_ultra_preset_pressed() -> void: + %TAAOptionButton.selected = 1 + %MSAAOptionButton.selected = 1 + %FXAAOptionButton.selected = 0 + %ShadowSizeOptionButton.selected = 4 + %ShadowFilterOptionButton.selected = 4 + %MeshLODOptionButton.selected = 3 + %SDFGIOptionButton.selected = 2 + %GlowOptionButton.selected = 2 + %SSAOOptionButton.selected = 3 + %SSReflectionsOptionButton.selected = 3 + %SSILOptionButton.selected = 3 + %VolumetricFogOptionButton.selected = 2 + update_preset() + + +func update_preset() -> void: + # Simulate options being manually selected to run their respective update code. + %TAAOptionButton.item_selected.emit(%TAAOptionButton.selected) + %MSAAOptionButton.item_selected.emit(%MSAAOptionButton.selected) + %FXAAOptionButton.item_selected.emit(%FXAAOptionButton.selected) + %ShadowSizeOptionButton.item_selected.emit(%ShadowSizeOptionButton.selected) + %ShadowFilterOptionButton.item_selected.emit(%ShadowFilterOptionButton.selected) + %MeshLODOptionButton.item_selected.emit(%MeshLODOptionButton.selected) + %SDFGIOptionButton.item_selected.emit(%SDFGIOptionButton.selected) + %GlowOptionButton.item_selected.emit(%GlowOptionButton.selected) + %SSAOOptionButton.item_selected.emit(%SSAOOptionButton.selected) + %SSReflectionsOptionButton.item_selected.emit(%SSReflectionsOptionButton.selected) + %SSILOptionButton.item_selected.emit(%SSILOptionButton.selected) + %VolumetricFogOptionButton.item_selected.emit(%VolumetricFogOptionButton.selected) + +func _on_apply_pressed() -> void: + Settings.apply() + +func _on_reset_pressed() -> void: + Settings.reset() + +func _on_close_pressed() -> void: + self.hide() + %MainPanelContainer.show() + +# Adjustment settings. + +#func _on_brightness_slider_value_changed(value: float) -> void: + ## This is a setting that is attached to the environment. + ## If your game requires you to change the environment, + ## then be sure to run this function again to make the setting effective. + ## The slider value is clamped between 0.5 and 4. + #world_environment.environment.set_adjustment_brightness(value) + +#func _on_contrast_slider_value_changed(value: float) -> void: + ## This is a setting that is attached to the environment. + ## If your game requires you to change the environment, + ## then be sure to run this function again to make the setting effective. + ## The slider value is clamped between 0.5 and 4. + #world_environment.environment.set_adjustment_contrast(value) + +#func _on_saturation_slider_value_changed(value: float) -> void: + ## This is a setting that is attached to the environment. + ## If your game requires you to change the environment, + ## then be sure to run this function again to make the setting effective. + ## The slider value is clamped between 0.5 and 10. + #world_environment.environment.set_adjustment_saturation(value) +" + +[sub_resource type="GDScript" id="GDScript_7votw"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton func _ready() -> void: - %FOVSpinBox.value = _game_settings.fov - %SensitivitySpinBox.value = _game_settings.mouse_sensitivity - var window_mode : int = 1 if _game_settings.fullscreen else 0 - %InvertedYCheckbox.button_pressed = _game_settings.inverted_y_axis - %WindowModeOptionButton.select(window_mode) + self.selected = Settings.get_value(\"ui\", \"scale\") + self.item_selected.emit(self.selected) -func _on_save_pressed() -> void: - _game_settings.fov = %FOVSpinBox.value - _game_settings.mouse_sensitivity = %SensitivitySpinBox.value - _game_settings.inverted_y_axis = %InvertedYCheckbox.button_pressed - _game_settings.fullscreen = %WindowModeOptionButton.selected == 1 - _game_settings.save_to_file() +func _on_item_selected(index: int) -> void: + Settings.set_value(\"ui\", \"scale\", clamp(index, 0, 2)) + # When the screen changes size, we need to update the 3D + # viewport quality setting. If we don't do this, the viewport will take + # the size from the main viewport. + var new_size := Vector2( + ProjectSettings.get_setting(&\"display/window/size/viewport_width\"), + ProjectSettings.get_setting(&\"display/window/size/viewport_height\") + ) + # compute new size + if index == 0: # Smaller (66%) + new_size *= 1.5 + elif index == 1: # Small (80%) + new_size *= 1.25 + elif index == 2: # Medium (100%) (default) + new_size *= 1. + elif index == 3: # Large (133%) + new_size *= .75 + elif index == 4: # Larger (200%) + new_size *= .5 + # update scale + get_tree().root.set_content_scale_size(new_size) +" + +[sub_resource type="GDScript" id="GDScript_ux54k"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends HBoxContainer + +@export var min_value : float = .1 +@export var max_value : float = 1. +@export var step : float = .01 + +func _ready() -> void: + var value : float = Settings.get_value(\"controls\", \"mouse_sensitivity\") + for control : Range in [$SpinBox, $Slider]: + control.min_value = min_value + control.max_value = max_value + control.step = step + control.value = value + _on_value_changed(value) + +func _on_value_changed(new_value : float) -> void: + Settings.set_value(\"controls\", \"mouse_sensitivity\", new_value) + +func _on_spin_box_value_changed(new_value : float) -> void: + _on_value_changed(new_value) + $Slider.value = new_value + +func _on_slider_value_changed(new_value : float) -> void: + _on_value_changed(new_value) + $SpinBox.value = new_value +" + +[sub_resource type="GDScript" id="GDScript_v5ux6"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends HBoxContainer + +@export var min_value : int = 70 +@export var max_value : int = 150 +@export var step : int = 1 + +func _ready() -> void: + var value : int = Settings.get_value(\"video\", \"fov\") + for control : Range in [$SpinBox, $Slider]: + control.min_value = min_value + control.max_value = max_value + control.step = step + control.value = value + _on_value_changed(value) + +func _on_value_changed(new_value : int) -> void: + Settings.set_value(\"video\", \"fov\", new_value) + +func _on_spin_box_value_changed(new_value : int) -> void: + _on_value_changed(new_value) + $Slider.value = new_value + +func _on_slider_value_changed(new_value : int) -> void: + _on_value_changed(new_value) + $SpinBox.value = new_value +" + +[sub_resource type="GDScript" id="GDScript_viqb1"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends HSlider + +func _ready() -> void: + self.value = Settings.get_value(\"video\", \"quality\") + self.value_changed.emit(self.value) + +func _on_value_changed(new_value : float) -> void: + Settings.set_value(\"video\", \"quality\", new_value) + get_viewport().scaling_3d_scale = new_value +" + +[sub_resource type="GDScript" id="GDScript_mnbe0"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"video\", \"filter\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index: int) -> void: + Settings.set_value(\"video\", \"filter\", index) + # Viewport scale mode setting. + if index == 0: # Bilinear (Fastest) + get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_BILINEAR + # FSR Sharpness is only effective when the scaling mode is FSR 1.0. + %FSRSharpnessLabel.visible = false + %FSRSharpnessSlider.visible = false + elif index == 1: # FSR 1.0 (Fast) + get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR + # FSR Sharpness is only effective when the scaling mode is FSR 1.0. + %FSRSharpnessLabel.visible = true + %FSRSharpnessSlider.visible = true +" + +[sub_resource type="GDScript" id="GDScript_c3ngv"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends HSlider + +func _ready() -> void: + self.value = Settings.get_value(\"video\", \"fsr_sharpness\") + self.value_changed.emit(self.value) + +func _on_value_changed(new_value : float) -> void: + Settings.set_value(\"video\", \"fsr_sharpness\", new_value) + # Lower FSR sharpness values result in a sharper image. + # Invert the slider so that higher values result in a sharper image, + # which is generally expected from users. + get_viewport().fsr_sharpness = 2.0 - new_value +" + +[sub_resource type="GDScript" id="GDScript_xa5kp"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"video\", \"window_mode\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index : int) -> void: + Settings.set_value(\"video\", \"window_mode\", clamp(index, 0, 2)) + if index == 0: # Windowed (default) + get_tree().root.set_mode(Window.MODE_WINDOWED) + elif index == 1: # Fullscreen + get_tree().root.set_mode(Window.MODE_FULLSCREEN) + elif index == 2: # Exclusive Fullscreen + get_tree().root.set_mode(Window.MODE_EXCLUSIVE_FULLSCREEN) +" + +[sub_resource type="GDScript" id="GDScript_jl1uk"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"video\", \"vsync\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index : int) -> void: + Settings.set_value(\"video\", \"vsync\", index) + # Vsync is enabled by default. + # Vertical synchronization locks framerate and makes screen tearing not visible at the cost of + # higher input latency and stuttering when the framerate target is not met. + # Adaptive V-Sync automatically disables V-Sync when the framerate target is not met, and enables + # V-Sync otherwise. This prevents suttering and reduces input latency when the framerate target + # is not met, at the cost of visible tearing. + if index == 0: # Disabled (default) + DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_DISABLED) + elif index == 1: # Adaptive + DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_ADAPTIVE) + elif index == 2: # Enabled + DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_ENABLED) +" + +[sub_resource type="GDScript" id="GDScript_6qqbt"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"video\", \"taa\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index: int) -> void: + Settings.set_value(\"video\", \"taa\", index) + # Temporal antialiasing. Smooths out everything including specular aliasing, but can introduce + # ghosting artifacts and blurring in motion. Moderate performance cost. + # @NOTE: https://github.com/TokisanGames/Terrain3D/issues/302 + # get_viewport().use_taa = index == 1 +" + +[sub_resource type="GDScript" id="GDScript_ulkhx"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"video\", \"msaa\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index: int) -> void: + Settings.set_value(\"video\", \"msaa\", index) + # Multi-sample anti-aliasing. High quality, but slow. It also does not smooth out the edges of + # transparent (alpha scissor) textures. + if index == 0: # Disabled (default) + 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 +" + +[sub_resource type="GDScript" id="GDScript_k6fl5"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"video\", \"fxaa\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index: int) -> void: + Settings.set_value(\"video\", \"fxaa\", index) + # Fast approximate anti-aliasing. Much faster than MSAA (and works on alpha scissor edges), + # but blurs the whole scene rendering slightly. + get_viewport().screen_space_aa = int(index == 1) as Viewport.ScreenSpaceAA +" + +[sub_resource type="GDScript" id="GDScript_cph1u"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"quality\", \"shadow_size\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index : int) -> void: + Settings.set_value(\"quality\", \"shadow_size\", index) + if index == 0: # Minimum + RenderingServer.directional_shadow_atlas_set_size(512, true) + # Adjust shadow bias according to shadow resolution. + # Higher resultions can use a lower bias without suffering from shadow acne. + #Settings.set_value(\"quality\", \"shadow_bias\", 0.06) + #directional_light.shadow_bias = Settings.get_value(\"quality\", \"shadow_bias\") + + # Disable positional (omni/spot) light shadows entirely to further improve performance. + # These often don't contribute as much to a scene compared to directional light shadows. + get_viewport().positional_shadow_atlas_size = 0 + if index == 1: # Very Low + RenderingServer.directional_shadow_atlas_set_size(1024, true) + #Settings.set_value(\"quality\", \"shadow_bias\", 0.04) + #directional_light.shadow_bias = Settings.get_value(\"quality\", \"shadow_bias\") + get_viewport().positional_shadow_atlas_size = 1024 + if index == 2: # Low + RenderingServer.directional_shadow_atlas_set_size(2048, true) + #Settings.set_value(\"quality\", \"shadow_bias\", 0.03) + #directional_light.shadow_bias = Settings.get_value(\"quality\", \"shadow_bias\") + get_viewport().positional_shadow_atlas_size = 2048 + if index == 3: # Medium (default) + RenderingServer.directional_shadow_atlas_set_size(4096, true) + #Settings.set_value(\"quality\", \"shadow_bias\", 0.02) + #directional_light.shadow_bias = Settings.get_value(\"quality\", \"shadow_bias\") + get_viewport().positional_shadow_atlas_size = 4096 + if index == 4: # High + RenderingServer.directional_shadow_atlas_set_size(8192, true) + #Settings.set_value(\"quality\", \"shadow_bias\", 0.01) + #directional_light.shadow_bias = Settings.get_value(\"quality\", \"shadow_bias\") + get_viewport().positional_shadow_atlas_size = 8192 + if index == 5: # Ultra + RenderingServer.directional_shadow_atlas_set_size(16384, true) + #Settings.set_value(\"quality\", \"shadow_bias\", 0.005) + #directional_light.shadow_bias = Settings.get_value(\"quality\", \"shadow_bias\") + get_viewport().positional_shadow_atlas_size = 16384 +" + +[sub_resource type="GDScript" id="GDScript_uhm5l"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"quality\", \"shadow_filter\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index : int) -> void: + Settings.set_value(\"quality\", \"shadow_filter\", index) + if index == 0: # Very Low + RenderingServer.directional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_HARD) + RenderingServer.positional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_HARD) + if index == 1: # Low + RenderingServer.directional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_VERY_LOW) + RenderingServer.positional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_VERY_LOW) + if index == 2: # Medium (default) + RenderingServer.directional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_LOW) + RenderingServer.positional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_LOW) + if index == 3: # High + RenderingServer.directional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_MEDIUM) + RenderingServer.positional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_MEDIUM) + if index == 4: # Very High + RenderingServer.directional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_HIGH) + RenderingServer.positional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_HIGH) + if index == 5: # Ultra + RenderingServer.directional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_ULTRA) + RenderingServer.positional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_ULTRA) +" + +[sub_resource type="GDScript" id="GDScript_4cgn8"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"quality\", \"mesh_lod\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index : int) -> void: + Settings.set_value(\"quality\", \"mesh_lod\", index) + if index == 0: # Very Low + get_viewport().mesh_lod_threshold = 8.0 + if index == 0: # Low + get_viewport().mesh_lod_threshold = 4.0 + if index == 1: # Medium + get_viewport().mesh_lod_threshold = 2.0 + if index == 2: # High (default) + get_viewport().mesh_lod_threshold = 1.0 + if index == 3: # Ultra + # Always use highest LODs to avoid any form of pop-in. + get_viewport().mesh_lod_threshold = 0.0 +" + +[sub_resource type="GDScript" id="GDScript_xfygm"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"environment\", \"sdfgi\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index: int) -> void: + Settings.set_value(\"environment\", \"sdfgi\", index) + # This is a setting that is attached to the environment. + # If your game requires you to change the environment, + # then be sure to run this function again to make the setting effective. + if index == 0: # Disabled (default) + MapsManager.environment.sdfgi_enabled = false + elif index == 1: # Low + MapsManager.environment.sdfgi_enabled = true + RenderingServer.gi_set_use_half_resolution(true) + elif index == 2: # High + MapsManager.environment.sdfgi_enabled = true + RenderingServer.gi_set_use_half_resolution(false) +" + +[sub_resource type="GDScript" id="GDScript_k3pso"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"environment\", \"glow\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index: int) -> void: + Settings.set_value(\"environment\", \"glow\", index) + ## This is a setting that is attached to the environment. + ## If your game requires you to change the environment, + ## then be sure to run this function again to make the setting effective. + if index == 0: # Disabled (default) + MapsManager.environment.glow_enabled = false + elif index == 1: # Low + MapsManager.environment.glow_enabled = true + elif index == 2: # High + MapsManager.environment.glow_enabled = true +" + +[sub_resource type="GDScript" id="GDScript_0sqe1"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"environment\", \"ssao\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index: int) -> void: + Settings.set_value(\"environment\", \"ssao\", index) + # This is a setting that is attached to the environment. + # If your game requires you to change the environment, + # then be sure to run this function again to make the setting effective. + if index == 0: # Disabled (default) + MapsManager.environment.ssao_enabled = false + elif index == 1: # Very Low + MapsManager.environment.ssao_enabled = true + RenderingServer.environment_set_ssao_quality(RenderingServer.ENV_SSAO_QUALITY_VERY_LOW, true, 0.5, 2, 50, 300) + elif index == 2: # Low + MapsManager.environment.ssao_enabled = true + RenderingServer.environment_set_ssao_quality(RenderingServer.ENV_SSAO_QUALITY_VERY_LOW, true, 0.5, 2, 50, 300) + elif index == 3: # Medium + MapsManager.environment.ssao_enabled = true + RenderingServer.environment_set_ssao_quality(RenderingServer.ENV_SSAO_QUALITY_MEDIUM, true, 0.5, 2, 50, 300) + elif index == 4: # High + MapsManager.environment.ssao_enabled = true + RenderingServer.environment_set_ssao_quality(RenderingServer.ENV_SSAO_QUALITY_HIGH, true, 0.5, 2, 50, 300) +" + +[sub_resource type="GDScript" id="GDScript_cb82q"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"environment\", \"ssr\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index: int) -> void: + Settings.set_value(\"environment\", \"ssr\", index) + # This is a setting that is attached to the environment. + # If your game requires you to change the environment, + # then be sure to run this function again to make the setting effective. + if index == 0: # Disabled (default) + MapsManager.environment.ssr_enabled = false + elif index == 1: # Low + MapsManager.environment.ssr_enabled = true + MapsManager.environment.ssr_max_steps = 8 + elif index == 2: # Medium + MapsManager.environment.ssr_enabled = true + MapsManager.environment.ssr_max_steps = 32 + elif index == 3: # High + MapsManager.environment.ssr_enabled = true + MapsManager.environment.ssr_max_steps = 56 +" + +[sub_resource type="GDScript" id="GDScript_qrf3h"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"environment\", \"ssil\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index: int) -> void: + Settings.set_value(\"environment\", \"ssil\", index) + # This is a setting that is attached to the environment. + # If your game requires you to change the environment, + # then be sure to run this function again to make the setting effective. + if index == 0: # Disabled (default) + MapsManager.environment.ssil_enabled = false + if index == 1: # Very Low + MapsManager.environment.ssil_enabled = true + RenderingServer.environment_set_ssil_quality(RenderingServer.ENV_SSIL_QUALITY_VERY_LOW, true, 0.5, 4, 50, 300) + if index == 2: # Low + MapsManager.environment.ssil_enabled = true + RenderingServer.environment_set_ssil_quality(RenderingServer.ENV_SSIL_QUALITY_LOW, true, 0.5, 4, 50, 300) + if index == 3: # Medium + MapsManager.environment.ssil_enabled = true + RenderingServer.environment_set_ssil_quality(RenderingServer.ENV_SSIL_QUALITY_MEDIUM, true, 0.5, 4, 50, 300) + if index == 4: # High + MapsManager.environment.ssil_enabled = true + RenderingServer.environment_set_ssil_quality(RenderingServer.ENV_SSIL_QUALITY_HIGH, true, 0.5, 4, 50, 300) +" + +[sub_resource type="GDScript" id="GDScript_80uen"] +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends OptionButton + +func _ready() -> void: + self.selected = Settings.get_value(\"environment\", \"volumetric_fog\") + self.item_selected.emit(self.selected) + +func _on_item_selected(index: int) -> void: + Settings.set_value(\"environment\", \"volumetric_fog\", index) + if index == 0: # Disabled (default) + MapsManager.environment.volumetric_fog_enabled = false + if index == 1: # Low + MapsManager.environment.volumetric_fog_enabled = true + RenderingServer.environment_set_volumetric_fog_filter_active(false) + if index == 2: # High + MapsManager.environment.volumetric_fog_enabled = true + RenderingServer.environment_set_volumetric_fog_filter_active(true) " [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c4ymk"] @@ -167,7 +1062,8 @@ mouse_filter = 2 texture = ExtResource("1_ph586") stretch_mode = 6 -[node name="Multiplayer" type="PanelContainer" parent="." node_paths=PackedStringArray("tab_container")] +[node name="MultiplayerPanelContainer" type="PanelContainer" parent="." node_paths=PackedStringArray("tab_container")] +unique_name_in_owner = true visible = false anchors_preset = 15 anchor_right = 1.0 @@ -178,26 +1074,26 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_krqeq") script = SubResource("GDScript_tc1bm") tab_container = NodePath("MarginContainer/VBoxContainer/TabContainer") -[node name="MarginContainer" type="MarginContainer" parent="Multiplayer"] +[node name="MarginContainer" type="MarginContainer" parent="MultiplayerPanelContainer"] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 20 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 -[node name="VBoxContainer" type="VBoxContainer" parent="Multiplayer/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="MultiplayerPanelContainer/MarginContainer"] layout_mode = 2 -[node name="TabContainer" type="TabContainer" parent="Multiplayer/MarginContainer/VBoxContainer"] +[node name="TabContainer" type="TabContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_constants/side_margin = 0 -[node name="Profile" type="TabBar" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer"] +[node name="Profile" type="TabBar" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer"] layout_mode = 2 theme_override_constants/h_separation = 0 -[node name="MarginContainer" type="MarginContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile"] +[node name="MarginContainer" type="MarginContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile"] layout_mode = 0 offset_right = 1116.0 offset_bottom = 577.0 @@ -206,16 +1102,16 @@ theme_override_constants/margin_top = 20 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 -[node name="HBoxContainer" type="HBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer"] layout_mode = 2 theme_override_constants/separation = 20 -[node name="LeftBox" type="Control" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer"] +[node name="LeftBox" type="Control" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_stretch_ratio = 0.25 -[node name="Top" type="VBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox"] +[node name="Top" type="VBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox"] layout_mode = 1 anchors_preset = 10 anchor_right = 1.0 @@ -224,21 +1120,21 @@ grow_horizontal = 2 size_flags_horizontal = 3 size_flags_stretch_ratio = 0.25 -[node name="Create" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Top"] +[node name="Create" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Top"] layout_mode = 2 disabled = true text = "Create" -[node name="Delete" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Top"] +[node name="Delete" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Top"] layout_mode = 2 disabled = true text = "Delete" -[node name="Save" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Top"] +[node name="Save" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Top"] layout_mode = 2 text = "Save" -[node name="Bottom" type="VBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox"] +[node name="Bottom" type="VBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox"] layout_mode = 1 anchors_preset = 12 anchor_top = 1.0 @@ -249,37 +1145,37 @@ grow_horizontal = 2 grow_vertical = 0 size_flags_horizontal = 0 -[node name="MainMenu" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Bottom"] +[node name="MainMenu" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Bottom"] layout_mode = 2 size_flags_horizontal = 3 text = "Main Menu " -[node name="Quit" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Bottom"] +[node name="Quit" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Bottom"] layout_mode = 2 size_flags_horizontal = 3 text = "Quit" -[node name="RightBox" type="VBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer"] +[node name="RightBox" type="VBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="Label" type="Label" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/RightBox"] +[node name="Label" type="Label" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/RightBox"] layout_mode = 2 text = "Current Profile:" -[node name="ProfileName" type="LineEdit" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/RightBox"] +[node name="ProfileName" type="LineEdit" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/RightBox"] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 text = "Newblood" -[node name="Join" type="TabBar" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer"] +[node name="Join" type="TabBar" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer"] visible = false layout_mode = 2 select_with_rmb = true -[node name="MarginContainer" type="MarginContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join"] +[node name="MarginContainer" type="MarginContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -291,16 +1187,16 @@ theme_override_constants/margin_top = 20 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 -[node name="HBoxContainer" type="HBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer"] layout_mode = 2 theme_override_constants/separation = 10 -[node name="LeftBox" type="Control" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer"] +[node name="LeftBox" type="Control" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_stretch_ratio = 0.25 -[node name="Top" type="VBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox"] +[node name="Top" type="VBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox"] layout_mode = 1 anchors_preset = 10 anchor_right = 1.0 @@ -309,11 +1205,11 @@ grow_horizontal = 2 size_flags_horizontal = 3 size_flags_stretch_ratio = 0.25 -[node name="Join" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Top"] +[node name="Join" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Top"] layout_mode = 2 text = "Join" -[node name="Bottom" type="VBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox"] +[node name="Bottom" type="VBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox"] layout_mode = 1 anchors_preset = 12 anchor_top = 1.0 @@ -324,32 +1220,32 @@ grow_horizontal = 2 grow_vertical = 0 size_flags_horizontal = 0 -[node name="MainMenu" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Bottom"] +[node name="MainMenu" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Bottom"] layout_mode = 2 size_flags_horizontal = 3 text = "Main Menu " -[node name="Quit" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Bottom"] +[node name="Quit" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Bottom"] layout_mode = 2 size_flags_horizontal = 3 text = "Quit" -[node name="RightBox" type="VBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer"] +[node name="RightBox" type="VBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="JoinAddress" type="LineEdit" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/RightBox"] +[node name="JoinAddress" type="LineEdit" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/RightBox"] unique_name_in_owner = true layout_mode = 2 placeholder_text = "localhost" -[node name="Host" type="TabBar" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer"] +[node name="Host" type="TabBar" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer"] visible = false layout_mode = 2 select_with_rmb = true -[node name="MarginContainer" type="MarginContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host"] +[node name="MarginContainer" type="MarginContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -361,16 +1257,16 @@ theme_override_constants/margin_top = 20 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 -[node name="HBoxContainer" type="HBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer"] layout_mode = 2 theme_override_constants/separation = 10 -[node name="LeftBox" type="Control" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer"] +[node name="LeftBox" type="Control" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_stretch_ratio = 0.25 -[node name="Top" type="VBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox"] +[node name="Top" type="VBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox"] layout_mode = 1 anchors_preset = 10 anchor_right = 1.0 @@ -379,11 +1275,11 @@ grow_horizontal = 2 size_flags_horizontal = 3 size_flags_stretch_ratio = 0.25 -[node name="Host" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Top"] +[node name="Host" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Top"] layout_mode = 2 text = "Host" -[node name="Bottom" type="VBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox"] +[node name="Bottom" type="VBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox"] layout_mode = 1 anchors_preset = 12 anchor_top = 1.0 @@ -394,37 +1290,37 @@ grow_horizontal = 2 grow_vertical = 0 size_flags_horizontal = 0 -[node name="MainMenu" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Bottom"] +[node name="MainMenu" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Bottom"] layout_mode = 2 size_flags_horizontal = 3 text = "Main Menu " -[node name="Quit" type="Button" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Bottom"] +[node name="Quit" type="Button" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Bottom"] layout_mode = 2 size_flags_horizontal = 3 text = "Quit" -[node name="RightBox" type="VBoxContainer" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer"] +[node name="RightBox" type="VBoxContainer" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="ServerPort" type="LineEdit" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/RightBox"] +[node name="ServerPort" type="LineEdit" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/RightBox"] unique_name_in_owner = true layout_mode = 2 placeholder_text = "9000" -[node name="MapSelector" type="OptionButton" parent="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/RightBox"] +[node name="MapSelector" type="OptionButton" parent="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/RightBox"] unique_name_in_owner = true layout_mode = 2 clip_text = true allow_reselect = true -[node name="Modal" type="Panel" parent="Multiplayer"] +[node name="Modal" type="Panel" parent="MultiplayerPanelContainer"] visible = false layout_mode = 2 -[node name="Label" type="Label" parent="Multiplayer/Modal"] +[node name="Label" type="Label" parent="MultiplayerPanelContainer/Modal"] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -439,178 +1335,657 @@ grow_horizontal = 2 grow_vertical = 2 text = "CONNECTING..." -[node name="Settings" type="PanelContainer" parent="." node_paths=PackedStringArray("tab_container")] +[node name="SettingsPanelContainer" type="PanelContainer" parent="."] visible = false anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_ky5sv") +size_flags_horizontal = 3 script = SubResource("GDScript_gbnwv") -tab_container = NodePath("MarginContainer/VBoxContainer/TabContainer") -[node name="MarginContainer" type="MarginContainer" parent="Settings"] -layout_mode = 2 -theme_override_constants/margin_left = 20 -theme_override_constants/margin_top = 20 -theme_override_constants/margin_right = 20 -theme_override_constants/margin_bottom = 20 - -[node name="VBoxContainer" type="VBoxContainer" parent="Settings/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="SettingsPanelContainer"] layout_mode = 2 -[node name="TabContainer" type="TabContainer" parent="Settings/MarginContainer/VBoxContainer"] +[node name="ScrollContainer" type="ScrollContainer" parent="SettingsPanelContainer/VBoxContainer"] +custom_minimum_size = Vector2(480, 0) layout_mode = 2 size_flags_vertical = 3 -theme_override_constants/side_margin = 0 +scroll_vertical = 100 -[node name="Gameplay" type="TabBar" parent="Settings/MarginContainer/VBoxContainer/TabContainer"] +[node name="MarginContainer" type="MarginContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer"] layout_mode = 2 -theme_override_constants/h_separation = 0 - -[node name="MarginContainer" type="MarginContainer" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay"] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme_override_constants/margin_left = 20 +size_flags_horizontal = 3 +theme_override_constants/margin_left = 15 theme_override_constants/margin_top = 20 -theme_override_constants/margin_right = 20 +theme_override_constants/margin_right = 15 theme_override_constants/margin_bottom = 20 -[node name="GridContainer" type="GridContainer" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_constants/separation = 10 + +[node name="PresetSection" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +theme_override_colors/font_color = Color(0.682353, 0.917647, 1, 1) +text = "Presets" +horizontal_alignment = 1 + +[node name="Presets" type="HBoxContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="VeryLowPreset" type="Button" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/Presets"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Very Low" + +[node name="LowPreset" type="Button" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/Presets"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Low" + +[node name="MediumPreset" type="Button" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/Presets"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Medium" + +[node name="HighPreset" type="Button" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/Presets"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "High" + +[node name="UltraPreset" type="Button" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/Presets"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Ultra" + +[node name="HSeparator" type="HSeparator" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="UISection" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +theme_override_colors/font_color = Color(0.683425, 0.916893, 1, 1) +text = "User Interface Settings" +horizontal_alignment = 1 + +[node name="UIGridContainer" type="GridContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +columns = 2 + +[node name="UIScaleLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/UIGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "UI Scale:" + +[node name="UIScaleOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/UIGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 5 +selected = 2 +popup/item_0/text = "Smaller (66%)" +popup/item_0/id = 0 +popup/item_1/text = "Small (80%)" +popup/item_1/id = 1 +popup/item_2/text = "Medium (100%)" +popup/item_2/id = 2 +popup/item_3/text = "Large (133%)" +popup/item_3/id = 3 +popup/item_4/text = "Larger (200%)" +popup/item_4/id = 4 +script = SubResource("GDScript_7votw") + +[node name="ControlsSection" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +theme_override_colors/font_color = Color(0.683425, 0.916893, 1, 1) +text = "Controls Settings" +horizontal_alignment = 1 + +[node name="ControlsGridContainer" type="GridContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] layout_mode = 2 columns = 2 -[node name="FOVLabel" type="Label" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/GridContainer"] -layout_mode = 2 -text = "Field of view" - -[node name="FOVSpinBox" type="SpinBox" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/GridContainer"] -unique_name_in_owner = true -layout_mode = 2 -min_value = 60.0 -max_value = 120.0 -value = 60.0 - -[node name="SensitivityLabel" type="Label" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/GridContainer"] +[node name="SensitivityLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ControlsGridContainer"] layout_mode = 2 +size_flags_horizontal = 3 text = "Mouse sensitivity" -[node name="SensitivitySpinBox" type="SpinBox" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/GridContainer"] -unique_name_in_owner = true +[node name="SensitivityControls" type="HBoxContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ControlsGridContainer"] layout_mode = 2 -max_value = 1.0 -step = 0.01 -value = 1.0 +size_flags_horizontal = 3 +script = SubResource("GDScript_ux54k") -[node name="InvertedYLabel" type="Label" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/GridContainer"] +[node name="SpinBox" type="SpinBox" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ControlsGridContainer/SensitivityControls"] layout_mode = 2 + +[node name="Slider" type="HSlider" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ControlsGridContainer/SensitivityControls"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 + +[node name="InvertedYLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ControlsGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 text = "Inverted Y" -[node name="InvertedYCheckbox" type="CheckBox" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/GridContainer"] +[node name="InvertedYCheckbox" type="CheckBox" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ControlsGridContainer"] unique_name_in_owner = true layout_mode = 2 +size_flags_horizontal = 0 -[node name="Buttons" type="HBoxContainer" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer"] +[node name="ViewportSection" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] layout_mode = 2 -size_flags_vertical = 8 +theme_override_colors/font_color = Color(0.683425, 0.916893, 1, 1) +text = "Video Settings" +horizontal_alignment = 1 -[node name="Bottom" type="VBoxContainer" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/Buttons"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_stretch_ratio = 0.2 - -[node name="Save" type="Button" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/Buttons/Bottom"] -layout_mode = 2 -text = "Save -" - -[node name="MainMenu" type="Button" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/Buttons/Bottom"] -layout_mode = 2 -size_flags_horizontal = 3 -text = "Main Menu -" - -[node name="Quit" type="Button" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/Buttons/Bottom"] -layout_mode = 2 -size_flags_horizontal = 3 -text = "Quit" - -[node name="Spacer" type="Control" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/Buttons"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_stretch_ratio = 0.8 - -[node name="Graphics" type="TabBar" parent="Settings/MarginContainer/VBoxContainer/TabContainer"] -visible = false -layout_mode = 2 -select_with_rmb = true - -[node name="MarginContainer" type="MarginContainer" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics"] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme_override_constants/margin_left = 20 -theme_override_constants/margin_top = 20 -theme_override_constants/margin_right = 20 -theme_override_constants/margin_bottom = 20 - -[node name="GridContainer" type="GridContainer" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer"] +[node name="ViewportGridContainer" type="GridContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] layout_mode = 2 columns = 2 -[node name="WindowModeLabel" type="Label" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/GridContainer"] +[node name="FOVLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] layout_mode = 2 -text = "Window mode" +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Field of View:" -[node name="WindowModeOptionButton" type="OptionButton" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/GridContainer"] +[node name="FOVControls" type="HBoxContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] unique_name_in_owner = true layout_mode = 2 +script = SubResource("GDScript_v5ux6") + +[node name="SpinBox" type="SpinBox" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FOVControls"] +layout_mode = 2 +min_value = 70.0 +max_value = 150.0 +value = 90.0 + +[node name="Slider" type="HSlider" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FOVControls"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +min_value = 70.0 +max_value = 150.0 +value = 90.0 + +[node name="QualityLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Resolution Scale:" + +[node name="QualitySlider" type="HSlider" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +min_value = 0.25 +max_value = 2.0 +step = 0.05 +value = 1.0 +script = SubResource("GDScript_viqb1") + +[node name="FilterLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Display Filter:" + +[node name="FilterOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 item_count = 2 selected = 0 +popup/item_0/text = "Bilinear (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "FSR 1.0 (Fast)" +popup/item_1/id = 1 +script = SubResource("GDScript_mnbe0") + +[node name="FSRSharpnessLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "FSR Sharpness:" + +[node name="FSRSharpnessSlider" type="HSlider" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +max_value = 2.0 +step = 0.2 +script = SubResource("GDScript_c3ngv") + +[node name="WindowModeLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Window Mode:" + +[node name="WindowModeOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 3 +selected = 2 popup/item_0/text = "Windowed" popup/item_0/id = 0 popup/item_1/text = "Fullscreen" popup/item_1/id = 1 +popup/item_2/text = "Exclusive Fullscreen" +popup/item_2/id = 2 +script = SubResource("GDScript_xa5kp") -[node name="Buttons" type="HBoxContainer" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer"] -layout_mode = 2 -size_flags_vertical = 8 - -[node name="Bottom" type="VBoxContainer" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/Buttons"] +[node name="VsyncLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] layout_mode = 2 size_flags_horizontal = 3 -size_flags_stretch_ratio = 0.2 +theme_override_font_sizes/font_size = 16 +text = "V-Sync:" -[node name="Save" type="Button" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/Buttons/Bottom"] +[node name="VsyncOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] layout_mode = 2 -text = "Save +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 3 +selected = 0 +popup/item_0/text = "Disabled" +popup/item_0/id = 0 +popup/item_1/text = "Adaptive" +popup/item_1/id = 1 +popup/item_2/text = "Enabled" +popup/item_2/id = 2 +script = SubResource("GDScript_jl1uk") + +[node name="TAALabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +visible = false +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Anti-Aliasing (TAA):" + +[node name="TAAOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 2 +selected = 0 +popup/item_0/text = "Disabled (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "Enabled (Average)" +popup/item_1/id = 1 +script = SubResource("GDScript_6qqbt") + +[node name="MSAALabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Anti-Aliasing (MSAA):" + +[node name="MSAAOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 4 +selected = 0 +popup/item_0/text = "Disabled (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "2× (Average)" +popup/item_1/id = 1 +popup/item_2/text = "4× (Slow)" +popup/item_2/id = 2 +popup/item_3/text = "8× (Slower)" +popup/item_3/id = 3 +script = SubResource("GDScript_ulkhx") + +[node name="FXAALabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Anti-Aliasing (FXAA):" + +[node name="FXAAOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 2 +selected = 0 +popup/item_0/text = "Disabled (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "Enabled (Fast)" +popup/item_1/id = 1 +script = SubResource("GDScript_k6fl5") + +[node name="QualitySection" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +theme_override_colors/font_color = Color(0.683425, 0.916893, 1, 1) +text = "Quality Settings" +horizontal_alignment = 1 + +[node name="QualityGridContainer" type="GridContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +columns = 2 + +[node name="ShadowSizeLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Shadow Resolution:" + +[node name="ShadowSizeOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 6 +selected = 3 +popup/item_0/text = "Minimum (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "Very Low (Faster)" +popup/item_1/id = 1 +popup/item_2/text = "Low (Fast)" +popup/item_2/id = 2 +popup/item_3/text = "Medium (Average)" +popup/item_3/id = 3 +popup/item_4/text = "High (Slow)" +popup/item_4/id = 4 +popup/item_5/text = "Ultra (Slowest)" +popup/item_5/id = 5 +script = SubResource("GDScript_cph1u") + +[node name="ShadowFilterLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Shadow Filtering:" + +[node name="ShadowFilterOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 6 +selected = 2 +popup/item_0/text = "Very Low (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "Low (Faster)" +popup/item_1/id = 1 +popup/item_2/text = "Medium (Fast)" +popup/item_2/id = 2 +popup/item_3/text = "High (Average)" +popup/item_3/id = 3 +popup/item_4/text = "Very High (Slow)" +popup/item_4/id = 4 +popup/item_5/text = "Ultra (Slower)" +popup/item_5/id = 5 +script = SubResource("GDScript_uhm5l") + +[node name="MeshLODLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Model Quality:" + +[node name="MeshLODOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 4 +selected = 2 +popup/item_0/text = "Low (Faster)" +popup/item_0/id = 0 +popup/item_1/text = "Medium (Fast)" +popup/item_1/id = 1 +popup/item_2/text = "High (Average)" +popup/item_2/id = 2 +popup/item_3/text = "Ultra (Slow)" +popup/item_3/id = 3 +script = SubResource("GDScript_4cgn8") + +[node name="EnvironmentSection" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +theme_override_colors/font_color = Color(0.683425, 0.916893, 1, 1) +text = "Effect Settings" +horizontal_alignment = 1 + +[node name="EnvironmentGridContainer" type="GridContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +columns = 2 + +[node name="SDFGILabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Global Illumination:" + +[node name="SDFGIOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 3 +selected = 0 +popup/item_0/text = "Disabled (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "Low (Average)" +popup/item_1/id = 1 +popup/item_2/text = "High (Slow)" +popup/item_2/id = 2 +script = SubResource("GDScript_xfygm") + +[node name="GlowLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Bloom:" + +[node name="GlowOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 3 +selected = 0 +popup/item_0/text = "Disabled (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "Low (Fast)" +popup/item_1/id = 1 +popup/item_2/text = "High (Average)" +popup/item_2/id = 2 +script = SubResource("GDScript_k3pso") + +[node name="SSAOLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Ambient Occlusion:" + +[node name="SSAOOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 5 +selected = 0 +popup/item_0/text = "Disabled (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "Very Low (Fast)" +popup/item_1/id = 1 +popup/item_2/text = "Low (Fast)" +popup/item_2/id = 2 +popup/item_3/text = "Medium (Average)" +popup/item_3/id = 3 +popup/item_4/text = "High (Slow)" +popup/item_4/id = 4 +script = SubResource("GDScript_0sqe1") + +[node name="SSReflectionsLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 14 +text = "Screen-Space Reflections:" + +[node name="SSReflectionsOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 4 +selected = 0 +popup/item_0/text = "Disabled (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "Low (Average)" +popup/item_1/id = 1 +popup/item_2/text = "Medium (Slow)" +popup/item_2/id = 2 +popup/item_3/text = "High (Slower)" +popup/item_3/id = 3 +script = SubResource("GDScript_cb82q") + +[node name="SSILLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Screen-Space Lighting:" + +[node name="SSILOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 5 +selected = 0 +popup/item_0/text = "Disabled (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "Very Low (Fast)" +popup/item_1/id = 1 +popup/item_2/text = "Low (Average)" +popup/item_2/id = 2 +popup/item_3/text = "Medium (Slow)" +popup/item_3/id = 3 +popup/item_4/text = "High (Slower)" +popup/item_4/id = 4 +script = SubResource("GDScript_qrf3h") + +[node name="VolumetricFogLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Volumetric Fog:" + +[node name="VolumetricFogOptionButton" type="OptionButton" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +item_count = 3 +selected = 0 +popup/item_0/text = "Disabled (Fastest)" +popup/item_0/id = 0 +popup/item_1/text = "Low (Fast)" +popup/item_1/id = 1 +popup/item_2/text = "High (Average)" +popup/item_2/id = 2 +script = SubResource("GDScript_80uen") + +[node name="AdjustmentSection" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +visible = false +layout_mode = 2 +theme_override_colors/font_color = Color(0.683425, 0.916893, 1, 1) +text = "Adjustments" +horizontal_alignment = 1 + +[node name="AdjustmentsGridContainer" type="GridContainer" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"] +visible = false +layout_mode = 2 +columns = 2 + +[node name="BrightnessLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/AdjustmentsGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Brightness:" + +[node name="BrightnessSlider" type="HSlider" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/AdjustmentsGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +min_value = 0.5 +max_value = 2.0 +step = 0.01 +value = 1.0 + +[node name="ContrastLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/AdjustmentsGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Contrast:" + +[node name="ContrastSlider" type="HSlider" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/AdjustmentsGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +min_value = 0.5 +max_value = 2.0 +step = 0.01 +value = 1.0 + +[node name="SaturationLabel" type="Label" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/AdjustmentsGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 +text = "Saturation:" + +[node name="SaturationSlider" type="HSlider" parent="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/AdjustmentsGridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +min_value = 0.01 +max_value = 2.0 +step = 0.01 +value = 1.0 + +[node name="MarginContainer" type="MarginContainer" parent="SettingsPanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_constants/margin_left = 15 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_right = 23 +theme_override_constants/margin_bottom = 15 + +[node name="Buttons" type="HBoxContainer" parent="SettingsPanelContainer/VBoxContainer/MarginContainer"] +layout_mode = 2 + +[node name="Apply" type="Button" parent="SettingsPanelContainer/VBoxContainer/MarginContainer/Buttons"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Apply " -[node name="MainMenu" type="Button" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/Buttons/Bottom"] +[node name="Reset" type="Button" parent="SettingsPanelContainer/VBoxContainer/MarginContainer/Buttons"] layout_mode = 2 size_flags_horizontal = 3 -text = "Main Menu -" +text = "Reset" -[node name="Quit" type="Button" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/Buttons/Bottom"] +[node name="Close" type="Button" parent="SettingsPanelContainer/VBoxContainer/MarginContainer/Buttons"] layout_mode = 2 size_flags_horizontal = 3 -text = "Quit" +text = "Close" -[node name="Spacer" type="Control" parent="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/Buttons"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_stretch_ratio = 0.8 - -[node name="Main" type="PanelContainer" parent="."] +[node name="MainPanelContainer" type="PanelContainer" parent="."] +unique_name_in_owner = true anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -619,70 +1994,95 @@ grow_vertical = 2 size_flags_horizontal = 0 theme_override_styles/panel = SubResource("StyleBoxFlat_c4ymk") -[node name="HBoxContainer" type="HBoxContainer" parent="Main"] +[node name="HBoxContainer" type="HBoxContainer" parent="MainPanelContainer"] layout_mode = 2 -[node name="PanelContainer" type="PanelContainer" parent="Main/HBoxContainer"] +[node name="PanelContainer" type="PanelContainer" parent="MainPanelContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_stretch_ratio = 0.3 theme_override_styles/panel = SubResource("StyleBoxFlat_dq4me") -[node name="MarginContainer" type="MarginContainer" parent="Main/HBoxContainer/PanelContainer"] +[node name="MarginContainer" type="MarginContainer" parent="MainPanelContainer/HBoxContainer/PanelContainer"] layout_mode = 2 size_flags_horizontal = 3 theme_override_constants/margin_left = 20 theme_override_constants/margin_right = 20 -[node name="VBoxContainer" type="VBoxContainer" parent="Main/HBoxContainer/PanelContainer/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="MainPanelContainer/HBoxContainer/PanelContainer/MarginContainer"] layout_mode = 2 theme_override_constants/separation = 10 alignment = 1 -[node name="Demo" type="Button" parent="Main/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] +[node name="Demo" type="Button" parent="MainPanelContainer/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 theme_override_font_sizes/font_size = 32 text = "Demo" -[node name="Multiplayer" type="Button" parent="Main/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] +[node name="Multiplayer" type="Button" parent="MainPanelContainer/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 theme_override_font_sizes/font_size = 32 text = "Multiplayer" -[node name="Settings" type="Button" parent="Main/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] +[node name="Settings" type="Button" parent="MainPanelContainer/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 theme_override_font_sizes/font_size = 32 text = "Settings" -[node name="Quit" type="Button" parent="Main/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] +[node name="Quit" type="Button" parent="MainPanelContainer/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 theme_override_font_sizes/font_size = 32 text = "Quit" -[node name="Control" type="Control" parent="Main/HBoxContainer"] +[node name="Control" type="Control" parent="MainPanelContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_stretch_ratio = 0.8 +mouse_filter = 1 -[connection signal="join_server" from="Multiplayer" to="." method="_on_multiplayer_join_server"] -[connection signal="start_server" from="Multiplayer" to="." method="_on_multiplayer_start_server"] -[connection signal="pressed" from="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Top/Save" to="Multiplayer" method="_on_save_pressed"] -[connection signal="pressed" from="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Bottom/MainMenu" to="." method="_on_main_menu_pressed"] -[connection signal="pressed" from="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Bottom/Quit" to="." method="_on_quit_pressed"] -[connection signal="pressed" from="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Top/Join" to="Multiplayer" method="_on_join_pressed"] -[connection signal="pressed" from="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Bottom/MainMenu" to="." method="_on_main_menu_pressed"] -[connection signal="pressed" from="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Bottom/Quit" to="." method="_on_quit_pressed"] -[connection signal="pressed" from="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Top/Host" to="Multiplayer" method="_on_host_pressed"] -[connection signal="pressed" from="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Bottom/MainMenu" to="." method="_on_main_menu_pressed"] -[connection signal="pressed" from="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Bottom/Quit" to="." method="_on_quit_pressed"] -[connection signal="text_changed" from="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/RightBox/ServerPort" to="Multiplayer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/RightBox/ServerPort" method="_on_text_changed"] -[connection signal="pressed" from="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/Buttons/Bottom/Save" to="Settings" method="_on_save_pressed"] -[connection signal="pressed" from="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/Buttons/Bottom/MainMenu" to="." method="_on_main_menu_pressed"] -[connection signal="pressed" from="Settings/MarginContainer/VBoxContainer/TabContainer/Gameplay/MarginContainer/Buttons/Bottom/Quit" to="." method="_on_quit_pressed"] -[connection signal="pressed" from="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/Buttons/Bottom/Save" to="Settings" method="_on_save_pressed"] -[connection signal="pressed" from="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/Buttons/Bottom/MainMenu" to="." method="_on_main_menu_pressed"] -[connection signal="pressed" from="Settings/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/Buttons/Bottom/Quit" to="." method="_on_quit_pressed"] -[connection signal="pressed" from="Main/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/Demo" to="." method="_on_demo_pressed"] -[connection signal="pressed" from="Main/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/Multiplayer" to="." method="_on_multiplayer_pressed"] -[connection signal="pressed" from="Main/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/Settings" to="." method="_on_settings_pressed"] -[connection signal="pressed" from="Main/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/Quit" to="." method="_on_quit_pressed"] +[connection signal="join_server" from="MultiplayerPanelContainer" to="." method="_on_multiplayer_join_server"] +[connection signal="start_server" from="MultiplayerPanelContainer" to="." method="_on_multiplayer_start_server"] +[connection signal="pressed" from="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Top/Save" to="MultiplayerPanelContainer" method="_on_save_pressed"] +[connection signal="pressed" from="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Bottom/MainMenu" to="." method="_on_main_menu_pressed"] +[connection signal="pressed" from="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Profile/MarginContainer/HBoxContainer/LeftBox/Bottom/Quit" to="." method="_on_quit_pressed"] +[connection signal="pressed" from="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Top/Join" to="MultiplayerPanelContainer" method="_on_join_pressed"] +[connection signal="pressed" from="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Bottom/MainMenu" to="." method="_on_main_menu_pressed"] +[connection signal="pressed" from="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Join/MarginContainer/HBoxContainer/LeftBox/Bottom/Quit" to="." method="_on_quit_pressed"] +[connection signal="pressed" from="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Top/Host" to="MultiplayerPanelContainer" method="_on_host_pressed"] +[connection signal="pressed" from="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Bottom/MainMenu" to="." method="_on_main_menu_pressed"] +[connection signal="pressed" from="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/LeftBox/Bottom/Quit" to="." method="_on_quit_pressed"] +[connection signal="text_changed" from="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/RightBox/ServerPort" to="MultiplayerPanelContainer/MarginContainer/VBoxContainer/TabContainer/Host/MarginContainer/HBoxContainer/RightBox/ServerPort" method="_on_text_changed"] +[connection signal="pressed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/Presets/VeryLowPreset" to="SettingsPanelContainer" method="_on_very_low_preset_pressed"] +[connection signal="pressed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/Presets/LowPreset" to="SettingsPanelContainer" method="_on_low_preset_pressed"] +[connection signal="pressed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/Presets/MediumPreset" to="SettingsPanelContainer" method="_on_medium_preset_pressed"] +[connection signal="pressed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/Presets/HighPreset" to="SettingsPanelContainer" method="_on_high_preset_pressed"] +[connection signal="pressed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/Presets/UltraPreset" to="SettingsPanelContainer" method="_on_ultra_preset_pressed"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/UIGridContainer/UIScaleOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/UIGridContainer/UIScaleOptionButton" method="_on_item_selected"] +[connection signal="value_changed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ControlsGridContainer/SensitivityControls/SpinBox" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ControlsGridContainer/SensitivityControls" method="_on_spin_box_value_changed"] +[connection signal="value_changed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ControlsGridContainer/SensitivityControls/Slider" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ControlsGridContainer/SensitivityControls" method="_on_slider_value_changed"] +[connection signal="value_changed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FOVControls/SpinBox" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FOVControls" method="_on_spin_box_value_changed"] +[connection signal="value_changed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FOVControls/Slider" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FOVControls" method="_on_slider_value_changed"] +[connection signal="value_changed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/QualitySlider" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/QualitySlider" method="_on_value_changed"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FilterOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FilterOptionButton" method="_on_item_selected"] +[connection signal="value_changed" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FSRSharpnessSlider" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FSRSharpnessSlider" method="_on_value_changed"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/WindowModeOptionButton" to="SettingsPanelContainer" method="_on_window_mode_option_button_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/VsyncOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/VsyncOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/TAAOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/TAAOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/MSAAOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/MSAAOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FXAAOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/ViewportGridContainer/FXAAOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer/ShadowSizeOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer/ShadowSizeOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer/ShadowFilterOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer/ShadowFilterOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer/MeshLODOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/QualityGridContainer/MeshLODOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/SDFGIOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/SDFGIOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/GlowOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/GlowOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/SSAOOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/SSAOOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/SSReflectionsOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/SSReflectionsOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/SSILOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/SSILOptionButton" method="_on_item_selected"] +[connection signal="item_selected" from="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/VolumetricFogOptionButton" to="SettingsPanelContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/EnvironmentGridContainer/VolumetricFogOptionButton" method="_on_item_selected"] +[connection signal="pressed" from="SettingsPanelContainer/VBoxContainer/MarginContainer/Buttons/Apply" to="SettingsPanelContainer" method="_on_apply_pressed"] +[connection signal="pressed" from="SettingsPanelContainer/VBoxContainer/MarginContainer/Buttons/Reset" to="SettingsPanelContainer" method="_on_reset_pressed"] +[connection signal="pressed" from="SettingsPanelContainer/VBoxContainer/MarginContainer/Buttons/Close" to="SettingsPanelContainer" method="_on_close_pressed"] +[connection signal="pressed" from="MainPanelContainer/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/Demo" to="." method="_on_demo_pressed"] +[connection signal="pressed" from="MainPanelContainer/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/Multiplayer" to="." method="_on_multiplayer_pressed"] +[connection signal="pressed" from="MainPanelContainer/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/Settings" to="." method="_on_settings_pressed"] +[connection signal="pressed" from="MainPanelContainer/HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/Quit" to="." method="_on_quit_pressed"] diff --git a/main.tscn b/main.tscn index 1cdcb8c..f049c16 100644 --- a/main.tscn +++ b/main.tscn @@ -1,12 +1,26 @@ [gd_scene load_steps=6 format=3 uid="uid://ma1if3sjox6i"] -[ext_resource type="PackedScene" uid="uid://boviiugcnfyrj" path="res://modes/demo.tscn" id="1_50a80"] +[ext_resource type="PackedScene" uid="uid://boviiugcnfyrj" path="res://modes/singleplayer/demo.tscn" id="1_50a80"] [ext_resource type="PackedScene" uid="uid://bjctlqvs33nqy" path="res://interfaces/menus/boot/boot.tscn" id="1_acy5o"] -[ext_resource type="PackedScene" uid="uid://bvwxfgygm2xb8" path="res://modes/multiplayer.tscn" id="2_g8xeb"] +[ext_resource type="PackedScene" uid="uid://bvwxfgygm2xb8" path="res://modes/multiplayer/multiplayer.tscn" id="2_g8xeb"] [ext_resource type="Resource" uid="uid://dut5f1sq0wfeb" path="res://maps/maps.tres" id="3_1ipir"] [sub_resource type="GDScript" id="GDScript_e61dq"] -script/source = "class_name Game extends Node3D +script/source = "# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +class_name Game extends Node3D @export_category(\"Modes\") @export var SINGLEPLAYER : PackedScene @@ -32,10 +46,15 @@ var mode : Node: else: Input.mouse_mode = Input.MOUSE_MODE_VISIBLE + func _ready() -> void: $BootMenu.start_demo.connect(_start_demo) - $BootMenu/Multiplayer.start_server.connect(_start_server) - $BootMenu/Multiplayer.join_server.connect(_join_server) + $BootMenu/MultiplayerPanelContainer.start_server.connect(_start_server) + $BootMenu/MultiplayerPanelContainer.join_server.connect(_join_server) + # do not set initial window mode for debug build + if not OS.is_debug_build(): + DisplayServer.window_set_mode(Settings.get_value(\"video\", \"window_mode\")) + func _unhandled_input(event : InputEvent) -> void: if event.is_action_pressed(\"exit\"): @@ -70,14 +89,14 @@ func _start_server(port : int, nickname : String) -> void: mode.start_server({ \"port\": port, \"nickname\": nickname, - \"map\": maps[clamp($BootMenu/Multiplayer.map_selector.selected, 0, len(maps))] + \"map\": maps[clamp($BootMenu/MultiplayerPanelContainer.map_selector.selected, 0, len(maps))] }) $BootMenu.hide() func _join_server(host : String, port : int, nickname : String) -> void: mode = MULTIPLAYER.instantiate() - mode.connected_to_server.connect($BootMenu/Multiplayer._on_connected_to_server) - mode.connection_failed.connect($BootMenu/Multiplayer._on_connection_failed) + mode.connected_to_server.connect($BootMenu/MultiplayerPanelContainer._on_connected_to_server) + mode.connection_failed.connect($BootMenu/MultiplayerPanelContainer._on_connection_failed) mode.join_server(host, port, nickname) " diff --git a/maps/desert/assets/desert.r16 b/maps/desert/assets/desert.r16 new file mode 100644 index 0000000..3386b92 Binary files /dev/null and b/maps/desert/assets/desert.r16 differ diff --git a/maps/desert/textures/ground054_alb_ht.png b/maps/desert/assets/textures/ground054_alb_ht.png similarity index 100% rename from maps/desert/textures/ground054_alb_ht.png rename to maps/desert/assets/textures/ground054_alb_ht.png diff --git a/maps/desert/textures/ground054_alb_ht.png.import b/maps/desert/assets/textures/ground054_alb_ht.png.import similarity index 68% rename from maps/desert/textures/ground054_alb_ht.png.import rename to maps/desert/assets/textures/ground054_alb_ht.png.import index 91c1cf8..ed56397 100644 --- a/maps/desert/textures/ground054_alb_ht.png.import +++ b/maps/desert/assets/textures/ground054_alb_ht.png.import @@ -3,7 +3,7 @@ importer="texture" type="CompressedTexture2D" uid="uid://cngjywcua4vv8" -path.bptc="res://.godot/imported/ground054_alb_ht.png-c1e6560e1b831d8f5772408a395cdf1b.bptc.ctex" +path.bptc="res://.godot/imported/ground054_alb_ht.png-460d3ac5c09d7955ca61b8b57742b1a9.bptc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -11,8 +11,8 @@ metadata={ [deps] -source_file="res://maps/desert/textures/ground054_alb_ht.png" -dest_files=["res://.godot/imported/ground054_alb_ht.png-c1e6560e1b831d8f5772408a395cdf1b.bptc.ctex"] +source_file="res://maps/desert/assets/textures/ground054_alb_ht.png" +dest_files=["res://.godot/imported/ground054_alb_ht.png-460d3ac5c09d7955ca61b8b57742b1a9.bptc.ctex"] [params] diff --git a/maps/desert/textures/ground054_nrm_rgh.png b/maps/desert/assets/textures/ground054_nrm_rgh.png similarity index 100% rename from maps/desert/textures/ground054_nrm_rgh.png rename to maps/desert/assets/textures/ground054_nrm_rgh.png diff --git a/maps/desert/textures/ground054_nrm_rgh.png.import b/maps/desert/assets/textures/ground054_nrm_rgh.png.import similarity index 68% rename from maps/desert/textures/ground054_nrm_rgh.png.import rename to maps/desert/assets/textures/ground054_nrm_rgh.png.import index 3e7d40f..2fb2555 100644 --- a/maps/desert/textures/ground054_nrm_rgh.png.import +++ b/maps/desert/assets/textures/ground054_nrm_rgh.png.import @@ -3,7 +3,7 @@ importer="texture" type="CompressedTexture2D" uid="uid://cbk7l6hs0yrcc" -path.bptc="res://.godot/imported/ground054_nrm_rgh.png-70f079690ff8219938f9079109780fc1.bptc.ctex" +path.bptc="res://.godot/imported/ground054_nrm_rgh.png-9ea209f1a7f6e48624db85005a037890.bptc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -11,8 +11,8 @@ metadata={ [deps] -source_file="res://maps/desert/textures/ground054_nrm_rgh.png" -dest_files=["res://.godot/imported/ground054_nrm_rgh.png-70f079690ff8219938f9079109780fc1.bptc.ctex"] +source_file="res://maps/desert/assets/textures/ground054_nrm_rgh.png" +dest_files=["res://.godot/imported/ground054_nrm_rgh.png-9ea209f1a7f6e48624db85005a037890.bptc.ctex"] [params] diff --git a/maps/desert/textures/rock029_alb_ht.png b/maps/desert/assets/textures/rock029_alb_ht.png similarity index 100% rename from maps/desert/textures/rock029_alb_ht.png rename to maps/desert/assets/textures/rock029_alb_ht.png diff --git a/maps/desert/textures/rock029_alb_ht.png.import b/maps/desert/assets/textures/rock029_alb_ht.png.import similarity index 69% rename from maps/desert/textures/rock029_alb_ht.png.import rename to maps/desert/assets/textures/rock029_alb_ht.png.import index e0731b3..0153cc5 100644 --- a/maps/desert/textures/rock029_alb_ht.png.import +++ b/maps/desert/assets/textures/rock029_alb_ht.png.import @@ -3,7 +3,7 @@ importer="texture" type="CompressedTexture2D" uid="uid://dwk8islw7ebab" -path.bptc="res://.godot/imported/rock029_alb_ht.png-a5e0a4f98f29bdeb159f1e749d7737b1.bptc.ctex" +path.bptc="res://.godot/imported/rock029_alb_ht.png-dd746789bc129bafaa8d1cc908de0e3e.bptc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -11,8 +11,8 @@ metadata={ [deps] -source_file="res://maps/desert/textures/rock029_alb_ht.png" -dest_files=["res://.godot/imported/rock029_alb_ht.png-a5e0a4f98f29bdeb159f1e749d7737b1.bptc.ctex"] +source_file="res://maps/desert/assets/textures/rock029_alb_ht.png" +dest_files=["res://.godot/imported/rock029_alb_ht.png-dd746789bc129bafaa8d1cc908de0e3e.bptc.ctex"] [params] diff --git a/maps/desert/textures/rock029_nrm_rgh.png b/maps/desert/assets/textures/rock029_nrm_rgh.png similarity index 100% rename from maps/desert/textures/rock029_nrm_rgh.png rename to maps/desert/assets/textures/rock029_nrm_rgh.png diff --git a/maps/desert/textures/rock029_nrm_rgh.png.import b/maps/desert/assets/textures/rock029_nrm_rgh.png.import similarity index 68% rename from maps/desert/textures/rock029_nrm_rgh.png.import rename to maps/desert/assets/textures/rock029_nrm_rgh.png.import index e5740b0..0b1aa12 100644 --- a/maps/desert/textures/rock029_nrm_rgh.png.import +++ b/maps/desert/assets/textures/rock029_nrm_rgh.png.import @@ -3,7 +3,7 @@ importer="texture" type="CompressedTexture2D" uid="uid://lgfhdcsb2ryx" -path.bptc="res://.godot/imported/rock029_nrm_rgh.png-21134283f9adb86493d1d72a4f30e20a.bptc.ctex" +path.bptc="res://.godot/imported/rock029_nrm_rgh.png-3bf029664d0f58a1c79abd2d6666ba90.bptc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -11,8 +11,8 @@ metadata={ [deps] -source_file="res://maps/desert/textures/rock029_nrm_rgh.png" -dest_files=["res://.godot/imported/rock029_nrm_rgh.png-21134283f9adb86493d1d72a4f30e20a.bptc.ctex"] +source_file="res://maps/desert/assets/textures/rock029_nrm_rgh.png" +dest_files=["res://.godot/imported/rock029_nrm_rgh.png-3bf029664d0f58a1c79abd2d6666ba90.bptc.ctex"] [params] diff --git a/maps/desert/desert.tscn b/maps/desert/desert.tscn index aab61c7..61fb9ba 100644 --- a/maps/desert/desert.tscn +++ b/maps/desert/desert.tscn @@ -1,27 +1,23 @@ -[gd_scene load_steps=6 format=3 uid="uid://btlkog4b87p4x"] +[gd_scene load_steps=5 format=3 uid="uid://btlkog4b87p4x"] [ext_resource type="Terrain3DStorage" uid="uid://wgmg245njt8e" path="res://maps/desert/resources/storage.res" id="1_7nbyj"] -[ext_resource type="Environment" uid="uid://nw62ce5cglvs" path="res://environments/desert.tres" id="1_e1o3u"] [ext_resource type="Terrain3DMaterial" uid="uid://c3isipd4wqxpk" path="res://maps/desert/resources/material.tres" id="2_psdr0"] [ext_resource type="Terrain3DTextureList" uid="uid://d1j24k8sq8qpj" path="res://maps/desert/resources/textures.tres" id="3_aowug"] -[ext_resource type="Script" path="res://maps/map.gd" id="4_cl7fm"] +[ext_resource type="Environment" uid="uid://nw62ce5cglvs" path="res://maps/desert/resources/env.tres" id="5_4l4vc"] -[node name="Desert" type="Terrain3D" node_paths=PackedStringArray("_flagstand", "_player_spawns_root")] +[node name="Desert" type="Terrain3D"] storage = ExtResource("1_7nbyj") material = ExtResource("2_psdr0") texture_list = ExtResource("3_aowug") collision_layer = 2147483648 collision_mask = 2147483648 -script = ExtResource("4_cl7fm") -_flagstand = NodePath("FlagStand") -_player_spawns_root = NodePath("PlayerSpawns") [node name="Sunlight" type="DirectionalLight3D" parent="."] transform = Transform3D(0.5, 0.55667, -0.663414, 0, 0.766044, 0.642788, 0.866025, -0.321394, 0.383022, -1613.38, 2730.74, 446.64) shadow_enabled = true [node name="WorldEnvironment" type="WorldEnvironment" parent="."] -environment = ExtResource("1_e1o3u") +environment = ExtResource("5_4l4vc") [node name="PlayerSpawns" type="Node" parent="."] @@ -33,3 +29,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1161.42, 174.535, 909.901) [node name="FlagStand" type="Marker3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 878.613, 134.55, 916.185) + +[node name="Camera3D" type="Camera3D" parent="."] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 1024, 920, 1024) diff --git a/environments/desert.tres b/maps/desert/resources/env.tres similarity index 100% rename from environments/desert.tres rename to maps/desert/resources/env.tres diff --git a/maps/desert/resources/textures.tres b/maps/desert/resources/textures.tres index 68458f6..8b116c4 100644 --- a/maps/desert/resources/textures.tres +++ b/maps/desert/resources/textures.tres @@ -1,23 +1,23 @@ [gd_resource type="Terrain3DTextureList" load_steps=7 format=3 uid="uid://d1j24k8sq8qpj"] -[ext_resource type="Texture2D" uid="uid://cngjywcua4vv8" path="res://maps/desert/textures/ground054_alb_ht.png" id="1_rh7of"] -[ext_resource type="Texture2D" uid="uid://cbk7l6hs0yrcc" path="res://maps/desert/textures/ground054_nrm_rgh.png" id="2_xt1tc"] -[ext_resource type="Texture2D" uid="uid://dwk8islw7ebab" path="res://maps/desert/textures/rock029_alb_ht.png" id="3_elstl"] -[ext_resource type="Texture2D" uid="uid://lgfhdcsb2ryx" path="res://maps/desert/textures/rock029_nrm_rgh.png" id="4_6h5db"] +[ext_resource type="Texture2D" uid="uid://dwk8islw7ebab" path="res://maps/desert/assets/textures/rock029_alb_ht.png" id="1_v6d2c"] +[ext_resource type="Texture2D" uid="uid://lgfhdcsb2ryx" path="res://maps/desert/assets/textures/rock029_nrm_rgh.png" id="2_06nlf"] +[ext_resource type="Texture2D" uid="uid://cngjywcua4vv8" path="res://maps/desert/assets/textures/ground054_alb_ht.png" id="3_ik3f2"] +[ext_resource type="Texture2D" uid="uid://cbk7l6hs0yrcc" path="res://maps/desert/assets/textures/ground054_nrm_rgh.png" id="4_waajq"] [sub_resource type="Terrain3DTexture" id="Terrain3DTexture_wue72"] name = "Rock" albedo_color = Color(0.921569, 0.890196, 0.933333, 1) -albedo_texture = ExtResource("3_elstl") -normal_texture = ExtResource("4_6h5db") +albedo_texture = ExtResource("1_v6d2c") +normal_texture = ExtResource("2_06nlf") uv_scale = 0.05 [sub_resource type="Terrain3DTexture" id="Terrain3DTexture_dkh73"] name = "Sand" texture_id = 1 albedo_color = Color(0.792157, 0.72549, 0.694118, 1) -albedo_texture = ExtResource("1_rh7of") -normal_texture = ExtResource("2_xt1tc") +albedo_texture = ExtResource("3_ik3f2") +normal_texture = ExtResource("4_waajq") uv_scale = 0.15 [resource] diff --git a/maps/genesis/genesis.tscn b/maps/genesis/genesis.tscn index b79583c..31bf286 100644 --- a/maps/genesis/genesis.tscn +++ b/maps/genesis/genesis.tscn @@ -1,21 +1,24 @@ -[gd_scene load_steps=6 format=3 uid="uid://chbno00ugl6te"] +[gd_scene load_steps=5 format=3 uid="uid://chbno00ugl6te"] -[ext_resource type="Environment" uid="uid://d2ahijqqspw5f" path="res://environments/default.tres" id="1_3nr12"] -[ext_resource type="Script" path="res://maps/map.gd" id="1_6ysiv"] [ext_resource type="Terrain3DStorage" uid="uid://dyon4xda4k40d" path="res://maps/genesis/resources/storage.res" id="1_a88qe"] [ext_resource type="Terrain3DMaterial" uid="uid://bd4lr5sxu8xu" path="res://maps/genesis/resources/material.res" id="2_o2y3d"] [ext_resource type="Terrain3DTextureList" uid="uid://dnqa8kxgm3xuw" path="res://maps/genesis/resources/textures.res" id="3_1cww7"] +[ext_resource type="Environment" uid="uid://d2ahijqqspw5f" path="res://maps/genesis/resources/env.tres" id="5_3klr3"] -[node name="Genesis" type="Terrain3D" node_paths=PackedStringArray("_flagstand", "_player_spawns_root")] +[node name="Genesis" type="Terrain3D"] storage = ExtResource("1_a88qe") material = ExtResource("2_o2y3d") texture_list = ExtResource("3_1cww7") collision_layer = 2147483648 collision_mask = 2147483648 mesh_size = 24 -script = ExtResource("1_6ysiv") -_flagstand = NodePath("FlagPillar/CSGCylinder3D/FlagStand") -_player_spawns_root = NodePath("PlayerSpawns") + +[node name="Sunlight" type="DirectionalLight3D" parent="."] +transform = Transform3D(-0.866024, -0.433016, 0.25, 0, 0.499998, 0.866027, -0.500003, 0.75, -0.43301, 0, 100, 0) +shadow_enabled = true + +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = ExtResource("5_3klr3") [node name="PlayerSpawns" type="Node" parent="."] @@ -39,12 +42,5 @@ size = Vector3(0.5, 6, 0.5) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.42967, 0) height = 5.0 -[node name="FlagStand" type="Marker3D" parent="FlagPillar/CSGCylinder3D"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.53822, 0) - -[node name="Sunlight" type="DirectionalLight3D" parent="."] -transform = Transform3D(-0.866024, -0.433016, 0.25, 0, 0.499998, 0.866027, -0.500003, 0.75, -0.43301, 0, 100, 0) -shadow_enabled = true - -[node name="WorldEnvironment" type="WorldEnvironment" parent="."] -environment = ExtResource("1_3nr12") +[node name="FlagStand" type="Marker3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 108.644, 0) diff --git a/environments/default.tres b/maps/genesis/resources/env.tres similarity index 100% rename from environments/default.tres rename to maps/genesis/resources/env.tres diff --git a/maps/map.gd b/maps/map.gd deleted file mode 100644 index 62b9cf4..0000000 --- a/maps/map.gd +++ /dev/null @@ -1,15 +0,0 @@ -class_name Map extends Terrain3D - -@export var _flagstand : Node3D -@export var _player_spawns_root : Node - -var _rng : RandomNumberGenerator = RandomNumberGenerator.new() - -func get_flagstand() -> Node3D: - return _flagstand - -func get_player_spawn() -> Node3D: - var spawn_count : int = _player_spawns_root.get_child_count() - var spawn_index : int = _rng.randi_range(0, spawn_count - 1) - var spawn_selected : Node3D = _player_spawns_root.get_child(spawn_index) - return spawn_selected diff --git a/modes/multiplayer.gd b/modes/multiplayer/multiplayer.gd similarity index 92% rename from modes/multiplayer.gd rename to modes/multiplayer/multiplayer.gd index cce6229..e830c58 100644 --- a/modes/multiplayer.gd +++ b/modes/multiplayer/multiplayer.gd @@ -25,8 +25,6 @@ class_name Multiplayer extends Node @onready var map : Node = $Map @onready var scoreboard : Scoreboard = $Scoreboard -var _map_manager : Map - signal connected_to_server signal connection_failed @@ -65,19 +63,18 @@ func _on_player_died(player : Player, _killer_id : int) -> void: respawn_player(player) func respawn_player(player : Player) -> void: - var spawn_location : Vector3 = _map_manager.get_player_spawn().position + var spawn_location : Vector3 = MapsManager.get_player_spawn().position player.respawn.rpc(spawn_location) func add_player(peer_id : int, nickname : String) -> void: - var match_participant_component : MatchParticipantComponent = MatchParticipantComponent.new() var player : Player = PLAYER.instantiate() - player.died.connect(_on_player_died) player.name = str(peer_id) + player.died.connect(_on_player_died) players.add_child(player) - player.global_position = _map_manager.get_player_spawn().position player.match_participant_component.player_id = peer_id player.match_participant_component.team_id = ($RabbitScoringComponent as RabbitScoringComponent)._team_chasers.team_id player.match_participant_component.nickname = nickname + player.global_position = MapsManager.get_player_spawn().position $DeathmatchScoringComponent.subscribe_player(player) scoreboard.add_participant(player.match_participant_component) print("Peer `%s` connected" % player.name) @@ -94,8 +91,8 @@ func remove_player(peer_id : int) -> void: func _load_map(scene : PackedScene, nickname : String) -> void: var map_scene : Node = scene.instantiate() + MapsManager.current_map = map_scene map_scene.ready.connect(_add_flag) - _map_manager = map_scene map.add_child(map_scene) if DisplayServer.get_name() != "headless": add_player(1, nickname) @@ -104,7 +101,9 @@ func _add_flag() -> void: var flag : Flag = FLAG.instantiate() $RabbitScoringComponent.setup(flag) objectives.add_child(flag) - flag.global_position = _map_manager.get_flagstand().global_position + var flagstand : Marker3D = MapsManager.current_map.get_node("FlagStand") + if flagstand: + flag.global_position = flagstand.global_position @rpc("any_peer", "reliable") func _join_match(nickname : String) -> void: diff --git a/modes/multiplayer.tscn b/modes/multiplayer/multiplayer.tscn similarity index 93% rename from modes/multiplayer.tscn rename to modes/multiplayer/multiplayer.tscn index 4bd355f..eafe09f 100644 --- a/modes/multiplayer.tscn +++ b/modes/multiplayer/multiplayer.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=7 format=3 uid="uid://bvwxfgygm2xb8"] -[ext_resource type="Script" path="res://modes/multiplayer.gd" id="1_r1kd6"] +[ext_resource type="Script" path="res://modes/multiplayer/multiplayer.gd" id="1_r1kd6"] [ext_resource type="PackedScene" uid="uid://cbhx1xme0sb7k" path="res://entities/player/player.tscn" id="2_og1vb"] [ext_resource type="PackedScene" uid="uid://c88l3h0ph00c7" path="res://entities/flag/flag.tscn" id="3_h0rie"] [ext_resource type="Script" path="res://maps/components/rabbit_scoring_component.gd" id="5_7woao"] @@ -15,7 +15,7 @@ FLAG = ExtResource("3_h0rie") [node name="Map" type="Node" parent="."] [node name="MapSpawner" type="MultiplayerSpawner" parent="."] -_spawnable_scenes = PackedStringArray("res://maps/genesis/genesis.tscn") +_spawnable_scenes = PackedStringArray("res://maps/genesis/genesis.tscn", "res://maps/desert/desert.tscn") spawn_path = NodePath("../Map") spawn_limit = 1 diff --git a/modes/singleplayer/demo.gd b/modes/singleplayer/demo.gd new file mode 100644 index 0000000..3089333 --- /dev/null +++ b/modes/singleplayer/demo.gd @@ -0,0 +1,27 @@ +# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +class_name Singleplayer extends Node + +@onready var player_node : Player = $Player +@onready var target_dummy : RigidBody3D = $TargetDummy +@onready var player_respawn_location : Vector3 = player_node.position + +func _ready() -> void: + player_node.died.connect(respawn_player) + player_node.match_participant_component.player_id = 1 + MapsManager.current_map = $Desert + +func respawn_player(player : Player, _killer_id : int) -> void: + player.respawn(player_respawn_location) diff --git a/modes/demo.tscn b/modes/singleplayer/demo.tscn similarity index 69% rename from modes/demo.tscn rename to modes/singleplayer/demo.tscn index 2a5062a..aff056d 100644 --- a/modes/demo.tscn +++ b/modes/singleplayer/demo.tscn @@ -1,36 +1,21 @@ [gd_scene load_steps=7 format=3 uid="uid://boviiugcnfyrj"] +[ext_resource type="Script" path="res://modes/singleplayer/demo.gd" id="1_kkjqs"] [ext_resource type="PackedScene" uid="uid://cbhx1xme0sb7k" path="res://entities/player/player.tscn" id="2_6wbjq"] [ext_resource type="PackedScene" uid="uid://dpnu1lvfncx6q" path="res://entities/target_dummy/target_dummy.tscn" id="3_fkq5v"] [ext_resource type="PackedScene" uid="uid://c88l3h0ph00c7" path="res://entities/flag/flag.tscn" id="4_1j2pw"] [ext_resource type="PackedScene" uid="uid://btlkog4b87p4x" path="res://maps/desert/desert.tscn" id="4_dogmv"] -[sub_resource type="GDScript" id="GDScript_iv0l6"] -script/source = "extends Node - -@onready var player_node : Player = $Player -@onready var target_dummy : RigidBody3D = $TargetDummy - -@onready var player_respawn_location : Vector3 = player_node.position - -func _ready() -> void: - player_node.died.connect(respawn_player) - player_node.match_participant_component.player_id = 1 - -func respawn_player(player : Player, _killer_id : int) -> void: - player.respawn(player_respawn_location) -" - [sub_resource type="PhysicsMaterial" id="PhysicsMaterial_c5jqv"] resource_local_to_scene = true bounce = 1.0 absorbent = true [node name="Demo" type="Node"] -script = SubResource("GDScript_iv0l6") +script = ExtResource("1_kkjqs") [node name="Player" parent="." instance=ExtResource("2_6wbjq")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 589.786, 210.119, 853.632) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 589.786, 209.119, 853.632) physics_material_override = SubResource("PhysicsMaterial_c5jqv") [node name="TargetDummy" parent="." instance=ExtResource("3_fkq5v")] diff --git a/modes/team.gd b/modes/team.gd deleted file mode 100644 index e49c853..0000000 --- a/modes/team.gd +++ /dev/null @@ -1,6 +0,0 @@ -class_name Team extends Object - -var team_id : int - -func _init(id : int) -> void: - team_id = id diff --git a/project.godot b/project.godot index 4f4c5d0..f98acf7 100644 --- a/project.godot +++ b/project.godot @@ -17,7 +17,8 @@ config/icon="res://icon.svg" [autoload] -GlobalSettings="*res://systems/settings.gd" +Settings="*res://systems/settings.gd" +MapsManager="*res://systems/maps_manager.gd" [debug] diff --git a/systems/maps_manager.gd b/systems/maps_manager.gd new file mode 100644 index 0000000..cfce293 --- /dev/null +++ b/systems/maps_manager.gd @@ -0,0 +1,59 @@ +# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +## Manage environment settings and terrain maps within a scene. +extends Node + +## The default [Environment] used by the current scene in case the [Terrain3D] +## node does not have a [WorldEnvironment] as one of its children. +var environment := Environment.new() + +## Random number generator instance +var _rng := RandomNumberGenerator.new() + +## Reference to the current terrain map in the scene +var current_map : Terrain3D = null: + set(new_map): + if current_map != null: + current_map.queue_free() + current_map = new_map + # forward user environment settings to current scene environment + var world : World3D = get_viewport().find_world_3d() + if world.environment: + world.environment.sdfgi_enabled = MapsManager.environment.sdfgi_enabled + world.environment.glow_enabled = MapsManager.environment.glow_enabled + world.environment.ssao_enabled = MapsManager.environment.ssao_enabled + world.environment.ssr_enabled = MapsManager.environment.ssr_enabled + world.environment.ssr_max_steps = MapsManager.environment.ssr_max_steps + world.environment.ssil_enabled = MapsManager.environment.ssil_enabled + world.environment.volumetric_fog_enabled = MapsManager.environment.volumetric_fog_enabled + +func get_player_spawn() -> Node3D: + if current_map == null: + push_error("MapsManager.current_map is null") + return null + + if not current_map.has_node("PlayerSpawns"): + push_warning("PlayerSpawns node not found in MapsManager.current_map") + return null + + var player_spawns : Node = current_map.get_node("PlayerSpawns") + var spawn_count : int = player_spawns.get_child_count() + if spawn_count == 0: + push_error("PlayerSpawns has no children (%s)" % current_map.name) + return null + var spawn_index : int = _rng.randi_range(0, spawn_count - 1) + var random_spawn : Marker3D = player_spawns.get_child(spawn_index) + return random_spawn + diff --git a/systems/settings.gd b/systems/settings.gd index 65d8c9e..0f1b0da 100644 --- a/systems/settings.gd +++ b/systems/settings.gd @@ -1,37 +1,65 @@ -class_name Settings extends Node +# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +extends Node -var _config_file : ConfigFile = ConfigFile.new() - -var fov : int = 90 -var mouse_sensitivity : float = 0.6 -var inverted_y_axis : bool = false -var fullscreen : bool = false - -const SETTINGS_FILE_PATH : String = "user://settings.cfg" +var _file : ConfigFile = ConfigFile.new() +const path : String = "user://settings.cfg" func _ready() -> void: - var error : Error = _config_file.load(SETTINGS_FILE_PATH) + # make sure we load most recent core settings + self.reset() + # merge core settings with user-defined settings + var err : Error = _file.load(self.path) + if err == ERR_FILE_CANT_OPEN: + push_warning("settings not found, using defaults") + # apply state + self.apply() - fov = _config_file.get_value("gameplay", "fov", fov) - mouse_sensitivity = _config_file.get_value("gameplay", "mouse_sensitivity", mouse_sensitivity) - inverted_y_axis = _config_file.get_value("gameplay", "inverted_y_axis", inverted_y_axis) - fullscreen = _config_file.get_value("graphics", "fullscreen", fullscreen) - _update_screen() - - if error != OK: - print("Settings not found, using defaults") - save_to_file() +func get_value(section: String, key: String, default: Variant = null) -> Variant: + return _file.get_value(section, key, default) -func save_to_file() -> void: - _config_file.set_value("gameplay", "fov", fov) - _config_file.set_value("gameplay", "mouse_sensitivity", mouse_sensitivity) - _config_file.set_value("gameplay", "inverted_y_axis", inverted_y_axis) - _config_file.set_value("graphics", "fullscreen", fullscreen) - _update_screen() - _config_file.save(SETTINGS_FILE_PATH) +func set_value(section: String, key: String, value: Variant) -> void: + return _file.set_value(section, key, value) -func _update_screen() -> void: - if fullscreen: - DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) - else: - DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) +func reset() -> void: + _file.clear() + # video settings + _file.set_value("ui", "scale", 2) + _file.set_value("video", "quality", 1.125) + _file.set_value("video", "filter", 0) + _file.set_value("video", "fsr_sharpness", 0) + _file.set_value("video", "window_mode", 2) + _file.set_value("video", "vsync", 0) + _file.set_value("video", "taa", 0) + _file.set_value("video", "msaa", 0) + _file.set_value("video", "fxaa", 0) + _file.set_value("video", "fov", 90) + # controls settings + _file.set_value("controls", "mouse_sensitivity", .6) + _file.set_value("controls", "inverted_y_axis", false) + # quality settings + _file.set_value("quality", "shadow_size", 3) + _file.set_value("quality", "shadow_filter", 2) + _file.set_value("quality", "mesh_lod", 2) + # environment settings + _file.set_value("environment", "sdfgi", 0) + _file.set_value("environment", "glow", 0) + _file.set_value("environment", "ssao", 0) + _file.set_value("environment", "ssr", 0) + _file.set_value("environment", "ssil", 0) + _file.set_value("environment", "volumetric_fog", 0) + +func apply() -> void: + _file.save(self.path) diff --git a/systems/teams.gd b/systems/teams.gd new file mode 100644 index 0000000..f6f0a53 --- /dev/null +++ b/systems/teams.gd @@ -0,0 +1,20 @@ +# This file is part of open-fpsz. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +class_name Team extends Object + +var team_id : int + +func _init(id : int) -> void: + team_id = id