Clean scene
This commit is contained in:
@@ -3,16 +3,9 @@ extends Control
|
|||||||
onready var levels = Array()
|
onready var levels = Array()
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
print("[choose_scene#_ready]")
|
|
||||||
_apply_scenes()
|
_apply_scenes()
|
||||||
|
|
||||||
# Load scene warcraft
|
# 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():
|
func _on_warcraft_pressed():
|
||||||
Global.current_scene_int = 0
|
Global.current_scene_int = 0
|
||||||
Global.goto_scene("res://scenes/levels/warcraft/WarCraft.tscn")
|
Global.goto_scene("res://scenes/levels/warcraft/WarCraft.tscn")
|
||||||
@@ -58,9 +51,9 @@ func _get_resource(index, table, datas):
|
|||||||
return datas[index].get_data()
|
return datas[index].get_data()
|
||||||
|
|
||||||
func _apply_scene(name, thumb, resource):
|
func _apply_scene(name, thumb, resource):
|
||||||
$Container/HBoxContainer.add_child(_configure_vbox())
|
$MarginContainer/HBoxContainer.add_child(_configure_vbox())
|
||||||
_configure_button(thumb, resource, name)
|
_configure_button(thumb, resource, name)
|
||||||
$Container/HBoxContainer/VBoxContainer.add_child(_configure_label(name))
|
$MarginContainer/HBoxContainer/VBoxContainer.add_child(_configure_label(name))
|
||||||
|
|
||||||
func _configure_vbox():
|
func _configure_vbox():
|
||||||
var vbox = VBoxContainer.new()
|
var vbox = VBoxContainer.new()
|
||||||
@@ -76,6 +69,6 @@ func _configure_label(name):
|
|||||||
|
|
||||||
func _configure_button(thumb, _resource, name):
|
func _configure_button(thumb, _resource, name):
|
||||||
var thumbnail = TextureButton.new()
|
var thumbnail = TextureButton.new()
|
||||||
$Container/HBoxContainer/VBoxContainer.add_child(thumbnail)
|
$MarginContainer/HBoxContainer/VBoxContainer.add_child(thumbnail)
|
||||||
thumbnail.set_normal_texture(load(thumb))
|
thumbnail.set_normal_texture(load(thumb))
|
||||||
thumbnail.connect("pressed", self, "_on_"+name.to_lower()+"_pressed")
|
thumbnail.connect("pressed", self, "_on_"+name.to_lower()+"_pressed")
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
[gd_scene load_steps=3 format=2]
|
[gd_scene load_steps=2 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://scenes/UI/choose_scenes/ChooseScene.gd" type="Script" id=1]
|
[ext_resource path="res://scenes/UI/choose_scenes/ChooseScene.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://assets/levels/warcraft.jpg" type="Texture" id=2]
|
|
||||||
|
|
||||||
[node name="ChooseScene" type="CenterContainer"]
|
[node name="ChooseScene" type="CenterContainer"]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
@@ -11,47 +10,20 @@ __meta__ = {
|
|||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="GridContainer" type="GridContainer" parent="."]
|
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||||
visible = false
|
margin_left = 712.0
|
||||||
margin_left = 645.0
|
margin_top = 435.0
|
||||||
margin_top = 298.0
|
margin_right = 727.0
|
||||||
margin_right = 795.0
|
margin_bottom = 465.0
|
||||||
margin_bottom = 602.0
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
custom_constants/margin_right = 15
|
||||||
|
custom_constants/margin_top = 15
|
||||||
|
custom_constants/margin_bottom = 15
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="WarCraft" type="TextureButton" parent="GridContainer"]
|
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
|
||||||
margin_right = 150.0
|
margin_top = 15.0
|
||||||
margin_bottom = 150.0
|
margin_bottom = 15.0
|
||||||
mouse_default_cursor_shape = 2
|
|
||||||
texture_normal = ExtResource( 2 )
|
|
||||||
|
|
||||||
[node name="Lightmap" type="TextureButton" parent="GridContainer"]
|
|
||||||
margin_top = 154.0
|
|
||||||
margin_right = 150.0
|
|
||||||
margin_bottom = 304.0
|
|
||||||
mouse_default_cursor_shape = 2
|
|
||||||
texture_normal = ExtResource( 2 )
|
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="GridContainer/Lightmap"]
|
|
||||||
margin_right = 40.0
|
|
||||||
margin_bottom = 14.0
|
|
||||||
text = "Lightmap"
|
|
||||||
__meta__ = {
|
|
||||||
"_edit_use_anchors_": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="Container" type="Control" parent="."]
|
|
||||||
margin_left = 720.0
|
|
||||||
margin_top = 450.0
|
|
||||||
margin_right = 720.0
|
|
||||||
margin_bottom = 450.0
|
|
||||||
|
|
||||||
[node name="HBoxContainer" type="VBoxContainer" parent="Container"]
|
|
||||||
__meta__ = {
|
|
||||||
"_edit_use_anchors_": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[connection signal="pressed" from="GridContainer/WarCraft" to="." method="_on_WarCraft_pressed"]
|
|
||||||
[connection signal="pressed" from="GridContainer/Lightmap" to="." method="_on_Lightmap_pressed"]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user