-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added CollapsableSettings scene and class derived from HBoxContainer,…
… added example in play_sound.tres
- Loading branch information
Showing
8 changed files
with
146 additions
and
13 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
32 changes: 32 additions & 0 deletions
32
addons/block_code/ui/blocks/utilities/template_editor/collapsable_settings.gd
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,32 @@ | ||
@tool | ||
class_name CollapsableSettings | ||
extends HBoxContainer | ||
|
||
var collapsed = false | ||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready() -> void: | ||
collapse() | ||
$CollapseButton.connect("button_up", collapse) | ||
$ExpandButton.connect("button_up", expand) | ||
|
||
func expand() -> void: | ||
if not collapsed: | ||
return | ||
for child in get_children(true): | ||
child.visible = true | ||
$ExpandButton.visible = false | ||
$CollapseButton.visible = true | ||
collapsed = false | ||
|
||
func collapse() -> void: | ||
if collapsed: | ||
return | ||
for child in get_children(true): | ||
child.visible = false | ||
$ExpandButton.visible = true | ||
collapsed = true | ||
|
||
func reorder() -> void: | ||
move_child($ExpandButton, 0) | ||
move_child($CollapseButton, -1) |
22 changes: 22 additions & 0 deletions
22
addons/block_code/ui/blocks/utilities/template_editor/collapsable_settings.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,22 @@ | ||
[gd_scene load_steps=4 format=3 uid="uid://1xfpd777g8pf"] | ||
|
||
[ext_resource type="Script" path="res://addons/block_code/ui/blocks/utilities/template_editor/collapsable_settings.gd" id="1_f0ssn"] | ||
[ext_resource type="Texture2D" uid="uid://5y2dvf2xc4vx" path="res://addons/block_code/ui/blocks/utilities/template_editor/plus.png" id="2_8s057"] | ||
[ext_resource type="Texture2D" uid="uid://b85dahj52hy0d" path="res://addons/block_code/ui/blocks/utilities/template_editor/minus.png" id="3_6qcv3"] | ||
|
||
[node name="CollapsableSettings" type="HBoxContainer"] | ||
offset_right = 36.0 | ||
offset_bottom = 31.0 | ||
script = ExtResource("1_f0ssn") | ||
|
||
[node name="ExpandButton" type="Button" parent="."] | ||
layout_mode = 2 | ||
icon = ExtResource("2_8s057") | ||
flat = true | ||
icon_alignment = 1 | ||
|
||
[node name="CollapseButton" type="Button" parent="."] | ||
layout_mode = 2 | ||
icon = ExtResource("3_6qcv3") | ||
flat = true | ||
icon_alignment = 1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions
34
addons/block_code/ui/blocks/utilities/template_editor/minus.png.import
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,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://b85dahj52hy0d" | ||
path="res://.godot/imported/minus.png-7cbe293178ea19d9e5fbc8ba50c3a01b.ctex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://addons/block_code/ui/blocks/utilities/template_editor/minus.png" | ||
dest_files=["res://.godot/imported/minus.png-7cbe293178ea19d9e5fbc8ba50c3a01b.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions
34
addons/block_code/ui/blocks/utilities/template_editor/plus.png.import
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,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://5y2dvf2xc4vx" | ||
path="res://.godot/imported/plus.png-415014510d01c9db50069dbfc9e6ab6f.ctex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://addons/block_code/ui/blocks/utilities/template_editor/plus.png" | ||
dest_files=["res://.godot/imported/plus.png-415014510d01c9db50069dbfc9e6ab6f.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 |
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