-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
163 additions
and
259 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...settings-menu/scenes/settings-elements/templates/multi-element-template/main_element.tscn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
43 changes: 43 additions & 0 deletions
43
...enu/scenes/settings-elements/templates/multi-element-template/multi_element_template.tscn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[gd_scene load_steps=5 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 0 additions & 130 deletions
130
...menu/scenes/settings-elements/templates/sub-element-template/parent_element_template.tscn
This file was deleted.
Oops, something went wrong.
111 changes: 0 additions & 111 deletions
111
...gs-menu/scenes/settings-elements/templates/sub-element-template/sub_element_template.tscn
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.