feat: basic settings menu

This commit is contained in:
LunarAkai 2025-06-29 00:20:06 +02:00
commit 8e215a6962
38 changed files with 1308 additions and 51 deletions

View file

@ -1,11 +1,20 @@
[gd_scene load_steps=13 format=3 uid="uid://brs37lcvmx2h5"]
[gd_scene load_steps=23 format=3 uid="uid://brs37lcvmx2h5"]
[ext_resource type="Theme" uid="uid://bal6yp0a25hf2" path="res://src/theme/main_theme.tres" id="1_apmt2"]
[ext_resource type="Script" uid="uid://cned1fnc85l8x" path="res://src/UI/main.gd" id="1_gtrax"]
[ext_resource type="Script" uid="uid://hiyarq0kbm45" path="res://src/UI/menu_bar.gd" id="1_rt51c"]
[ext_resource type="Script" uid="uid://dv5tmj6la8jql" path="res://src/UI/titlebar.gd" id="3_64rym"]
[ext_resource type="Texture2D" uid="uid://bpvgbghct7ayv" path="res://src/assets/icons/x.svg" id="4_6nn4n"]
[ext_resource type="Texture2D" uid="uid://duloi6af1avtm" path="res://src/assets/icons/chevron-compact-down.svg" id="5_dv4hw"]
[ext_resource type="Script" uid="uid://bdaqnjmoi6k1q" path="res://src/UI/ui_manager.gd" id="5_05tj4"]
[ext_resource type="PackedScene" uid="uid://csre4kogd8afg" path="res://src/UI/buttons/container_selection_button.tscn" id="5_14o3q"]
[ext_resource type="Script" uid="uid://b36rq8vvxs2cr" path="res://src/UI/container_box.gd" id="5_cqoei"]
[ext_resource type="Script" uid="uid://cs8ywlsgql3pg" path="res://src/UI/close_button.gd" id="5_teubg"]
[ext_resource type="Script" uid="uid://d3l1hl06c3n56" path="res://src/UI/minimize_button.gd" id="7_14o3q"]
[ext_resource type="Texture2D" uid="uid://cyu4k12a2o0qc" path="res://src/assets/icons/settings.svg" id="6_dlcq6"]
[ext_resource type="Script" uid="uid://mpcin6c2bydu" path="res://src/UI/container_add_button.gd" id="7_cqoei"]
[ext_resource type="Texture2D" uid="uid://dof65a47bfapk" path="res://src/assets/icons/library-plus.svg" id="7_teubg"]
[ext_resource type="PackedScene" uid="uid://cirolvhfd455u" path="res://src/UI/main_panel.tscn" id="9_cqoei"]
[ext_resource type="Script" uid="uid://dajxw3a0wx83r" path="res://src/UI/settings/settings_button.gd" id="12_g3kvb"]
[ext_resource type="PackedScene" uid="uid://c75khb0lmemy4" path="res://src/UI/settings/settings_menu.tscn" id="13_v0ovx"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5vilm"]
bg_color = Color(0.962281, 0.933337, 0.999483, 1)
@ -36,18 +45,20 @@ expand_margin_top = 2.0
expand_margin_right = 2.0
expand_margin_bottom = 2.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_14o3q"]
bg_color = Color(1, 0.956863, 0.0823529, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cqoei"]
bg_color = Color(0.728507, 0.695771, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_apmt2"]
corner_radius_top_left = 30
corner_radius_top_right = 30
corner_radius_bottom_right = 30
corner_radius_bottom_left = 30
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_dv4hw"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_64rym"]
bg_color = Color(0.43134, 0.43134, 0.43134, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dlcq6"]
bg_color = Color(0.461058, 0.420568, 0.461121, 0.419608)
[node name="Main" type="Control"]
layout_mode = 3
anchors_preset = 15
@ -55,6 +66,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_gtrax")
[node name="Panel" type="Panel" parent="."]
layout_mode = 1
@ -73,17 +85,26 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="MarginContainer" type="MarginContainer" parent="Panel/VBoxContainer"]
[node name="Titlebar" type="MarginContainer" parent="Panel/VBoxContainer"]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
mouse_filter = 0
theme = ExtResource("1_apmt2")
theme_override_constants/margin_left = 30
theme_override_constants/margin_right = 30
[node name="MenuBar" type="MenuBar" parent="Panel/VBoxContainer/MarginContainer"]
[node name="ColorRect" type="ColorRect" parent="Panel/VBoxContainer/Titlebar"]
visible = false
layout_mode = 2
size_flags_vertical = 3
color = Color(0.960351, 0.960351, 0.960351, 1)
[node name="MenuBar" type="MenuBar" parent="Panel/VBoxContainer/Titlebar"]
layout_mode = 2
theme = ExtResource("1_apmt2")
script = ExtResource("1_rt51c")
[node name="CloseButton" type="Button" parent="Panel/VBoxContainer/MarginContainer/MenuBar"]
[node name="CloseButton" type="Button" parent="Panel/VBoxContainer/Titlebar/MenuBar"]
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
@ -104,40 +125,28 @@ action_mode = 0
icon = ExtResource("4_6nn4n")
script = ExtResource("5_teubg")
[node name="MinimizeButton" type="Button" parent="Panel/VBoxContainer/MarginContainer/MenuBar"]
visible = false
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -73.0
offset_top = -11.5
offset_right = -49.0
offset_bottom = 12.5
grow_horizontal = 0
grow_vertical = 2
[node name="Label" type="Label" parent="Panel/VBoxContainer/Titlebar"]
layout_mode = 2
theme = ExtResource("1_apmt2")
theme_type_variation = &"FlatButton"
theme_override_constants/outline_size = 3
theme_override_styles/hover = SubResource("StyleBoxFlat_14o3q")
theme_override_styles/pressed = SubResource("StyleBoxFlat_cqoei")
action_mode = 0
icon = ExtResource("5_dv4hw")
script = ExtResource("7_14o3q")
theme_override_colors/font_color = Color(0.374139, 0.374139, 0.374139, 1)
text = "Whydt"
horizontal_alignment = 1
vertical_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/VBoxContainer"]
[node name="UIManager" type="HBoxContainer" parent="Panel/VBoxContainer" node_paths=PackedStringArray("current_active_panel", "container_collection_box")]
layout_mode = 2
size_flags_vertical = 3
script = ExtResource("5_05tj4")
current_active_panel = NodePath("MainPanel")
container_collection_box = NodePath("Panel/MarginContainer/ScrollContainer/ContainerBox")
[node name="Panel" type="Panel" parent="Panel/VBoxContainer/HBoxContainer"]
[node name="Panel" type="Panel" parent="Panel/VBoxContainer/UIManager"]
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
size_flags_horizontal = 0
theme_override_styles/panel = SubResource("StyleBoxFlat_apmt2")
[node name="MarginContainer" type="MarginContainer" parent="Panel/VBoxContainer/HBoxContainer/Panel"]
[node name="MarginContainer" type="MarginContainer" parent="Panel/VBoxContainer/UIManager/Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
@ -149,29 +158,75 @@ theme_override_constants/margin_top = 30
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 30
[node name="ScrollContainer" type="ScrollContainer" parent="Panel/VBoxContainer/HBoxContainer/Panel/MarginContainer"]
[node name="ScrollContainer" type="ScrollContainer" parent="Panel/VBoxContainer/UIManager/Panel/MarginContainer"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
horizontal_scroll_mode = 0
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/VBoxContainer/HBoxContainer/Panel/MarginContainer/ScrollContainer"]
[node name="ContainerBox" type="VBoxContainer" parent="Panel/VBoxContainer/UIManager/Panel/MarginContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("5_cqoei")
[node name="RichTextLabel" type="RichTextLabel" parent="Panel/VBoxContainer/HBoxContainer/Panel/MarginContainer/ScrollContainer/VBoxContainer"]
[node name="ContainerSelectionButton" parent="Panel/VBoxContainer/UIManager/Panel/MarginContainer/ScrollContainer/ContainerBox" node_paths=PackedStringArray("container_box") instance=ExtResource("5_14o3q")]
layout_mode = 2
container_box = NodePath("..")
[node name="ContainerAddButton" type="Button" parent="Panel/VBoxContainer/UIManager/Panel/MarginContainer/ScrollContainer/ContainerBox" node_paths=PackedStringArray("container_box")]
layout_mode = 2
tooltip_text = "Add a new collection"
theme = ExtResource("1_apmt2")
theme_type_variation = &"CollectionButton"
theme_override_styles/focus = SubResource("StyleBoxEmpty_dv4hw")
theme_override_styles/hover = SubResource("StyleBoxFlat_64rym")
theme_override_styles/pressed = SubResource("StyleBoxFlat_dlcq6")
icon = ExtResource("7_teubg")
icon_alignment = 1
script = ExtResource("7_cqoei")
container_box = NodePath("..")
container_button_scene = ExtResource("5_14o3q")
[node name="MarginContainer2" type="MarginContainer" parent="Panel/VBoxContainer/UIManager/Panel"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -12.0
offset_top = -24.0
offset_right = 12.0
grow_horizontal = 2
grow_vertical = 0
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="SettingsButton" type="Button" parent="Panel/VBoxContainer/UIManager/Panel/MarginContainer2"]
layout_mode = 2
theme = ExtResource("1_apmt2")
text = "aaaaa"
fit_content = true
theme_type_variation = &"FlatButton"
theme_override_styles/hover = SubResource("StyleBoxFlat_dv4hw")
theme_override_styles/pressed = SubResource("StyleBoxFlat_teubg")
action_mode = 0
icon = ExtResource("6_dlcq6")
icon_alignment = 1
script = ExtResource("12_g3kvb")
settings_menu = ExtResource("13_v0ovx")
[node name="ScrollContainer" type="ScrollContainer" parent="Panel/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
horizontal_scroll_mode = 0
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer"]
[node name="MainPanel" parent="Panel/VBoxContainer/UIManager" instance=ExtResource("9_cqoei")]
layout_mode = 2
[connection signal="pressed" from="Panel/VBoxContainer/MarginContainer/MenuBar/CloseButton" to="Panel/VBoxContainer/MarginContainer/MenuBar/CloseButton" method="_on_pressed"]
[connection signal="pressed" from="Panel/VBoxContainer/MarginContainer/MenuBar/MinimizeButton" to="Panel/VBoxContainer/MarginContainer/MenuBar/MinimizeButton" method="_on_pressed"]
[node name="Control" type="Control" parent="."]
anchors_preset = 0
offset_right = 1183.0
offset_bottom = 30.0
mouse_default_cursor_shape = 13
script = ExtResource("3_64rym")
[connection signal="pressed" from="Panel/VBoxContainer/Titlebar/MenuBar/CloseButton" to="Panel/VBoxContainer/Titlebar/MenuBar/CloseButton" method="_on_pressed"]
[connection signal="pressed" from="Panel/VBoxContainer/UIManager/Panel/MarginContainer/ScrollContainer/ContainerBox/ContainerAddButton" to="Panel/VBoxContainer/UIManager/Panel/MarginContainer/ScrollContainer/ContainerBox/ContainerAddButton" method="_on_pressed"]
[connection signal="pressed" from="Panel/VBoxContainer/UIManager/Panel/MarginContainer2/SettingsButton" to="Panel/VBoxContainer/UIManager/Panel/MarginContainer2/SettingsButton" method="_on_pressed"]
[connection signal="gui_input" from="Control" to="Control" method="_on_gui_input"]