Added menu settings add-on
This commit is contained in:
@@ -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")
|
||||
Reference in New Issue
Block a user