mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-20 16:20:18 +01:00
Reload button for level sequence. Order tag levels.
This commit is contained in:
parent
aef7882dcb
commit
82b8e8f458
3 changed files with 30 additions and 8 deletions
4
levels/tags/sequence
Normal file
4
levels/tags/sequence
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
add-tag
|
||||||
|
remove-tag
|
||||||
|
add-tag-later
|
||||||
|
remote-tag
|
|
@ -3,6 +3,21 @@ extends Control
|
||||||
onready var level_list = $ScrollContainer/MarginContainer/Levels
|
onready var level_list = $ScrollContainer/MarginContainer/Levels
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
reload()
|
||||||
|
|
||||||
|
func load(chapter_id, level_id):
|
||||||
|
game.current_chapter = chapter_id
|
||||||
|
game.current_level = level_id
|
||||||
|
get_tree().change_scene("res://scenes/main.tscn")
|
||||||
|
|
||||||
|
func back():
|
||||||
|
get_tree().change_scene("res://scenes/title.tscn")
|
||||||
|
|
||||||
|
|
||||||
|
func reload():
|
||||||
|
for child in level_list.get_children():
|
||||||
|
child.queue_free()
|
||||||
|
|
||||||
var chapter_id = 0
|
var chapter_id = 0
|
||||||
|
|
||||||
levels.reload()
|
levels.reload()
|
||||||
|
@ -25,11 +40,3 @@ func _ready():
|
||||||
level_id += 1
|
level_id += 1
|
||||||
|
|
||||||
chapter_id += 1
|
chapter_id += 1
|
||||||
|
|
||||||
func load(chapter_id, level_id):
|
|
||||||
game.current_chapter = chapter_id
|
|
||||||
game.current_level = level_id
|
|
||||||
get_tree().change_scene("res://scenes/main.tscn")
|
|
||||||
|
|
||||||
func back():
|
|
||||||
get_tree().change_scene("res://scenes/title.tscn")
|
|
||||||
|
|
|
@ -42,4 +42,15 @@ text = "Back"
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="Button2" type="Button" parent="."]
|
||||||
|
margin_left = 138.588
|
||||||
|
margin_top = 59.3009
|
||||||
|
margin_right = 226.588
|
||||||
|
margin_bottom = 98.3009
|
||||||
|
text = "Reload"
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
[connection signal="pressed" from="Button" to="." method="back"]
|
[connection signal="pressed" from="Button" to="." method="back"]
|
||||||
|
[connection signal="pressed" from="Button2" to="." method="reload"]
|
||||||
|
|
Loading…
Reference in a new issue