added next level button, adjusted lv 1 background, fixed menu background when calling options menu from main menu
This commit is contained in:
parent
2e6c8dd815
commit
4396504480
3 changed files with 34 additions and 4 deletions
|
@ -31,8 +31,8 @@ func _on_start_button_pressed():
|
|||
func _on_options_button_pressed():
|
||||
var options = load("res://src/gui/menu/options.tscn").instantiate()
|
||||
get_parent().add_child((options))
|
||||
options.last_menu = self
|
||||
hide()
|
||||
options.last_menu = main_menu
|
||||
main_menu.hide()
|
||||
|
||||
func _on_quit_button_pressed():
|
||||
get_tree().quit()
|
||||
|
|
|
@ -19,3 +19,13 @@ func _on_retry_button_pressed():
|
|||
|
||||
func _on_submit_button_pressed():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
func _on_next_button_pressed():
|
||||
var next_level = level_nr + 1
|
||||
if next_level > 12:
|
||||
next_level = 1
|
||||
load_level("res://src/game/levels/level_%s.tscn" % next_level)
|
||||
|
||||
func load_level(path: String):
|
||||
get_tree().change_scene_to_file(path)
|
||||
|
|
|
@ -79,9 +79,9 @@ anchor_top = 1.0
|
|||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -60.0
|
||||
offset_top = -109.0
|
||||
offset_top = -157.0
|
||||
offset_right = 60.0
|
||||
offset_bottom = -69.0
|
||||
offset_bottom = -117.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
size_flags_horizontal = 4
|
||||
|
@ -108,5 +108,25 @@ size_flags_vertical = 8
|
|||
focus_neighbor_bottom = NodePath("../StartButton")
|
||||
text = "SUBMIT"
|
||||
|
||||
[node name="NextButton" type="Button" parent="Panel"]
|
||||
custom_minimum_size = Vector2(120, 40)
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -60.0
|
||||
offset_top = -109.0
|
||||
offset_right = 60.0
|
||||
offset_bottom = -69.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
focus_neighbor_bottom = NodePath("../StartButton")
|
||||
text = "NEXT LEVEL"
|
||||
|
||||
[connection signal="pressed" from="Panel/RetryButton" to="." method="_on_retry_button_pressed"]
|
||||
[connection signal="pressed" from="Panel/SubmitButton" to="." method="_on_submit_button_pressed"]
|
||||
[connection signal="pressed" from="Panel/NextButton" to="." method="_on_next_button_pressed"]
|
||||
|
|
Loading…
Reference in a new issue