Added menu settings add-on
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://pir75xaw2g08"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/modular-settings-menu/scripts/settings-elements-scripts/audio_setting.gd" id="1_n7p26"]
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_hlot4"]
|
||||
size = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_4i2xw"]
|
||||
SpinBox/icons/updown = SubResource("PlaceholderTexture2D_hlot4")
|
||||
|
||||
[node name="MasterVolume" type="HBoxContainer" node_paths=PackedStringArray("SliderRef", "ValueBoxRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_n7p26")
|
||||
AUDIO_BUS = "Master"
|
||||
STEP_VALUE = 0.01
|
||||
DISPLAY_PERCENT_VALUE = true
|
||||
VALUE_SUFFIX = "%"
|
||||
SliderRef = NodePath("SliderValue/Slider")
|
||||
ValueBoxRef = NodePath("SliderValue/Value")
|
||||
IDENTIFIER = "MasterVolume"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Master"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SliderValue" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="Slider" type="HSlider" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="Value" type="SpinBox" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 4
|
||||
theme = SubResource("Theme_4i2xw")
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
alignment = 2
|
||||
@@ -0,0 +1,53 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://y6kuxwyem48c"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/modular-settings-menu/scripts/settings-elements-scripts/audio_setting.gd" id="1_05os8"]
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_hlot4"]
|
||||
size = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_4i2xw"]
|
||||
SpinBox/icons/updown = SubResource("PlaceholderTexture2D_hlot4")
|
||||
|
||||
[node name="MusicVolume" type="HBoxContainer" node_paths=PackedStringArray("SliderRef", "ValueBoxRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_05os8")
|
||||
AUDIO_BUS = "Music"
|
||||
STEP_VALUE = 0.01
|
||||
DISPLAY_PERCENT_VALUE = true
|
||||
VALUE_SUFFIX = "%"
|
||||
SliderRef = NodePath("SliderValue/Slider")
|
||||
ValueBoxRef = NodePath("SliderValue/Value")
|
||||
IDENTIFIER = "MusicVolume"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Music"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SliderValue" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="Slider" type="HSlider" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="Value" type="SpinBox" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 4
|
||||
theme = SubResource("Theme_4i2xw")
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
alignment = 2
|
||||
@@ -0,0 +1,53 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://jl3iirunm0hq"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/modular-settings-menu/scripts/settings-elements-scripts/audio_setting.gd" id="1_b0uh7"]
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_hlot4"]
|
||||
size = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_4i2xw"]
|
||||
SpinBox/icons/updown = SubResource("PlaceholderTexture2D_hlot4")
|
||||
|
||||
[node name="SFXVolume" type="HBoxContainer" node_paths=PackedStringArray("SliderRef", "ValueBoxRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_b0uh7")
|
||||
AUDIO_BUS = "SFX"
|
||||
STEP_VALUE = 0.01
|
||||
DISPLAY_PERCENT_VALUE = true
|
||||
VALUE_SUFFIX = "%"
|
||||
SliderRef = NodePath("SliderValue/Slider")
|
||||
ValueBoxRef = NodePath("SliderValue/Value")
|
||||
IDENTIFIER = "SFXVolume"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "SFX"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SliderValue" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="Slider" type="HSlider" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="Value" type="SpinBox" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 4
|
||||
theme = SubResource("Theme_4i2xw")
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
alignment = 2
|
||||
@@ -0,0 +1,38 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bbtri7oyxvehi"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jjel1"]
|
||||
|
||||
[node name="InputButton" type="PanelContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ActionLabel" type="Label" parent="MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 1
|
||||
mouse_filter = 1
|
||||
text = "action name"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ActionInput" type="Button" parent="MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
mouse_filter = 1
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_jjel1")
|
||||
text = "input key"
|
||||
@@ -0,0 +1,305 @@
|
||||
[gd_scene format=3 uid="uid://cqqhgk8ufkmqa"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bbtri7oyxvehi" path="res://addons/modular-settings-menu/scenes/settings-elements/controls-elements/input-settings-panel/input-settings-panel-elements/input_button.tscn" id="1_1y7ch"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_0eq0v"]
|
||||
resource_name = "input_settings_panel"
|
||||
script/source = "extends Control
|
||||
|
||||
# Button scene for actions
|
||||
@export var InputButtonScene: PackedScene
|
||||
|
||||
# Panel node references
|
||||
@onready var ActionListRef: VBoxContainer = %ActionList
|
||||
@onready var ResetButtonRef: Button = %ResetButton
|
||||
@onready var BackButtonRef: Button = $VBoxContainer/HBoxContainer/BackButton
|
||||
@onready var ApplyButtonRef: Button = $VBoxContainer/HBoxContainer/ApplyButton
|
||||
|
||||
# List of events for each action
|
||||
var actionEvents_: Dictionary
|
||||
# Cache for changed actions
|
||||
var panelCache_: Dictionary
|
||||
# Reference list to the button for each action
|
||||
var actionReferenceList_: Dictionary
|
||||
|
||||
# Reference to the element this panel belongs to
|
||||
var PanelOwnerRef: ButtonElement
|
||||
|
||||
# For remapping
|
||||
var isRemapping: bool = false
|
||||
var actionToRemap: String
|
||||
var ActionInputButtonRef: Button
|
||||
|
||||
|
||||
func _ready():
|
||||
# Connect necessary signals
|
||||
ResetButtonRef.connect(\"pressed\", on_reset_button_pressed)
|
||||
BackButtonRef.connect(\"pressed\", on_back_button_pressed)
|
||||
ApplyButtonRef.connect(\"pressed\", on_apply_button_pressed)
|
||||
|
||||
|
||||
# Called to populate the action list with actions
|
||||
func create_action_list(reset: bool = false) -> void:
|
||||
# All the remappable actions
|
||||
var INPUT_ACTIONS_: Dictionary = PanelOwnerRef.ACTION_LIST_.duplicate()
|
||||
INPUT_ACTIONS_.make_read_only()
|
||||
|
||||
# Get the events for the actions
|
||||
actionEvents_ = get_events(INPUT_ACTIONS_, reset)
|
||||
|
||||
# Check if the action list is already populated
|
||||
if ActionListRef.get_child_count() > 0:
|
||||
# Remove all the existing actions from the action list
|
||||
for child in ActionListRef.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# Create the actions for the action list
|
||||
for action in INPUT_ACTIONS_:
|
||||
# Instantiate the button scene
|
||||
var ButtonRef: PanelContainer = InputButtonScene.instantiate()
|
||||
# Get references to the elements of the button scene
|
||||
var ActionLabelRef: Label = ButtonRef.find_child(\"ActionLabel\")
|
||||
var ActionInputRef: Button = ButtonRef.find_child(\"ActionInput\")
|
||||
# Get the event for the action
|
||||
var event = actionEvents_[action]
|
||||
|
||||
# Add a reference of the instantiated button to the reference list
|
||||
actionReferenceList_[action] = ButtonRef
|
||||
# Change the label text of the button to the action it corresponds to
|
||||
ActionLabelRef.set_text(INPUT_ACTIONS_[action])
|
||||
ActionInputRef.set_text(event.as_text())
|
||||
|
||||
ActionListRef.add_child(ButtonRef)
|
||||
ActionInputRef.connect(
|
||||
\"pressed\",
|
||||
on_input_button_pressed.bind(action, ActionInputRef)
|
||||
)
|
||||
|
||||
|
||||
func on_input_button_pressed(action: String, ActionInputRef: Button) -> void:
|
||||
# Check if a button is not being remapped currently
|
||||
if not isRemapping:
|
||||
isRemapping = true
|
||||
actionToRemap = action
|
||||
ActionInputButtonRef = ActionInputRef
|
||||
ActionInputRef.set_text(\"Press key to bind...\")
|
||||
|
||||
|
||||
func _input(event: InputEvent):
|
||||
# Check if an action is being remapped currently
|
||||
if isRemapping:
|
||||
# Check if the desired input is either a keyboard or mouse input
|
||||
if (
|
||||
event is InputEventKey
|
||||
or event is InputEventMouseButton
|
||||
and event.pressed
|
||||
):
|
||||
# Check if the event is a mouse event and if it was a double click
|
||||
if event is InputEventMouseButton and event.double_click:
|
||||
# Disable the double click flag
|
||||
event.double_click = false
|
||||
|
||||
# Set the input button's text to the inputted event
|
||||
ActionInputButtonRef.set_text(event.as_text())
|
||||
|
||||
# Check if the inputted event is different compared to the saved one for the action
|
||||
if not check_matching_event(event):
|
||||
var duplicateEvent: String = check_duplicate_event(event)
|
||||
actionEvents_[actionToRemap] = event
|
||||
panelCache_[actionToRemap] = event
|
||||
ApplyButtonRef.set_disabled(false)
|
||||
|
||||
if duplicateEvent:
|
||||
var ActionInputRef: Button =\\
|
||||
actionReferenceList_[duplicateEvent].find_child(
|
||||
\"ActionInput\"
|
||||
)
|
||||
actionEvents_[duplicateEvent] = InputEventKey.new()
|
||||
panelCache_[duplicateEvent] = actionEvents_[duplicateEvent]
|
||||
ActionInputRef.set_text(
|
||||
actionEvents_[duplicateEvent].as_text()
|
||||
)
|
||||
|
||||
isRemapping = false
|
||||
actionToRemap = \"\"
|
||||
ActionInputButtonRef = null
|
||||
|
||||
accept_event()
|
||||
|
||||
|
||||
# Checks if the inputted event matches the one saved for the action
|
||||
func check_matching_event(event: InputEvent) -> bool:
|
||||
var eventType: String = event.get_class()
|
||||
var eventButton: int = get_event_button(event)
|
||||
var currentEvent = actionEvents_[actionToRemap]
|
||||
|
||||
# Check if the event matches the action to be remapped
|
||||
if (
|
||||
currentEvent.is_class(eventType)
|
||||
and get_event_button(currentEvent) == eventButton
|
||||
):
|
||||
return true
|
||||
|
||||
return false
|
||||
|
||||
|
||||
# Checks if any other action has the inputted event as it's event
|
||||
func check_duplicate_event(event: InputEvent) -> String:
|
||||
var eventType: String = event.get_class()
|
||||
var eventButton: int = get_event_button(event)
|
||||
|
||||
# Check for duplicates in other actions
|
||||
for action in actionEvents_:
|
||||
# Check if the action is not the one being remapped
|
||||
if action != actionToRemap:
|
||||
var storedEvent = actionEvents_[action]
|
||||
|
||||
# Check if the input type and event matches the inputted event
|
||||
if (
|
||||
storedEvent.is_class(eventType)
|
||||
and get_event_button(storedEvent) == eventButton
|
||||
):
|
||||
return action
|
||||
|
||||
return \"\"
|
||||
|
||||
|
||||
# Called to get the physical index for the inputted event depending on the input event's type
|
||||
func get_event_button(event: InputEvent) -> int:
|
||||
# Check for the input event's type
|
||||
match event.get_class():
|
||||
\"InputEventKey\":
|
||||
return event.get_keycode()
|
||||
\"InputEventMouseButton\":
|
||||
return event.get_button_index()
|
||||
|
||||
return -1
|
||||
|
||||
|
||||
# Called to update the action's events to the cached events
|
||||
func update_action_events(actionList_: Dictionary) -> void:
|
||||
# Itterate through all the recieved actions
|
||||
for action in actionList_:
|
||||
# Remove all events for the action
|
||||
InputMap.action_erase_events(action)
|
||||
|
||||
# Check if the action has an event assigned to it
|
||||
if actionList_[action]:
|
||||
# Add the new event to the action
|
||||
InputMap.action_add_event(action, actionList_[action])
|
||||
|
||||
|
||||
# Called to get all the events for the remappable actions
|
||||
func get_events(actions_: Dictionary, reset: bool = false) -> Dictionary:
|
||||
var events_: Dictionary = {}
|
||||
|
||||
if PanelOwnerRef.noSaveFile or PanelOwnerRef.invalidSaveFile or reset:
|
||||
InputMap.load_from_project_settings()
|
||||
for action in actions_:
|
||||
# Retrieve the first event for the action
|
||||
events_[action] = InputMap.action_get_events(action)[0]
|
||||
panelCache_ = events_.duplicate(true)
|
||||
else:
|
||||
# Retrieve the events from the loaded data
|
||||
events_ = PanelOwnerRef.inputSettingsData_.duplicate()
|
||||
|
||||
return events_
|
||||
|
||||
|
||||
func on_reset_button_pressed():
|
||||
panelCache_.clear()
|
||||
create_action_list(true)
|
||||
ApplyButtonRef.set_disabled(false)
|
||||
|
||||
|
||||
func on_back_button_pressed():
|
||||
# Check if there have been any changes made
|
||||
if ApplyButtonRef.is_disabled():
|
||||
# Clear the cache and return normally
|
||||
panelCache_.clear()
|
||||
hide()
|
||||
owner.SettingsPanelRef.show()
|
||||
else:
|
||||
# Display the discard changes popup
|
||||
owner.display_discard_changes(self)
|
||||
|
||||
|
||||
func on_apply_button_pressed():
|
||||
# Update the input map
|
||||
update_action_events(panelCache_)
|
||||
panelCache_.clear()
|
||||
# Send the new data to the parent element
|
||||
PanelOwnerRef.panel_settings_changed(actionEvents_)
|
||||
ApplyButtonRef.set_disabled(true)
|
||||
"
|
||||
|
||||
[node name="InputSettingsPanel" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_0eq0v")
|
||||
InputButtonScene = ExtResource("1_1y7ch")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -194.0
|
||||
offset_top = -29.0
|
||||
offset_right = 194.0
|
||||
offset_bottom = 30.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer"]
|
||||
custom_minimum_size = Vector2(0, 280)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/PanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ActionList" type="VBoxContainer" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/ScrollContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="ResetButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
focus_mode = 0
|
||||
text = "Reset to default"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ApplyButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_direction = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
disabled = true
|
||||
text = "Apply"
|
||||
|
||||
[node name="BackButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_direction = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
text = "Back"
|
||||
@@ -0,0 +1,165 @@
|
||||
[gd_scene format=3 uid="uid://i0w5gftb0j16"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cqqhgk8ufkmqa" path="res://addons/modular-settings-menu/scenes/settings-elements/controls-elements/input-settings-panel/input_settings_panel.tscn" id="1_6pc66"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_te2ja"]
|
||||
resource_name = "input_settings"
|
||||
script/source = "extends ButtonElement
|
||||
|
||||
##List of actions to make remappable and how the name they should display.
|
||||
@export var ACTION_LIST_: Dictionary = {
|
||||
\"ui_up\": \"Up\",
|
||||
\"ui_down\": \"Down\",
|
||||
\"ui_left\": \"Left\",
|
||||
\"ui_right\": \"Right\",
|
||||
}
|
||||
|
||||
# Path to the settings save file
|
||||
var DATA_FOLDER: String = SettingsDataManager.DATA_FOLDER
|
||||
const FILE_NAME: String = \"keybinds\"
|
||||
const FILE_EXTENSION: String = \".json\"
|
||||
var PATH: String = DATA_FOLDER + \"/\" + FILE_NAME + FILE_EXTENSION
|
||||
|
||||
# Currently stored input data
|
||||
var inputSettingsData_: Dictionary
|
||||
|
||||
# Flag for checking if a save file exists for input settings
|
||||
var noSaveFile: bool
|
||||
# Flag for checking if an invalid value was found in the save file
|
||||
var invalidSaveFile: bool = false
|
||||
|
||||
|
||||
func _ready():
|
||||
super._ready()
|
||||
ACTION_LIST_.make_read_only()
|
||||
SettingsDataManager.connect(\"settings_retrieved\", load_settings)
|
||||
# Verify the directory
|
||||
DirAccess.make_dir_absolute(DATA_FOLDER)
|
||||
# Check if a save file exists
|
||||
if not FileAccess.file_exists(PATH):
|
||||
noSaveFile = true
|
||||
|
||||
|
||||
# Loads the saved/default values of the element
|
||||
func load_settings() -> void:
|
||||
# Get the current value for the element
|
||||
if noSaveFile:
|
||||
# Get the events for the remappable actions from the project settings
|
||||
inputSettingsData_ = ElementPanelRef.get_events(ACTION_LIST_)
|
||||
save_input_settings()
|
||||
else:
|
||||
get_input_settings()
|
||||
|
||||
# Check if save file is valid
|
||||
if invalidSaveFile:
|
||||
# Get the events for the remappable actions from the project settings
|
||||
inputSettingsData_ = ElementPanelRef.get_events(ACTION_LIST_)
|
||||
save_input_settings()
|
||||
else:
|
||||
call_deferred(\"apply_settings\")
|
||||
|
||||
|
||||
func pressed() -> void:
|
||||
# Check if a save file exists
|
||||
if not FileAccess.file_exists(PATH):
|
||||
noSaveFile = true
|
||||
|
||||
ElementPanelRef.create_action_list()
|
||||
# Switch panels
|
||||
ParentRef.SettingsMenuRef.SettingsPanelRef.hide()
|
||||
ElementPanelRef.show()
|
||||
|
||||
|
||||
# Called to apply the settings in the settings cache
|
||||
func apply_settings() -> void:
|
||||
# Assign the events for the remappable actions
|
||||
ElementPanelRef.update_action_events(inputSettingsData_)
|
||||
|
||||
|
||||
# Called to update the input settings data
|
||||
func panel_settings_changed(newValue_: Dictionary) -> void:
|
||||
inputSettingsData_ = newValue_.duplicate()
|
||||
save_input_settings()
|
||||
|
||||
|
||||
# Called to save the input settings
|
||||
func save_input_settings() -> void:
|
||||
var file := FileAccess.open(PATH, FileAccess.WRITE)
|
||||
var data_: Dictionary = {}
|
||||
|
||||
# Itterate through the input settings
|
||||
for input in inputSettingsData_:
|
||||
var inputEvent = inputSettingsData_[input]
|
||||
# Serialize the InputEvent of the action
|
||||
match inputEvent.get_class():
|
||||
\"InputEventKey\":
|
||||
data_[input] = {
|
||||
\"type\": \"keyboard\",
|
||||
\"key\": inputEvent.get_keycode()
|
||||
}
|
||||
\"InputEventMouseButton\":
|
||||
data_[input] = {
|
||||
\"type\": \"mouse\",
|
||||
\"button\": inputEvent.get_button_index()
|
||||
}
|
||||
|
||||
# Save the string to a json file
|
||||
file.store_string(JSON.stringify(data_, \"\\t\", false))
|
||||
file.close()
|
||||
noSaveFile = false
|
||||
|
||||
|
||||
# Called to retrieve the input settings data from the save file
|
||||
func get_input_settings() -> void:
|
||||
var file := FileAccess.open(PATH, FileAccess.READ)
|
||||
# Parse the json string to a dictionary
|
||||
var data_ = JSON.parse_string(file.get_as_text())
|
||||
file.close()
|
||||
|
||||
# Check if there were any errors or if the save file is empty
|
||||
if data_ == null or data_.is_empty():
|
||||
push_error(\"Failed to parse input settings\")
|
||||
invalidSaveFile = true
|
||||
return
|
||||
|
||||
verify_settings_data(data_)
|
||||
|
||||
|
||||
# Used for verifying the integrity of the save file
|
||||
func verify_settings_data(data_: Dictionary) -> void:
|
||||
# Itterate through all the retrieved data
|
||||
for input in data_:
|
||||
# Check if the action exists
|
||||
if not ACTION_LIST_.has(input):
|
||||
push_warning(\"Invalid input settings entry: \", input)
|
||||
invalidSaveFile = true
|
||||
continue
|
||||
|
||||
# Reconstruct the InputEvent for the action
|
||||
match data_[input][\"type\"]:
|
||||
\"keyboard\":
|
||||
var key := InputEventKey.new()
|
||||
key.set_keycode(data_[input][\"key\"])
|
||||
inputSettingsData_[input] = key
|
||||
\"mouse\":
|
||||
var button := InputEventMouseButton.new()
|
||||
button.set_button_index(data_[input][\"button\"])
|
||||
inputSettingsData_[input] = button
|
||||
|
||||
# Itterate through all the expected actions
|
||||
for action in ACTION_LIST_:
|
||||
if not data_.has(action):
|
||||
data_[action] = InputMap.action_get_events(action)[0]
|
||||
invalidSaveFile = true
|
||||
push_warning(\"Input action is missing: \", action)
|
||||
"
|
||||
|
||||
[node name="InputSettings" type="Button"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Input Settings"
|
||||
script = SubResource("GDScript_te2ja")
|
||||
ElementPanelScene = ExtResource("1_6pc66")
|
||||
@@ -0,0 +1,37 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://c2tgt7fu0n5wp"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_te2ja"]
|
||||
resource_name = "invert_y"
|
||||
script/source = "extends ToggleElement
|
||||
|
||||
|
||||
# Called to apply the settings in the settings cache
|
||||
func _apply_settings() -> void:
|
||||
apply_in_game_setting(currentValue)
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="InvertY" type="HBoxContainer" node_paths=PackedStringArray("ToggleRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_te2ja")
|
||||
ToggleRef = NodePath("Toggle")
|
||||
IDENTIFIER = "InvertY"
|
||||
IS_IN_GAME_SETTING = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Invert Y-Axis"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Toggle" type="CheckButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,60 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cy8n6yalxprb7"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_s1j2c"]
|
||||
resource_name = "sensitivity"
|
||||
script/source = "extends SliderElement
|
||||
|
||||
|
||||
# Element specific script for applying its value to the game
|
||||
func _apply_settings() -> void:
|
||||
apply_in_game_setting(currentValue)
|
||||
"
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_hlot4"]
|
||||
size = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_4i2xw"]
|
||||
SpinBox/icons/updown = SubResource("PlaceholderTexture2D_hlot4")
|
||||
|
||||
[node name="Sensitivity" type="HBoxContainer" node_paths=PackedStringArray("SliderRef", "ValueBoxRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_s1j2c")
|
||||
MAX_VALUE = 5.0
|
||||
STEP_VALUE = 0.01
|
||||
SliderRef = NodePath("SliderValue/Slider")
|
||||
ValueBoxRef = NodePath("SliderValue/Value")
|
||||
IDENTIFIER = "Sensitivity"
|
||||
IS_IN_GAME_SETTING = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Mouse Sensitivity"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SliderValue" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="Slider" type="HSlider" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="Value" type="SpinBox" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 4
|
||||
theme = SubResource("Theme_4i2xw")
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
alignment = 2
|
||||
@@ -0,0 +1,94 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dvkksl3mrnoto"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_pvp7f"]
|
||||
resource_name = "discard_changes_popup"
|
||||
script/source = "extends PanelContainer
|
||||
|
||||
@onready var YesButtonRef: Button = %YesButton
|
||||
@onready var NoButtonRef: Button = %NoButton
|
||||
|
||||
var CallerRef: Control
|
||||
|
||||
|
||||
func _ready():
|
||||
# Connect necessary signals
|
||||
YesButtonRef.connect(\"pressed\", yes_button_pressed)
|
||||
NoButtonRef.connect(\"pressed\", no_button_pressed)
|
||||
connect(\"hidden\", on_hidden)
|
||||
|
||||
|
||||
func yes_button_pressed() -> void:
|
||||
# Check if the panel this belongs to has the \"discard changes\" function
|
||||
if CallerRef.has_method(\"discard_changes\"):
|
||||
CallerRef.discard_changes()
|
||||
|
||||
# Disable the panel's apply button
|
||||
CallerRef.ApplyButtonRef.set_disabled(true)
|
||||
CallerRef.on_back_button_pressed()
|
||||
|
||||
# Reset the changed elements count
|
||||
SettingsDataManager.changedElementsCount = 0
|
||||
|
||||
hide()
|
||||
|
||||
|
||||
func no_button_pressed() -> void:
|
||||
hide()
|
||||
|
||||
|
||||
func on_hidden() -> void:
|
||||
CallerRef = null
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kuxy"]
|
||||
bg_color = Color(0.162066, 0.162066, 0.162065, 1)
|
||||
corner_radius_top_left = 4
|
||||
corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
||||
[node name="DiscardChangesPopup" type="PanelContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_pvp7f")
|
||||
|
||||
[node name="PopupWindow" type="PanelContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_8kuxy")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PopupWindow"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PopupWindow/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="Text" type="Label" parent="PopupWindow/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Would you like to discard
|
||||
all changes done?"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PopupWindow/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="YesButton" type="Button" parent="PopupWindow/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Yes"
|
||||
|
||||
[node name="NoButton" type="Button" parent="PopupWindow/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "No"
|
||||
@@ -0,0 +1,63 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://elu1vc0ox472"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_1rk38"]
|
||||
resource_name = "fov"
|
||||
script/source = "extends SliderElement
|
||||
|
||||
|
||||
# Element specific script for applying its value to the game
|
||||
func _apply_settings() -> void:
|
||||
apply_in_game_setting(currentValue)
|
||||
"
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_hlot4"]
|
||||
size = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_4i2xw"]
|
||||
SpinBox/icons/updown = SubResource("PlaceholderTexture2D_hlot4")
|
||||
|
||||
[node name="FOV" type="HBoxContainer" node_paths=PackedStringArray("SliderRef", "ValueBoxRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_1rk38")
|
||||
MIN_VALUE = 30.0
|
||||
MAX_VALUE = 120.0
|
||||
STEP_VALUE = 1.0
|
||||
DEFAULT_VALUE = 75.0
|
||||
VALUE_SUFFIX = "°"
|
||||
SliderRef = NodePath("SliderValue/Slider")
|
||||
ValueBoxRef = NodePath("SliderValue/Value")
|
||||
IDENTIFIER = "FOV"
|
||||
IS_IN_GAME_SETTING = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Field of View"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SliderValue" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="Slider" type="HSlider" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="Value" type="SpinBox" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 4
|
||||
theme = SubResource("Theme_4i2xw")
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
alignment = 2
|
||||
@@ -0,0 +1,83 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://csg6c3uuct1ls"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_5w56l"]
|
||||
resource_name = "anti_aliasing"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = [
|
||||
\"Disabled\",
|
||||
\"FXAA\",
|
||||
\"2x MSAA\",
|
||||
\"4x MSAA\",
|
||||
\"8x MSAA\",
|
||||
\"TAA\"
|
||||
]
|
||||
|
||||
|
||||
func _apply_settings() -> void:
|
||||
# Enables the selected anti aliasing
|
||||
match currentValue:
|
||||
\"Disabled\":
|
||||
set_anti_aliasing_mode()
|
||||
\"FXAA\":
|
||||
set_anti_aliasing_mode(Viewport.SCREEN_SPACE_AA_FXAA)
|
||||
\"2x MSAA\":
|
||||
set_anti_aliasing_mode(
|
||||
Viewport.SCREEN_SPACE_AA_DISABLED,
|
||||
Viewport.MSAA_2X
|
||||
)
|
||||
\"4x MSAA\":
|
||||
set_anti_aliasing_mode(
|
||||
Viewport.SCREEN_SPACE_AA_DISABLED,
|
||||
Viewport.MSAA_4X
|
||||
)
|
||||
\"8x MSAA\":
|
||||
set_anti_aliasing_mode(
|
||||
Viewport.SCREEN_SPACE_AA_DISABLED,
|
||||
Viewport.MSAA_8X
|
||||
)
|
||||
\"TAA\":
|
||||
set_anti_aliasing_mode(
|
||||
Viewport.SCREEN_SPACE_AA_DISABLED,
|
||||
Viewport.MSAA_DISABLED, true
|
||||
)
|
||||
|
||||
|
||||
# Sets the anti aliasing mode according to the values provided
|
||||
func set_anti_aliasing_mode(
|
||||
fxaaMode: Viewport.ScreenSpaceAA = Viewport.SCREEN_SPACE_AA_DISABLED,
|
||||
msaaMode: Viewport.MSAA = Viewport.MSAA_DISABLED,
|
||||
taaMode: bool = false
|
||||
) -> void:
|
||||
get_viewport().set_screen_space_aa(fxaaMode)
|
||||
get_viewport().set_msaa_3d(msaaMode)
|
||||
get_viewport().set_use_taa(taaMode)
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="AntiAliasing" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_5w56l")
|
||||
DEFAULT_VALUE = "Disabled"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "AntiAliasing"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Anti Aliasing"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,53 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://3ckate3v614f"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_mnbyt"]
|
||||
resource_name = "depth_of_field"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Disabled\": null,
|
||||
\"Low\": RenderingServer.DOF_BLUR_QUALITY_LOW,
|
||||
\"Medium\": RenderingServer.DOF_BLUR_QUALITY_MEDIUM,
|
||||
\"High\": RenderingServer.DOF_BLUR_QUALITY_HIGH
|
||||
}
|
||||
|
||||
|
||||
func _apply_settings() -> void:
|
||||
if not apply_in_game_setting(currentValue):
|
||||
if currentValue == \"Disabled\":
|
||||
return
|
||||
|
||||
RenderingServer.camera_attributes_set_dof_blur_quality(
|
||||
OPTION_LIST_[currentValue],
|
||||
true
|
||||
)
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="DepthOfField" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_mnbyt")
|
||||
DEFAULT_VALUE = "Disabled"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "DepthOfField"
|
||||
IS_IN_GAME_SETTING = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Depth of Field"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,109 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://byff0jwaicxvr"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_duwn0"]
|
||||
resource_name = "display_mode"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Fullscreen\": DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN,
|
||||
\"Borderless Windowed\": DisplayServer.WINDOW_MODE_WINDOWED,
|
||||
\"Windowed\": DisplayServer.WINDOW_MODE_WINDOWED
|
||||
}
|
||||
|
||||
|
||||
func load_settings() -> void:
|
||||
super.load_settings()
|
||||
# Check if the resolution element should be disabled
|
||||
call_deferred(\"check_resolution\")
|
||||
|
||||
|
||||
func option_selected(index: int) -> void:
|
||||
super.option_selected(index)
|
||||
# Check if the resolution element should be disabled
|
||||
check_resolution()
|
||||
|
||||
|
||||
func _apply_settings() -> void:
|
||||
DisplayServer.window_set_mode(OPTION_LIST_[currentValue])
|
||||
|
||||
if currentValue == \"Borderless Windowed\":
|
||||
DisplayServer.window_set_flag(
|
||||
DisplayServer.WINDOW_FLAG_BORDERLESS,
|
||||
true
|
||||
)
|
||||
adjust_resolution()
|
||||
else:
|
||||
DisplayServer.window_set_flag(
|
||||
DisplayServer.WINDOW_FLAG_BORDERLESS,
|
||||
false
|
||||
)
|
||||
|
||||
if currentValue == \"Windowed\":
|
||||
# Set the resolution to 80% if the resolution setting doesnt exist
|
||||
if not ParentRef.ELEMENT_REFERENCE_TABLE_.has(\"Resolution\"):
|
||||
adjust_resolution(0.8)
|
||||
return
|
||||
|
||||
# Apply the selected resolution manually if it has not been changed
|
||||
if not ParentRef.changedElements_.has(\"Resolution\"):
|
||||
# Resolution change has to be delayed by at least 2 frames.
|
||||
# Otherwise height of the window will be off by a bit.
|
||||
await get_tree().process_frame
|
||||
await get_tree().process_frame
|
||||
# Apply the resolution settings manually
|
||||
ParentRef.ELEMENT_REFERENCE_TABLE_[\"Resolution\"]._apply_settings()
|
||||
|
||||
|
||||
# Called to check if the resolution element should be disabled
|
||||
func check_resolution() -> void:
|
||||
if not ParentRef.ELEMENT_REFERENCE_TABLE_.has(\"Resolution\"):
|
||||
return
|
||||
|
||||
var ResolutionRef: SettingsElement =\\
|
||||
ParentRef.ELEMENT_REFERENCE_TABLE_[\"Resolution\"]
|
||||
|
||||
if currentValue != \"Windowed\":
|
||||
ResolutionRef.OptionsRef.set_disabled(true)
|
||||
else:
|
||||
ResolutionRef.OptionsRef.set_disabled(false)
|
||||
|
||||
|
||||
# Called to scale the resolution to the provided percentage
|
||||
func adjust_resolution(sizeScale: float = 1.0) -> void:
|
||||
var displaySize: Vector2i =\\
|
||||
DisplayServer.screen_get_size(
|
||||
DisplayServer.window_get_current_screen()
|
||||
) * sizeScale
|
||||
|
||||
get_window().set_size(displaySize)
|
||||
get_viewport().set_size(displaySize)
|
||||
get_window().move_to_center()
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="DisplayMode" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_duwn0")
|
||||
DEFAULT_VALUE = "Fullscreen"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "DisplayMode"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Display Mode"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,55 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://du5urp5d2dyjb"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_7hlvr"]
|
||||
resource_name = "glow_quality"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = [
|
||||
\"Disabled\",
|
||||
\"Low\",
|
||||
\"High\"
|
||||
]
|
||||
|
||||
|
||||
func _apply_settings() -> void:
|
||||
apply_in_game_setting(currentValue)
|
||||
|
||||
if currentValue == \"Disabled\":
|
||||
return
|
||||
|
||||
# Toggle bicubic upscaling
|
||||
match currentValue:
|
||||
\"Low\":
|
||||
RenderingServer.environment_glow_set_use_bicubic_upscale(false)
|
||||
\"High\":
|
||||
RenderingServer.environment_glow_set_use_bicubic_upscale(true)
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="GlowQuality" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_7hlvr")
|
||||
DEFAULT_VALUE = "Disabled"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "GlowQuality"
|
||||
IS_IN_GAME_SETTING = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Glow Quality"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,85 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dghfxwcbi5ig"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_eitn6"]
|
||||
resource_name = "max_fps"
|
||||
script/source = "extends SliderElement
|
||||
|
||||
|
||||
func init_element() -> void:
|
||||
super.init_element()
|
||||
# Increase UI max value by one for unlimited fps
|
||||
SliderRef.set_max(MAX_VALUE + 1)
|
||||
if ValueBoxRef is SpinBox:
|
||||
ValueBoxRef.set_max(MAX_VALUE + 1)
|
||||
|
||||
|
||||
func load_settings() -> void:
|
||||
super.load_settings()
|
||||
if currentValue == 0:
|
||||
ValueBoxRef.set_text(\"Unlimited\")
|
||||
SliderRef.set_value(MAX_VALUE + 1)
|
||||
|
||||
|
||||
func value_changed(value: float) -> void:
|
||||
if value > MAX_VALUE:
|
||||
value = 0
|
||||
ValueBoxRef.set_text(\"Unlimited\")
|
||||
|
||||
super.value_changed(value)
|
||||
|
||||
|
||||
|
||||
# Element specific script for applying its value to the game
|
||||
func _apply_settings() -> void:
|
||||
if (
|
||||
ParentRef.ELEMENT_REFERENCE_TABLE_.has(\"VSync\")
|
||||
and ParentRef.ELEMENT_REFERENCE_TABLE_[\"VSync\"].currentValue != \"Disabled\"
|
||||
):
|
||||
return
|
||||
|
||||
Engine.set_max_fps(currentValue)
|
||||
"
|
||||
|
||||
[node name="MaxFPS" type="HBoxContainer" node_paths=PackedStringArray("SliderRef", "ValueBoxRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_eitn6")
|
||||
MIN_VALUE = 30.0
|
||||
MAX_VALUE = 240.0
|
||||
STEP_VALUE = 1.0
|
||||
DEFAULT_VALUE = 60.0
|
||||
SliderRef = NodePath("SliderValue/Slider")
|
||||
ValueBoxRef = NodePath("SliderValue/Value")
|
||||
IDENTIFIER = "MaxFPS"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Max FPS"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SliderValue" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="Slider" type="HSlider" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="Value" type="Label" parent="SliderValue"]
|
||||
custom_minimum_size = Vector2(80, 31)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 1
|
||||
text = "240"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
@@ -0,0 +1,64 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cn8r63dmvd55c"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_utf5l"]
|
||||
resource_name = "resolution"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
## Toggle window resizing by the user.
|
||||
@export var RESIZABLE: bool = false
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"3840x2160\": Vector2i(3840, 2160),
|
||||
\"2560x1440\": Vector2i(2560, 1440),
|
||||
\"1920x1080\": Vector2i(1920, 1080),
|
||||
\"1280x720\": Vector2i(1280, 720),
|
||||
\"960x540\": Vector2i(960, 540)
|
||||
}
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
# Toggle window resizing
|
||||
DisplayServer.window_set_flag(
|
||||
DisplayServer.WINDOW_FLAG_RESIZE_DISABLED,
|
||||
!RESIZABLE
|
||||
)
|
||||
|
||||
|
||||
func _apply_settings() -> void:
|
||||
if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN:
|
||||
return
|
||||
|
||||
if DisplayServer.window_get_flag(DisplayServer.WINDOW_FLAG_BORDERLESS):
|
||||
return
|
||||
|
||||
# Change the window size to the selected resolution
|
||||
get_window().set_size(OPTION_LIST_[currentValue])
|
||||
get_viewport().set_size(OPTION_LIST_[currentValue])
|
||||
get_window().move_to_center()
|
||||
"
|
||||
|
||||
[node name="Resolution" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_utf5l")
|
||||
DEFAULT_VALUE = "1920x1080"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "Resolution"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Resolution"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
@@ -0,0 +1,41 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://5dydkttc2fww"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_usma2"]
|
||||
resource_name = "fsr_options"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Ultra Quality\": 0.77,
|
||||
\"Quality\": 0.67,
|
||||
\"Balanced\": 0.59,
|
||||
\"Performance\": 0.5
|
||||
}
|
||||
|
||||
|
||||
func _apply_settings() -> void:
|
||||
get_viewport().set_scaling_3d_scale(OPTION_LIST_[currentValue])
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="FSRMode" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
size_flags_vertical = 3
|
||||
script = SubResource("GDScript_usma2")
|
||||
DEFAULT_VALUE = "Balanced"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "FSRMode"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "FSR Mode"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,61 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bdoaqhvw440eh"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_ng2w8"]
|
||||
resource_name = "fsr_sharpness"
|
||||
script/source = "extends SliderElement
|
||||
|
||||
|
||||
# Element specific script for applying its value to the game
|
||||
func _apply_settings() -> void:
|
||||
get_viewport().set_fsr_sharpness((MAX_VALUE - currentValue) * 2.0)
|
||||
"
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_hae3h"]
|
||||
size = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_0xoq4"]
|
||||
SpinBox/icons/updown = SubResource("PlaceholderTexture2D_hae3h")
|
||||
|
||||
[node name="FSRSharpness" type="HBoxContainer" node_paths=PackedStringArray("SliderRef", "ValueBoxRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_ng2w8")
|
||||
STEP_VALUE = 0.01
|
||||
DEFAULT_VALUE = 0.9
|
||||
DISPLAY_PERCENT_VALUE = true
|
||||
VALUE_SUFFIX = "%"
|
||||
SliderRef = NodePath("SliderValue/Slider")
|
||||
ValueBoxRef = NodePath("SliderValue/Value")
|
||||
IDENTIFIER = "FSRSharpness"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "FSR Sharpness"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SliderValue" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="Slider" type="HSlider" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="Value" type="SpinBox" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 4
|
||||
theme = SubResource("Theme_0xoq4")
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
alignment = 2
|
||||
@@ -0,0 +1,62 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://ha87l3hl643g"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_7dhl4"]
|
||||
resource_name = "resolution_scale"
|
||||
script/source = "extends SliderElement
|
||||
|
||||
|
||||
# Element specific script for applying its value to the game
|
||||
func _apply_settings() -> void:
|
||||
get_viewport().set_scaling_3d_scale(currentValue)
|
||||
"
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_hae3h"]
|
||||
size = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_0xoq4"]
|
||||
SpinBox/icons/updown = SubResource("PlaceholderTexture2D_hae3h")
|
||||
|
||||
[node name="ResolutionScale" type="HBoxContainer" node_paths=PackedStringArray("SliderRef", "ValueBoxRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_7dhl4")
|
||||
MIN_VALUE = 0.5
|
||||
MAX_VALUE = 2.0
|
||||
STEP_VALUE = 0.01
|
||||
DISPLAY_PERCENT_VALUE = true
|
||||
VALUE_SUFFIX = "%"
|
||||
SliderRef = NodePath("SliderValue/Slider")
|
||||
ValueBoxRef = NodePath("SliderValue/Value")
|
||||
IDENTIFIER = "ResolutionScale"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Resolution Scale"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SliderValue" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="Slider" type="HSlider" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="Value" type="SpinBox" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 4
|
||||
theme = SubResource("Theme_0xoq4")
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
alignment = 2
|
||||
@@ -0,0 +1,128 @@
|
||||
[gd_scene format=3 uid="uid://b3w7qpn4nhmu2"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ha87l3hl643g" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/scaler-sub-elements/resolution_scale.tscn" id="1_4irey"]
|
||||
[ext_resource type="PackedScene" uid="uid://5dydkttc2fww" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/scaler-sub-elements/fsr_mode.tscn" id="2_w65g1"]
|
||||
[ext_resource type="PackedScene" uid="uid://bdoaqhvw440eh" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/scaler-sub-elements/fsr_sharpness.tscn" id="3_v8pix"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_bn0b0"]
|
||||
resource_name = "scaler"
|
||||
script/source = "extends MultiElement
|
||||
|
||||
|
||||
func _display_sub_elements() -> void:
|
||||
match currentValue:
|
||||
\"Disabled\":
|
||||
for element in SUB_ELEMENTS_:
|
||||
element.hide()
|
||||
\"Bilinear\":
|
||||
SUB_ELEMENTS_[0].show()
|
||||
SUB_ELEMENTS_[1].hide()
|
||||
SUB_ELEMENTS_[2].hide()
|
||||
\"FSR 2.2\":
|
||||
SUB_ELEMENTS_[0].hide()
|
||||
SUB_ELEMENTS_[1].show()
|
||||
SUB_ELEMENTS_[2].show()
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_mdyud"]
|
||||
resource_name = "scaling_mode"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Disabled\": Viewport.SCALING_3D_MODE_BILINEAR,
|
||||
\"Bilinear\": Viewport.SCALING_3D_MODE_BILINEAR,
|
||||
\"FSR 2.2\": Viewport.SCALING_3D_MODE_FSR2
|
||||
}
|
||||
|
||||
|
||||
# Loads the saved/default values of the element
|
||||
func load_settings() -> void:
|
||||
super.load_settings()
|
||||
# Check if TAA is selected
|
||||
call_deferred(\"check_anti_aliasing\")
|
||||
|
||||
|
||||
func option_selected(index: int) -> void:
|
||||
super.option_selected(index)
|
||||
# Check if TAA is selected
|
||||
check_anti_aliasing()
|
||||
|
||||
|
||||
# Called to apply the settings in the settings cache
|
||||
func _apply_settings() -> void:
|
||||
get_viewport().set_scaling_3d_mode(OPTION_LIST_[currentValue])
|
||||
if currentValue == \"Disabled\":
|
||||
get_viewport().set_scaling_3d_scale(1.0)
|
||||
|
||||
|
||||
# Checks if TAA is selected while FSR 2.2 is enabled
|
||||
func check_anti_aliasing() -> void:
|
||||
if not ParentRef.ELEMENT_REFERENCE_TABLE_.has(\"AntiAliasing\"):
|
||||
return
|
||||
|
||||
var AntiAliasingRef: SettingsElement =\\
|
||||
ParentRef.ELEMENT_REFERENCE_TABLE_[\"AntiAliasing\"]
|
||||
var taaIndex: int = AntiAliasingRef.OPTION_LIST_.find(\"TAA\")
|
||||
|
||||
if currentValue != \"FSR 2.2\":
|
||||
AntiAliasingRef.OptionsRef.set_item_disabled(
|
||||
taaIndex,
|
||||
false
|
||||
)
|
||||
return
|
||||
|
||||
AntiAliasingRef.OptionsRef.set_item_disabled(
|
||||
taaIndex,
|
||||
true
|
||||
)
|
||||
if AntiAliasingRef.currentValue == \"TAA\":
|
||||
var disabledIndex: int = AntiAliasingRef.OPTION_LIST_.find(\"Disabled\")
|
||||
# Reselect the anti aliasing mode
|
||||
AntiAliasingRef.OptionsRef.select(disabledIndex)
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="Scaler" type="VBoxContainer" node_paths=PackedStringArray("MainElementRef", "SUB_ELEMENTS_")]
|
||||
offset_top = 51.0
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 51.0
|
||||
script = SubResource("GDScript_bn0b0")
|
||||
MainElementRef = NodePath("ScalingMode")
|
||||
SUB_ELEMENTS_ = [NodePath("ResolutionScale"), NodePath("FSRMode"), NodePath("FSRSharpness")]
|
||||
|
||||
[node name="ScalingMode" type="HBoxContainer" parent="." node_paths=PackedStringArray("OptionsRef")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = SubResource("GDScript_mdyud")
|
||||
DEFAULT_VALUE = "Disabled"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "ScalingMode"
|
||||
|
||||
[node name="Label" type="Label" parent="ScalingMode"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Scaling Mode"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="ScalingMode"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
|
||||
[node name="ResolutionScale" parent="." instance=ExtResource("1_4irey")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="FSRMode" parent="." instance=ExtResource("2_w65g1")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="FSRSharpness" parent="." instance=ExtResource("3_v8pix")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
@@ -0,0 +1,53 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ddykljx6ndodi"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_6k8bu"]
|
||||
resource_name = "sdfgi_quality"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Disabled\": null,
|
||||
\"Low\": RenderingServer.ENV_SDFGI_RAY_COUNT_8,
|
||||
\"Medium\": RenderingServer.ENV_SDFGI_RAY_COUNT_32,
|
||||
\"High\": RenderingServer.ENV_SDFGI_RAY_COUNT_96
|
||||
}
|
||||
|
||||
|
||||
# Called to apply the settings in the settings cache
|
||||
func apply_settings() -> void:
|
||||
apply_in_game_setting(currentValue)
|
||||
|
||||
if currentValue == \"Disabled\":
|
||||
return
|
||||
|
||||
RenderingServer.environment_set_sdfgi_ray_count(OPTION_LIST_[currentValue])
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="SDFGIQuality" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
tooltip_text = "Signed Distance Field Global Illumination"
|
||||
script = SubResource("GDScript_6k8bu")
|
||||
DEFAULT_VALUE = "Disabled"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "SDFGIQuality"
|
||||
IS_IN_GAME_SETTING = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "SDFGI Quality"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,50 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cgqiotob5aaoq"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_v3ktk"]
|
||||
resource_name = "shadow_quality"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Low\": RenderingServer.SHADOW_QUALITY_SOFT_LOW,
|
||||
\"Medium\": RenderingServer.SHADOW_QUALITY_SOFT_MEDIUM,
|
||||
\"High\": RenderingServer.SHADOW_QUALITY_SOFT_HIGH
|
||||
}
|
||||
|
||||
|
||||
# Called to apply the settings in the settings cache
|
||||
func _apply_settings() -> void:
|
||||
RenderingServer.directional_soft_shadow_filter_set_quality(
|
||||
OPTION_LIST_[currentValue]
|
||||
)
|
||||
RenderingServer.positional_soft_shadow_filter_set_quality(
|
||||
OPTION_LIST_[currentValue]
|
||||
)
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="ShadowQuality" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_v3ktk")
|
||||
DEFAULT_VALUE = "Low"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "ShadowQuality"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Shadow Quality"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,78 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bk5ky60jln7ag"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_h10e0"]
|
||||
resource_name = "ssao_quality"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Disabled\": null,
|
||||
\"Low\": {
|
||||
\"quality\": RenderingServer.ENV_SSAO_QUALITY_LOW,
|
||||
\"halfSize\": true,
|
||||
\"blurPasses\": 1,
|
||||
\"fadeOutFrom\": 25,
|
||||
\"fadeOutTo\": 150
|
||||
},
|
||||
\"Medium\": {
|
||||
\"quality\": RenderingServer.ENV_SSAO_QUALITY_MEDIUM,
|
||||
\"halfSize\": true,
|
||||
\"blurPasses\": 2,
|
||||
\"fadeOutFrom\": 50,
|
||||
\"fadeOutTo\": 300
|
||||
},
|
||||
\"High\": {
|
||||
\"quality\": RenderingServer.ENV_SSAO_QUALITY_HIGH,
|
||||
\"halfSize\": false,
|
||||
\"blurPasses\": 4,
|
||||
\"fadeOutFrom\": 100,
|
||||
\"fadeOutTo\": 600
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Called to apply the settings in the settings cache
|
||||
func _apply_settings() -> void:
|
||||
apply_in_game_setting(currentValue)
|
||||
|
||||
if currentValue == \"Disabled\":
|
||||
return
|
||||
|
||||
RenderingServer.environment_set_ssao_quality(
|
||||
OPTION_LIST_[currentValue][\"quality\"],
|
||||
OPTION_LIST_[currentValue][\"halfSize\"],
|
||||
0.5,
|
||||
OPTION_LIST_[currentValue][\"blurPasses\"],
|
||||
OPTION_LIST_[currentValue][\"fadeOutFrom\"],
|
||||
OPTION_LIST_[currentValue][\"fadeOutTo\"]
|
||||
)
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="SSAOQuality" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
tooltip_text = "Screen Space Ambient Occlusion"
|
||||
script = SubResource("GDScript_h10e0")
|
||||
DEFAULT_VALUE = "Disabled"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "SSAOQuality"
|
||||
IS_IN_GAME_SETTING = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "SSAO Quality"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,78 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bmnvig4gfqj0c"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_fwd72"]
|
||||
resource_name = "ssil_quality"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Disabled\": null,
|
||||
\"Low\": {
|
||||
\"quality\": RenderingServer.ENV_SSIL_QUALITY_LOW,
|
||||
\"halfSize\": true,
|
||||
\"blurPasses\": 2,
|
||||
\"fadeOutFrom\": 25,
|
||||
\"fadeOutTo\": 150
|
||||
},
|
||||
\"Medium\": {
|
||||
\"quality\": RenderingServer.ENV_SSIL_QUALITY_MEDIUM,
|
||||
\"halfSize\": true,
|
||||
\"blurPasses\": 4,
|
||||
\"fadeOutFrom\": 50,
|
||||
\"fadeOutTo\": 300
|
||||
},
|
||||
\"High\": {
|
||||
\"quality\": RenderingServer.ENV_SSIL_QUALITY_HIGH,
|
||||
\"halfSize\": false,
|
||||
\"blurPasses\": 8,
|
||||
\"fadeOutFrom\": 100,
|
||||
\"fadeOutTo\": 600
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Called to apply the settings in the settings cache
|
||||
func _apply_settings() -> void:
|
||||
apply_in_game_setting(currentValue)
|
||||
|
||||
if currentValue == \"Disabled\":
|
||||
return
|
||||
|
||||
RenderingServer.environment_set_ssil_quality(
|
||||
OPTION_LIST_[currentValue][\"quality\"],
|
||||
OPTION_LIST_[currentValue][\"halfSize\"],
|
||||
0.5,
|
||||
OPTION_LIST_[currentValue][\"blurPasses\"],
|
||||
OPTION_LIST_[currentValue][\"fadeOutFrom\"],
|
||||
OPTION_LIST_[currentValue][\"fadeOutTo\"]
|
||||
)
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="SSILQuality" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
tooltip_text = "Screen Space Indirect Lighting"
|
||||
script = SubResource("GDScript_fwd72")
|
||||
DEFAULT_VALUE = "Disabled"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "SSILQuality"
|
||||
IS_IN_GAME_SETTING = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "SSIL Quality"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,70 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cqfr01uk73ce5"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_v8qca"]
|
||||
resource_name = "ssr_quality"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Disabled\": null,
|
||||
\"Low\": {
|
||||
\"roughnessQuality\": RenderingServer.ENV_SSR_ROUGHNESS_QUALITY_LOW,
|
||||
\"maxSteps\": 32,
|
||||
\"fadeIn\": 0.3,
|
||||
\"fadeOut\": 1.0
|
||||
},
|
||||
\"Medium\": {
|
||||
\"roughnessQuality\": RenderingServer.ENV_SSR_ROUGHNESS_QUALITY_MEDIUM,
|
||||
\"maxSteps\": 64,
|
||||
\"fadeIn\": 0.15,
|
||||
\"fadeOut\": 2.0
|
||||
},
|
||||
\"High\": {
|
||||
\"roughnessQuality\": RenderingServer.ENV_SSR_ROUGHNESS_QUALITY_HIGH,
|
||||
\"maxSteps\": 128,
|
||||
\"fadeIn\": 0.075,
|
||||
\"fadeOut\": 4.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Called to apply the settings in the settings cache
|
||||
func _apply_settings() -> void:
|
||||
apply_in_game_setting(OPTION_LIST_[currentValue])
|
||||
|
||||
if currentValue == \"Disabled\":
|
||||
return
|
||||
|
||||
RenderingServer.environment_set_ssr_roughness_quality(
|
||||
OPTION_LIST_[currentValue][\"roughnessQuality\"]
|
||||
)
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="SSRQuality" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
tooltip_text = "Screen Space Reflection"
|
||||
script = SubResource("GDScript_v8qca")
|
||||
DEFAULT_VALUE = "Disabled"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "SSRQuality"
|
||||
IS_IN_GAME_SETTING = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "SSR Quality"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,96 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://idtbqnsqlvb6"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_kwfgn"]
|
||||
resource_name = "vsync"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Disabled\": DisplayServer.VSYNC_DISABLED,
|
||||
\"Enabled\": DisplayServer.VSYNC_ENABLED,
|
||||
\"Adaptive\": DisplayServer.VSYNC_ADAPTIVE
|
||||
}
|
||||
|
||||
|
||||
# Loads the saved/default values of the element
|
||||
func load_settings() -> void:
|
||||
super.load_settings()
|
||||
# Toggle the max fps element
|
||||
call_deferred(\"toggle_max_fps\")
|
||||
|
||||
|
||||
func option_selected(index: int) -> void:
|
||||
super.option_selected(index)
|
||||
# Toggle the max fps element
|
||||
toggle_max_fps()
|
||||
|
||||
|
||||
# Called to apply the settings in the settings cache
|
||||
func _apply_settings() -> void:
|
||||
# Set the vsync mode to the selected option
|
||||
DisplayServer.window_set_vsync_mode(OPTION_LIST_[currentValue])
|
||||
|
||||
# Set the max fps to unlimited if vsync is being enabled
|
||||
if currentValue != \"Disabled\":
|
||||
Engine.set_max_fps(0)
|
||||
|
||||
# Check if the max fps element exists and if vsync is disabled
|
||||
if (
|
||||
ParentRef.ELEMENT_REFERENCE_TABLE_.has(\"MaxFPS\")
|
||||
and currentValue == \"Disabled\"
|
||||
):
|
||||
# Check if max fps has been changed
|
||||
if not ParentRef.changedElements_.has(\"MaxFPS\"):
|
||||
# Apply the max fps settings manually
|
||||
ParentRef.ELEMENT_REFERENCE_TABLE_[\"MaxFPS\"]._apply_settings()
|
||||
elif currentValue == \"Disabled\":
|
||||
# Set the max fps to the max fps read from the project settings
|
||||
Engine.set_max_fps(ProjectSettings.get_setting(\"application/run/max_fps\"))
|
||||
|
||||
|
||||
|
||||
# Disable/Enable the max fps element according to if vsync is on or not
|
||||
func toggle_max_fps() -> void:
|
||||
if not ParentRef.ELEMENT_REFERENCE_TABLE_.has(\"MaxFPS\"):
|
||||
return
|
||||
|
||||
# Reference to the slider value node of the max fps element
|
||||
var MaxFpsRef: SettingsElement =\\
|
||||
ParentRef.ELEMENT_REFERENCE_TABLE_[\"MaxFPS\"]
|
||||
|
||||
if currentValue == \"Disabled\":
|
||||
# Enable the max fps element
|
||||
MaxFpsRef.SliderRef.set_editable(true)
|
||||
MaxFpsRef.ValueBoxRef.modulate = Color.WHITE
|
||||
else:
|
||||
# Disable the max fps element
|
||||
MaxFpsRef.SliderRef.set_editable(false)
|
||||
MaxFpsRef.ValueBoxRef.modulate = Color.GRAY
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="VSync" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_kwfgn")
|
||||
DEFAULT_VALUE = "Disabled"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "VSync"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "V-Sync"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,14 @@
|
||||
[gd_scene format=3 uid="uid://d0rkws47yf8l2"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d3nlqtnyyndrg" path="res://addons/modular-settings-menu/scripts/base-settings-elements/button_element.gd" id="1_cnjcn"]
|
||||
[ext_resource type="PackedScene" uid="uid://cwhs0kpipkxfv" path="res://addons/modular-settings-menu/scenes/settings-elements/templates/element-panel-template/element_panel_template.tscn" id="2_gbpfn"]
|
||||
|
||||
[node name="ButtonElementTemplate" type="Button"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Button Element"
|
||||
script = ExtResource("1_cnjcn")
|
||||
ElementPanelScene = ExtResource("2_gbpfn")
|
||||
@@ -0,0 +1,76 @@
|
||||
[gd_scene format=3 uid="uid://cwhs0kpipkxfv"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cyig515shrgnb" path="res://addons/modular-settings-menu/scripts/element_panel.gd" id="1_3f2r5"]
|
||||
[ext_resource type="PackedScene" uid="uid://bjcuw6amean2" path="res://addons/modular-settings-menu/scenes/settings-elements/templates/slider_element_template.tscn" id="2_fpsnu"]
|
||||
|
||||
[node name="ElementPanelTemplate" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_3f2r5")
|
||||
IDENTIFIER = "PanelTemplate"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -194.0
|
||||
offset_top = -29.0
|
||||
offset_right = 194.0
|
||||
offset_bottom = 30.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer"]
|
||||
custom_minimum_size = Vector2(0, 280)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/PanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/PanelContainer/MarginContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ElementList" type="VBoxContainer" parent="VBoxContainer/PanelContainer/MarginContainer/ScrollContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SliderElementTemplate" parent="VBoxContainer/PanelContainer/MarginContainer/ScrollContainer/MarginContainer/ElementList" instance=ExtResource("2_fpsnu")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ApplyButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_direction = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
disabled = true
|
||||
text = "Apply"
|
||||
|
||||
[node name="BackButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_direction = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
text = "Back"
|
||||
@@ -0,0 +1,46 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://vlmvkci3ptii"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_sk6j2"]
|
||||
resource_name = "option_element_template"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
# Provide the options for the element
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"None\": null,
|
||||
\"Slider\": null,
|
||||
\"Toggle\": null
|
||||
}
|
||||
|
||||
|
||||
# Called to apply the setting to the game
|
||||
func _apply_settings() -> void:
|
||||
pass
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="MainElement" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_sk6j2")
|
||||
DEFAULT_VALUE = "None"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "MainElement"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Option Element"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,43 @@
|
||||
[gd_scene format=3 uid="uid://csr6kawyf3t3i"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://vlmvkci3ptii" path="res://addons/modular-settings-menu/scenes/settings-elements/templates/multi-element-template/main_element.tscn" id="1_mhqaj"]
|
||||
[ext_resource type="PackedScene" uid="uid://bjcuw6amean2" path="res://addons/modular-settings-menu/scenes/settings-elements/templates/slider_element_template.tscn" id="2_mf8gn"]
|
||||
[ext_resource type="PackedScene" uid="uid://cxaxyqer0af21" path="res://addons/modular-settings-menu/scenes/settings-elements/templates/toggle_element_template.tscn" id="3_gs1f8"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_sk6j2"]
|
||||
resource_name = "multi_element_template"
|
||||
script/source = "extends MultiElement
|
||||
|
||||
|
||||
func _display_sub_elements() -> void:
|
||||
match currentValue:
|
||||
\"None\":
|
||||
for element in SUB_ELEMENTS_:
|
||||
element.hide()
|
||||
\"Slider\":
|
||||
SUB_ELEMENTS_[0].show()
|
||||
SUB_ELEMENTS_[1].hide()
|
||||
\"Toggle\":
|
||||
SUB_ELEMENTS_[0].hide()
|
||||
SUB_ELEMENTS_[1].show()
|
||||
"
|
||||
|
||||
[node name="MultiElementTemplate" type="VBoxContainer" node_paths=PackedStringArray("MainElementRef", "SUB_ELEMENTS_")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
script = SubResource("GDScript_sk6j2")
|
||||
MainElementRef = NodePath("MainElement")
|
||||
SUB_ELEMENTS_ = [NodePath("SliderElementTemplate"), NodePath("ToggleElementTemplate")]
|
||||
|
||||
[node name="MainElement" parent="." instance=ExtResource("1_mhqaj")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SliderElementTemplate" parent="." instance=ExtResource("2_mf8gn")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ToggleElementTemplate" parent="." instance=ExtResource("3_gs1f8")]
|
||||
layout_mode = 2
|
||||
@@ -0,0 +1,44 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dc1yif146sxav"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_sk6j2"]
|
||||
resource_name = "option_element_template"
|
||||
script/source = "extends OptionElement
|
||||
|
||||
|
||||
# Provide the options for the element
|
||||
func _init() -> void:
|
||||
OPTION_LIST_ = {
|
||||
\"Example\": null
|
||||
}
|
||||
|
||||
|
||||
# Called to apply the setting to the game
|
||||
func _apply_settings() -> void:
|
||||
pass
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="OptionElementTemplate" type="HBoxContainer" node_paths=PackedStringArray("OptionsRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_sk6j2")
|
||||
DEFAULT_VALUE = "Example"
|
||||
OptionsRef = NodePath("Options")
|
||||
IDENTIFIER = "OptionTemplate"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Option Element"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Options" type="OptionButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,78 @@
|
||||
[gd_scene format=3 uid="uid://ejplmui1twn4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3ssroxjs8wt" path="res://addons/modular-settings-menu/scripts/settings_section.gd" id="1_aglse"]
|
||||
[ext_resource type="PackedScene" uid="uid://dc1yif146sxav" path="res://addons/modular-settings-menu/scenes/settings-elements/templates/option_element_template.tscn" id="2_ws4gk"]
|
||||
[ext_resource type="PackedScene" uid="uid://csr6kawyf3t3i" path="res://addons/modular-settings-menu/scenes/settings-elements/templates/multi-element-template/multi_element_template.tscn" id="2_xre3j"]
|
||||
[ext_resource type="PackedScene" uid="uid://bjcuw6amean2" path="res://addons/modular-settings-menu/scenes/settings-elements/templates/slider_element_template.tscn" id="3_o11e6"]
|
||||
[ext_resource type="PackedScene" uid="uid://cxaxyqer0af21" path="res://addons/modular-settings-menu/scenes/settings-elements/templates/toggle_element_template.tscn" id="4_41mog"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_e0spm"]
|
||||
|
||||
[node name="SectionTemplate" type="TabBar"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/tab_focus = SubResource("StyleBoxEmpty_e0spm")
|
||||
script = ExtResource("1_aglse")
|
||||
IDENTIFIER = "ExampleSection"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
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 = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ElementList" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 24
|
||||
|
||||
[node name="ParentElementTemplate" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList" instance=ExtResource("2_xre3j")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSection" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionName" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/SubSection"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "Sub Section"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/SubSection"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionElements" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/SubSection"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="OptionElementTemplate" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/SubSection/SubSectionElements" instance=ExtResource("2_ws4gk")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SliderElementTemplate" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/SubSection/SubSectionElements" instance=ExtResource("3_o11e6")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ToggleElementTemplate" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/SubSection/SubSectionElements" instance=ExtResource("4_41mog")]
|
||||
layout_mode = 2
|
||||
@@ -0,0 +1,57 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bjcuw6amean2"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_i57rt"]
|
||||
resource_name = "slider_element_template"
|
||||
script/source = "extends SliderElement
|
||||
|
||||
|
||||
# Called to apply the setting to the game
|
||||
func _apply_settings() -> void:
|
||||
pass
|
||||
"
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_hlot4"]
|
||||
size = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_4i2xw"]
|
||||
SpinBox/icons/updown = SubResource("PlaceholderTexture2D_hlot4")
|
||||
|
||||
[node name="SliderElementTemplate" type="HBoxContainer" node_paths=PackedStringArray("SliderRef", "ValueBoxRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_i57rt")
|
||||
SliderRef = NodePath("SliderValue/Slider")
|
||||
ValueBoxRef = NodePath("SliderValue/Value")
|
||||
IDENTIFIER = "SliderTemplate"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Slider Element"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SliderValue" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="Slider" type="HSlider" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="Value" type="SpinBox" parent="SliderValue"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 4
|
||||
theme = SubResource("Theme_4i2xw")
|
||||
max_value = 0.0
|
||||
step = 0.0
|
||||
alignment = 2
|
||||
@@ -0,0 +1,36 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cxaxyqer0af21"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_bpxmf"]
|
||||
resource_name = "toggle_element_template"
|
||||
script/source = "extends ToggleElement
|
||||
|
||||
|
||||
# Called to apply the setting to the game
|
||||
func _apply_settings() -> void:
|
||||
pass
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_drjjf"]
|
||||
|
||||
[node name="ToggleElementTemplate" type="HBoxContainer" node_paths=PackedStringArray("ToggleRef")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_bpxmf")
|
||||
ToggleRef = NodePath("Toggle")
|
||||
IDENTIFIER = "ToggleTemplate"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Toggle Element"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Toggle" type="CheckButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
focus_mode = 0
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_drjjf")
|
||||
@@ -0,0 +1,74 @@
|
||||
[gd_scene format=3 uid="uid://y5oxvao3aqtb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3ssroxjs8wt" path="res://addons/modular-settings-menu/scripts/settings_section.gd" id="1_e0sxq"]
|
||||
[ext_resource type="PackedScene" uid="uid://pir75xaw2g08" path="res://addons/modular-settings-menu/scenes/settings-elements/audio-elements/master_volume.tscn" id="2_l5q4d"]
|
||||
[ext_resource type="PackedScene" uid="uid://y6kuxwyem48c" path="res://addons/modular-settings-menu/scenes/settings-elements/audio-elements/music_volume.tscn" id="3_v08xa"]
|
||||
[ext_resource type="PackedScene" uid="uid://jl3iirunm0hq" path="res://addons/modular-settings-menu/scenes/settings-elements/audio-elements/sfx_volume.tscn" id="4_j1ron"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_e0spm"]
|
||||
|
||||
[node name="Audio" type="TabBar"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/tab_focus = SubResource("StyleBoxEmpty_e0spm")
|
||||
script = ExtResource("1_e0sxq")
|
||||
IDENTIFIER = "Audio"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
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 = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ElementList" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 24
|
||||
|
||||
[node name="VolumeSettings" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionName" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/VolumeSettings"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "Volume Settings"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/VolumeSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionElements" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/VolumeSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MasterVolume" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/VolumeSettings/SubSectionElements" instance=ExtResource("2_l5q4d")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MusicVolume" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/VolumeSettings/SubSectionElements" instance=ExtResource("3_v08xa")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SFXVolume" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/VolumeSettings/SubSectionElements" instance=ExtResource("4_j1ron")]
|
||||
layout_mode = 2
|
||||
@@ -0,0 +1,86 @@
|
||||
[gd_scene format=3 uid="uid://dfswr81erouhj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3ssroxjs8wt" path="res://addons/modular-settings-menu/scripts/settings_section.gd" id="1_vmore"]
|
||||
[ext_resource type="PackedScene" uid="uid://cy8n6yalxprb7" path="res://addons/modular-settings-menu/scenes/settings-elements/controls-elements/sensitivity.tscn" id="2_qcqml"]
|
||||
[ext_resource type="PackedScene" uid="uid://c2tgt7fu0n5wp" path="res://addons/modular-settings-menu/scenes/settings-elements/controls-elements/invert_y.tscn" id="3_8np8q"]
|
||||
[ext_resource type="PackedScene" uid="uid://i0w5gftb0j16" path="res://addons/modular-settings-menu/scenes/settings-elements/controls-elements/input_settings.tscn" id="4_bejag"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_e0spm"]
|
||||
|
||||
[node name="Controls" type="TabBar"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_styles/tab_focus = SubResource("StyleBoxEmpty_e0spm")
|
||||
script = ExtResource("1_vmore")
|
||||
IDENTIFIER = "Controls"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
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 = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ElementList" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 24
|
||||
|
||||
[node name="MouseSettings" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionName" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/MouseSettings"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "Mouse Settings"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/MouseSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionElements" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/MouseSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Sensitivity" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/MouseSettings/SubSectionElements" instance=ExtResource("2_qcqml")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="InvertY" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/MouseSettings/SubSectionElements" instance=ExtResource("3_8np8q")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="KeyboardSettings" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionName" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/KeyboardSettings"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "Keyboard Settings"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/KeyboardSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionElements" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/KeyboardSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="InputSettings" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/KeyboardSettings/SubSectionElements" instance=ExtResource("4_bejag")]
|
||||
layout_mode = 2
|
||||
@@ -0,0 +1,66 @@
|
||||
[gd_scene format=3 uid="uid://c66v42g6gs7gr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3ssroxjs8wt" path="res://addons/modular-settings-menu/scripts/settings_section.gd" id="1_i11k5"]
|
||||
[ext_resource type="PackedScene" uid="uid://elu1vc0ox472" path="res://addons/modular-settings-menu/scenes/settings-elements/gameplay-elements/fov.tscn" id="2_c8t76"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_e0spm"]
|
||||
|
||||
[node name="Gameplay" type="TabBar"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/tab_focus = SubResource("StyleBoxEmpty_e0spm")
|
||||
script = ExtResource("1_i11k5")
|
||||
IDENTIFIER = "Gameplay"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
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 = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ElementList" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 24
|
||||
|
||||
[node name="GeneralSettings" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionName" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/GeneralSettings"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "General Settings"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/GeneralSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionElements" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/GeneralSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="FOV" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/GeneralSettings/SubSectionElements" instance=ExtResource("2_c8t76")]
|
||||
layout_mode = 2
|
||||
@@ -0,0 +1,129 @@
|
||||
[gd_scene format=3 uid="uid://buqq0kms2dbb4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3ssroxjs8wt" path="res://addons/modular-settings-menu/scripts/settings_section.gd" id="1_704sp"]
|
||||
[ext_resource type="PackedScene" uid="uid://byff0jwaicxvr" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/display_mode.tscn" id="1_mr6e7"]
|
||||
[ext_resource type="PackedScene" uid="uid://cn8r63dmvd55c" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/resolution.tscn" id="2_5bpi0"]
|
||||
[ext_resource type="PackedScene" uid="uid://b3w7qpn4nhmu2" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/scaler.tscn" id="4_g2t2s"]
|
||||
[ext_resource type="PackedScene" uid="uid://dghfxwcbi5ig" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/max_fps.tscn" id="5_82fyi"]
|
||||
[ext_resource type="PackedScene" uid="uid://idtbqnsqlvb6" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/vsync.tscn" id="6_2rh1a"]
|
||||
[ext_resource type="PackedScene" uid="uid://csg6c3uuct1ls" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/anti_aliasing.tscn" id="7_r8hxv"]
|
||||
[ext_resource type="PackedScene" uid="uid://3ckate3v614f" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/depth_of_field.tscn" id="8_28f8l"]
|
||||
[ext_resource type="PackedScene" uid="uid://cgqiotob5aaoq" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/shadow_quality.tscn" id="9_1x78v"]
|
||||
[ext_resource type="PackedScene" uid="uid://cqfr01uk73ce5" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/ssr_quality.tscn" id="10_cfuis"]
|
||||
[ext_resource type="PackedScene" uid="uid://du5urp5d2dyjb" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/glow_quality.tscn" id="10_m0pim"]
|
||||
[ext_resource type="PackedScene" uid="uid://bk5ky60jln7ag" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/ssao_quality.tscn" id="11_xa1gl"]
|
||||
[ext_resource type="PackedScene" uid="uid://bmnvig4gfqj0c" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/ssil_quality.tscn" id="12_jqvyp"]
|
||||
[ext_resource type="PackedScene" uid="uid://ddykljx6ndodi" path="res://addons/modular-settings-menu/scenes/settings-elements/graphics-elements/sdfgi_quality.tscn" id="13_ifeh4"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_v0fou"]
|
||||
|
||||
[node name="Graphics" type="TabBar"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_styles/tab_focus = SubResource("StyleBoxEmpty_v0fou")
|
||||
script = ExtResource("1_704sp")
|
||||
IDENTIFIER = "Graphics"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
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 = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="ElementList" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 24
|
||||
|
||||
[node name="BasicSettings" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionName" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/BasicSettings"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "Basic Settings"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/BasicSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionElements" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/BasicSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DisplayMode" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/BasicSettings/SubSectionElements" instance=ExtResource("1_mr6e7")]
|
||||
layout_mode = 2
|
||||
defaultValue = "Windowed"
|
||||
|
||||
[node name="Resolution" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/BasicSettings/SubSectionElements" instance=ExtResource("2_5bpi0")]
|
||||
layout_mode = 2
|
||||
defaultValue = "1280x720"
|
||||
|
||||
[node name="MaxFPS" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/BasicSettings/SubSectionElements" instance=ExtResource("5_82fyi")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="AdvancedSettings" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionName" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "Advanced Settings
|
||||
"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubSectionElements" type="VBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Scaler" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings/SubSectionElements" instance=ExtResource("4_g2t2s")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="AntiAliasing" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings/SubSectionElements" instance=ExtResource("7_r8hxv")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VSync" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings/SubSectionElements" instance=ExtResource("6_2rh1a")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DepthOfField" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings/SubSectionElements" instance=ExtResource("8_28f8l")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ShadowQuality" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings/SubSectionElements" instance=ExtResource("9_1x78v")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="GlowQuality" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings/SubSectionElements" instance=ExtResource("10_m0pim")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SSRQuality" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings/SubSectionElements" instance=ExtResource("10_cfuis")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SSAOQuality" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings/SubSectionElements" instance=ExtResource("11_xa1gl")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SSILQuality" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings/SubSectionElements" instance=ExtResource("12_jqvyp")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SDFGIQuality" parent="MarginContainer/ScrollContainer/MarginContainer/ElementList/AdvancedSettings/SubSectionElements" instance=ExtResource("13_ifeh4")]
|
||||
layout_mode = 2
|
||||
@@ -0,0 +1,97 @@
|
||||
[gd_scene format=3 uid="uid://px6a2dg8cawb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://houdhjao14e7" path="res://addons/modular-settings-menu/scripts/settings_menu.gd" id="1_crapp"]
|
||||
[ext_resource type="PackedScene" uid="uid://c66v42g6gs7gr" path="res://addons/modular-settings-menu/scenes/settings-sections/gameplay.tscn" id="2_kjxrg"]
|
||||
[ext_resource type="PackedScene" uid="uid://buqq0kms2dbb4" path="res://addons/modular-settings-menu/scenes/settings-sections/graphics.tscn" id="3_8fcn6"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfswr81erouhj" path="res://addons/modular-settings-menu/scenes/settings-sections/controls.tscn" id="4_3a4pu"]
|
||||
[ext_resource type="PackedScene" uid="uid://dvkksl3mrnoto" path="res://addons/modular-settings-menu/scenes/settings-elements/discard_changes_popup.tscn" id="4_yfemx"]
|
||||
[ext_resource type="PackedScene" uid="uid://y5oxvao3aqtb" path="res://addons/modular-settings-menu/scenes/settings-sections/audio.tscn" id="5_ayxwc"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_kwbsm"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ntlmy"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_qp71p"]
|
||||
|
||||
[node name="Settings" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 1
|
||||
script = ExtResource("1_crapp")
|
||||
|
||||
[node name="SettingsPanel" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -320.0
|
||||
offset_top = -270.0
|
||||
offset_right = 320.0
|
||||
offset_bottom = 270.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="SettingsTabs" type="TabContainer" parent="SettingsPanel"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/tab_focus = SubResource("StyleBoxEmpty_kwbsm")
|
||||
current_tab = 0
|
||||
|
||||
[node name="Gameplay" parent="SettingsPanel/SettingsTabs" instance=ExtResource("2_kjxrg")]
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 0
|
||||
|
||||
[node name="Graphics" parent="SettingsPanel/SettingsTabs" instance=ExtResource("3_8fcn6")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 1
|
||||
|
||||
[node name="Controls" parent="SettingsPanel/SettingsTabs" instance=ExtResource("4_3a4pu")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 2
|
||||
|
||||
[node name="Audio" parent="SettingsPanel/SettingsTabs" instance=ExtResource("5_ayxwc")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="SettingsPanel"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ApplyButton" type="Button" parent="SettingsPanel/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_ntlmy")
|
||||
disabled = true
|
||||
text = "Apply"
|
||||
|
||||
[node name="BackButton" type="Button" parent="SettingsPanel/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_qp71p")
|
||||
text = "Back"
|
||||
|
||||
[node name="ElementPanels" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="DiscardChangesPopup" parent="." instance=ExtResource("4_yfemx")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
|
||||
[connection signal="visibility_changed" from="." to="." method="on_visibility_changed"]
|
||||
[connection signal="pressed" from="SettingsPanel/HBoxContainer/ApplyButton" to="." method="on_apply_button_pressed"]
|
||||
[connection signal="pressed" from="SettingsPanel/HBoxContainer/BackButton" to="." method="on_back_button_pressed"]
|
||||
Reference in New Issue
Block a user