-
Notifications
You must be signed in to change notification settings - Fork 15
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
1 parent
903df4c
commit 067c108
Showing
7 changed files
with
132 additions
and
35 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,38 @@ | ||
@tool | ||
extends Node | ||
|
||
# Nodes | ||
@onready var button: Button = find_child("Button") | ||
@onready var list: VBoxContainer = find_child("List") | ||
# Open close icons | ||
const _open = preload("res://addons/scene_manager/icons/GuiOptionArrowDown.svg") | ||
const _close = preload("res://addons/scene_manager/icons/GuiOptionArrowRight.png") | ||
|
||
# If it is "All" subsection, open it | ||
func _ready() -> void: | ||
button.text = name | ||
|
||
# Add child | ||
func add_item(item: Node) -> void: | ||
list.add_child(item) | ||
|
||
# Open list | ||
func open() -> void: | ||
list.visible = true | ||
button.icon = _open | ||
|
||
# Close list | ||
func close() -> void: | ||
list.visible = false | ||
button.icon = _close | ||
|
||
# Returns list of items | ||
func get_items() -> Array: | ||
return list.get_children() | ||
|
||
# Close Open Functionality | ||
func _on_button_up(): | ||
if button.icon == _open: | ||
close() | ||
else: | ||
open() |
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,37 @@ | ||
[gd_scene load_steps=7 format=3 uid="uid://b4edho3whn67t"] | ||
|
||
[ext_resource type="Script" path="res://addons/scene_manager/sub_section.gd" id="1_kgwwp"] | ||
[ext_resource type="Texture2D" uid="uid://dme1lg33nbnnh" path="res://addons/scene_manager/icons/GuiOptionArrowRight.png" id="1_yyg5g"] | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n15k3"] | ||
bg_color = Color(0.156863, 0.176471, 0.207843, 1) | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l4n41"] | ||
bg_color = Color(0.219608, 0.239216, 0.266667, 1) | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xadnp"] | ||
bg_color = Color(0.129412, 0.14902, 0.180392, 1) | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gs36f"] | ||
bg_color = Color(0.6, 0.6, 0.6, 0) | ||
|
||
[node name="All" type="VBoxContainer"] | ||
offset_right = 1024.0 | ||
offset_bottom = 23.0 | ||
script = ExtResource("1_kgwwp") | ||
|
||
[node name="Button" type="Button" parent="."] | ||
layout_mode = 2 | ||
theme_override_styles/normal = SubResource("StyleBoxFlat_n15k3") | ||
theme_override_styles/hover = SubResource("StyleBoxFlat_l4n41") | ||
theme_override_styles/pressed = SubResource("StyleBoxFlat_xadnp") | ||
theme_override_styles/focus = SubResource("StyleBoxFlat_gs36f") | ||
text = "All" | ||
icon = ExtResource("1_yyg5g") | ||
alignment = 0 | ||
|
||
[node name="List" type="VBoxContainer" parent="."] | ||
visible = false | ||
layout_mode = 2 | ||
|
||
[connection signal="button_up" from="Button" to="." method="_on_button_up"] |