Skip to content

Commit

Permalink
🎉 feat: no_effect_change_scene function added
Browse files Browse the repository at this point in the history
  • Loading branch information
maktoobgar committed Jan 13, 2023
1 parent d54908a commit 070ed00
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGELOG
UNRELEASED
----------

* 🎉 feat: no_effect_change_scene function added
* 🎉 feat: sublist in lists is now possible
* 🎉 feat: added sub section basic functionality but not full functionality
* 🎉 feat: basics of sub_section added
Expand Down
10 changes: 10 additions & 0 deletions addons/scene_manager/scene_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,16 @@ func change_scene(scene, fade_out_options: Options, fade_in_options: Options, ge
_set_clickable(true)
_set_out_transition()

# Change scene with no effect
func no_effect_change_scene(scene, hold_timeout: float = 0.0, add_to_back: bool = true):
if (scene is PackedScene || (typeof(scene) == TYPE_STRING && safe_validate_scene(scene) && !_in_transition)):
_first_time = false
_set_in_transition()
await get_tree().create_timer(hold_timeout).timeout
if _change_scene(scene, add_to_back):
await get_tree().node_added
_set_out_transition()

# loads scene interactive
# connect to `load_percent_changed(value: int)` and `load_finished` signals
# to listen to updates on your scene loading status
Expand Down
2 changes: 2 additions & 0 deletions addons/scene_manager/sub_section.gd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func add_item(item: Node) -> void:
item._sub_section = self
list.add_child(item)

# Removes an item from list
func remove_item(item: Node) -> void:
list.remove_child(item)

Expand All @@ -46,6 +47,7 @@ func _on_button_up():
else:
open()

# Action on child counting
func _check_count():
if list.get_child_count() == 0:
if name == "All":
Expand Down
16 changes: 8 additions & 8 deletions addons/scene_manager/sub_section.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
[ext_resource type="Script" path="res://addons/scene_manager/sub_section_button.gd" id="3_smgrs"]
[ext_resource type="Texture2D" uid="uid://bhejhahjk1yaa" path="res://addons/scene_manager/icons/ImportFail.svg" id="4_chjuj"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vsivh"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nrcyw"]
bg_color = Color(0.156863, 0.176471, 0.207843, 1)

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ngg5t"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ie52c"]
bg_color = Color(0.219608, 0.239216, 0.266667, 1)

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_joycj"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l26s1"]
bg_color = Color(0.129412, 0.14902, 0.180392, 1)

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3mngj"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n24xb"]
bg_color = Color(0.6, 0.6, 0.6, 0)

[node name="All" type="VBoxContainer"]
Expand All @@ -29,10 +29,10 @@ layout_mode = 2
custom_minimum_size = Vector2(0, 28)
layout_mode = 2
size_flags_horizontal = 3
theme_override_styles/normal = SubResource("StyleBoxFlat_vsivh")
theme_override_styles/hover = SubResource("StyleBoxFlat_ngg5t")
theme_override_styles/pressed = SubResource("StyleBoxFlat_joycj")
theme_override_styles/focus = SubResource("StyleBoxFlat_3mngj")
theme_override_styles/normal = SubResource("StyleBoxFlat_nrcyw")
theme_override_styles/hover = SubResource("StyleBoxFlat_ie52c")
theme_override_styles/pressed = SubResource("StyleBoxFlat_l26s1")
theme_override_styles/focus = SubResource("StyleBoxFlat_n24xb")
text = "All"
icon = ExtResource("1_yyg5g")
alignment = 0
Expand Down

0 comments on commit 070ed00

Please sign in to comment.