Clean scene
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user