Clean scene

This commit is contained in:
Vaillant Jeremy
2021-05-15 00:58:13 +02:00
parent 9c7921ee43
commit e1f51b8d91
2 changed files with 17 additions and 52 deletions
+3 -10
View File
@@ -3,16 +3,9 @@ extends Control
onready var levels = Array()
func _ready():
print("[choose_scene#_ready]")
_apply_scenes()
# Load scene warcraft
func _on_WarCraft_pressed():
Global.goto_scene("res://scenes/levels/warcraft/WarCraft.tscn")
func _on_Lightmap_pressed():
Global.goto_scene("res://developers/aurelien/CheckLightmap.tscn")
func _on_warcraft_pressed():
Global.goto_scene("res://scenes/levels/warcraft/WarCraft.tscn")
@@ -56,9 +49,9 @@ func _get_resource(index, table, datas):
return datas[index].get_data()
func _apply_scene(name, thumb, resource):
$Container/HBoxContainer.add_child(_configure_vbox())
$MarginContainer/HBoxContainer.add_child(_configure_vbox())
_configure_button(thumb, resource, name)
$Container/HBoxContainer/VBoxContainer.add_child(_configure_label(name))
$MarginContainer/HBoxContainer/VBoxContainer.add_child(_configure_label(name))
func _configure_vbox():
var vbox = VBoxContainer.new()
@@ -74,7 +67,7 @@ func _configure_label(name):
func _configure_button(thumb, _resource, name):
var thumbnail = TextureButton.new()
$Container/HBoxContainer/VBoxContainer.add_child(thumbnail)
$MarginContainer/HBoxContainer/VBoxContainer.add_child(thumbnail)
thumbnail.set_normal_texture(load(thumb))
thumbnail.connect("pressed", self, "_on_"+name.to_lower()+"_pressed")