feature/select-puzzle-update (#72)
Si tu peut regarder pour finir la pull request pour l'écran de selection des puzzles ! Co-authored-by: stilobique-i7 <aurelienvlt@free.fr> Co-authored-by: VAILLANT Jeremy <vaillant.jeremy@dev-crea.com> Reviewed-on: Athena/game-source#72 Co-authored-by: stilobique <aurelienvlt@free.fr> Co-committed-by: stilobique <aurelienvlt@free.fr>
This commit is contained in:
@@ -13,7 +13,7 @@ func _apply_scenes():
|
||||
_apply_scene(mlevel.new(row_index), 0)
|
||||
|
||||
func _build_path(name):
|
||||
return "MarginContainer/HBoxContainer/"+name
|
||||
return "MarginContainer/"+name
|
||||
|
||||
func _build_method(name):
|
||||
return "_on_"+name.to_lower()+"_pressed"
|
||||
@@ -28,7 +28,7 @@ func _load_texture(thumbnail):
|
||||
return load(thumbnail)
|
||||
|
||||
func _apply_scene(level, index):
|
||||
$MarginContainer/HBoxContainer.add_child(_load_scene(level.name()))
|
||||
$MarginContainer.add_child(_load_scene(level.name()))
|
||||
var node = _build_path(level.name())
|
||||
|
||||
_configure_select(level, node)
|
||||
@@ -36,13 +36,14 @@ func _apply_scene(level, index):
|
||||
configure_counter(level, node)
|
||||
|
||||
func _configure_select(level, node):
|
||||
var select = get_node(node+"/TextureRect/TextureButton")
|
||||
var selector = get_node(node+"/MarginContainer/CenterAlign/MainButton")
|
||||
var thumbnail = get_node(node+"/MarginContainer/CenterAlign/MainButton/MarginStich/ThumbnailLevel")
|
||||
|
||||
select.set_normal_texture(_load_texture(level.thumbnail()))
|
||||
select.connect("pressed", Event, _build_method(level.name()))
|
||||
thumbnail.set_texture(_load_texture(level.thumbnail()))
|
||||
selector.connect("pressed", Event, _build_method(level.name()))
|
||||
|
||||
func configure_reset(level, node, index):
|
||||
var reset = get_node(node+"/VBoxContainer/MarginContainer/ButtonReset")
|
||||
var reset = get_node(node+"/MarginContainer/CenterAlign/TabAlign/ButtonReset")
|
||||
|
||||
if int(level.object_finding()) == 0:
|
||||
reset.set_disabled(true)
|
||||
@@ -53,6 +54,6 @@ func configure_reset(level, node, index):
|
||||
reset.connect("pressed", Event, "_on_reset_level", [level, node, index, self])
|
||||
|
||||
func configure_counter(level, node):
|
||||
var count = get_node(node+"/VBoxContainer/MarginContainer2/ButtonCount/Label")
|
||||
var count = get_node(node+"/MarginContainer/CenterAlign/TabAlign/ButtonCount/MarginBottom/Label")
|
||||
|
||||
count.set_text(level.object_finding()+" / "+level.object_to_find())
|
||||
|
||||
@@ -1,47 +1,21 @@
|
||||
[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/levels/Template.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="ChooseScene" type="CenterContainer"]
|
||||
[node name="ChooseScene" type="ScrollContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 73.7365
|
||||
margin_top = -67.0147
|
||||
margin_right = 73.7366
|
||||
margin_bottom = -67.0146
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
scroll_horizontal_enabled = false
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
margin_left = 625.0
|
||||
margin_top = 345.0
|
||||
margin_right = 655.0
|
||||
margin_bottom = 375.0
|
||||
[node name="MarginContainer" type="GridContainer" parent="."]
|
||||
margin_right = 1920.0
|
||||
margin_bottom = 1080.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/margin_right = 15
|
||||
custom_constants/margin_top = 15
|
||||
custom_constants/margin_left = 15
|
||||
custom_constants/margin_bottom = 15
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 15.0
|
||||
margin_top = 15.0
|
||||
margin_right = 15.0
|
||||
margin_bottom = 15.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/separation = 120
|
||||
|
||||
[node name="example" parent="MarginContainer/HBoxContainer" instance=ExtResource( 2 )]
|
||||
visible = false
|
||||
margin_right = 200.0
|
||||
margin_bottom = 284.0
|
||||
|
||||
[editable path="MarginContainer/HBoxContainer/example"]
|
||||
columns = 3
|
||||
|
||||
Reference in New Issue
Block a user