Loading and unloading developper panel to lessen system burden

This commit is contained in:
yannk 2022-04-17 11:40:01 +02:00
parent 8ca53f8687
commit 716e932eb2
4 changed files with 7 additions and 8 deletions

View file

@ -11,4 +11,6 @@ func _process(delta):
pass
func _on_quit_pressed():
get_node("../developper_panel").visible = false
var parentname = get_parent().name
print(parentname)
get_parent().get_node("developper_panel").queue_free()

View file

@ -2,10 +2,9 @@
[ext_resource type="Script" path="res://scenes/developper/developper.gd" id="1_qf0rd"]
[ext_resource type="Texture2D" uid="uid://se0t5xwdxyq7" path="res://scenes/themes/textures/base_panel.png" id="2_fmcto"]
[ext_resource type="Theme" uid="uid://bi1js53ni6ehd" path="res://UI/themes/khanat/khanat.theme" id="3_ols6l"]
[ext_resource type="Theme" uid="uid://bi1js53ni6ehd" path="res://UI/themes/zbasu/zbasu.theme" id="3_ols6l"]
[node name="developper_panel" type="Control"]
visible = false
minimum_size = Vector2(350, 250)
anchor_left = 0.5
anchor_top = 0.5

View file

@ -67,7 +67,8 @@ func _on_themes_pressed():
$MenuTheme/Window.visible = true
func _on_dev_pressed():
$developper_panel.visible = true
var developper_panel = preload("res://scenes/developper/developper.tscn").instantiate()
add_child(developper_panel)
func _on_about_pressed():
var aboutmessage:String

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=3 uid="uid://cdyi1a858p7em"]
[gd_scene load_steps=7 format=3 uid="uid://cdyi1a858p7em"]
[ext_resource type="Theme" uid="uid://bi1js53ni6ehd" path="res://UI/themes/zbasu/zbasu.theme" id="1_iq3fo"]
[ext_resource type="Script" path="res://scenes/hud/hud.gd" id="1_s6f6d"]
@ -6,7 +6,6 @@
[ext_resource type="PackedScene" uid="uid://cl8xk8w3jmta0" path="res://scenes/controls/controls.tscn" id="3_08xl7"]
[ext_resource type="PackedScene" uid="uid://cb0gfweooxdsl" path="res://scenes/themes/themes.tscn" id="4_1poje"]
[ext_resource type="PackedScene" uid="uid://ebfrhgrluixd" path="res://scenes/music/music_manager.tscn" id="6_0ivsi"]
[ext_resource type="PackedScene" uid="uid://cua4782cbjhla" path="res://scenes/developper/developper.tscn" id="7_45giw"]
[node name="Control" type="Control"]
anchor_right = 1.0
@ -100,8 +99,6 @@ visible = false
[node name="MusicManager" parent="." instance=ExtResource( "6_0ivsi" )]
visible = false
[node name="developper_panel" parent="." instance=ExtResource( "7_45giw" )]
[connection signal="pressed" from="Menu/Keys" to="." method="_on_keys_pressed"]
[connection signal="pressed" from="Menu/Themes" to="." method="_on_themes_pressed"]
[connection signal="pressed" from="Menu/Languages" to="." method="_on_languages_pressed"]