diff --git a/scenes/credits.tscn b/scenes/credits.tscn index 4410094..473392e 100644 --- a/scenes/credits.tscn +++ b/scenes/credits.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://images/Credits.png" type="Texture" id=1] +[ext_resource path="res://scripts/credits.gd" type="Script" id=2] [node name="Node2D" type="Node2D"] +script = ExtResource( 2 ) [node name="Sprite" type="Sprite" parent="."] texture = ExtResource( 1 ) diff --git a/scenes/main_menu.tscn b/scenes/main_menu.tscn index eb27f4d..416348c 100644 --- a/scenes/main_menu.tscn +++ b/scenes/main_menu.tscn @@ -38,29 +38,27 @@ script = ExtResource( 1 ) start_delay = 4.0 [node name="UI" type="Control" parent="."] -margin_right = 40.0 -margin_bottom = 40.0 +margin_right = 192.0 +margin_bottom = 108.0 script = ExtResource( 5 ) __meta__ = { "_edit_use_anchors_": false } -[node name="Buttons" type="Control" parent="UI"] -margin_right = 40.0 -margin_bottom = 40.0 +[node name="Buttons" type="VBoxContainer" parent="UI"] +margin_left = 74.0 +margin_top = 19.0 +margin_right = 192.0 +margin_bottom = 74.0 +alignment = 2 __meta__ = { "_edit_use_anchors_": false } [node name="PlayButton" type="Button" parent="UI/Buttons"] -anchor_left = 3.875 -anchor_top = 1.35 -anchor_right = 3.875 -anchor_bottom = 1.35 -margin_left = -13.3871 -margin_top = -17.551 -margin_right = 30.6129 -margin_bottom = 2.449 +margin_top = 23.0 +margin_right = 118.0 +margin_bottom = 37.0 custom_styles/focus = SubResource( 1 ) custom_fonts/font = ExtResource( 2 ) custom_colors/font_color = Color( 0.282353, 0.282353, 0.282353, 1 ) @@ -74,14 +72,9 @@ __meta__ = { scene_to_load = "res://scenes/campfire.tscn" [node name="QuitButton" type="Button" parent="UI/Buttons"] -anchor_left = 3.875 -anchor_top = 1.35 -anchor_right = 3.875 -anchor_bottom = 1.35 -margin_left = -13.3871 -margin_top = 2.449 -margin_right = 30.6129 -margin_bottom = 22.449 +margin_top = 41.0 +margin_right = 118.0 +margin_bottom = 55.0 custom_styles/focus = SubResource( 2 ) custom_fonts/font = ExtResource( 2 ) custom_colors/font_color = Color( 0.282353, 0.282353, 0.282353, 1 ) @@ -92,5 +85,22 @@ script = ExtResource( 3 ) __meta__ = { "_edit_use_anchors_": false } + +[node name="AnotherChoiceButton" type="Button" parent="UI/Buttons"] +visible = false +margin_top = 41.0 +margin_right = 118.0 +margin_bottom = 55.0 +custom_styles/focus = SubResource( 2 ) +custom_fonts/font = ExtResource( 2 ) +custom_colors/font_color = Color( 0.282353, 0.282353, 0.282353, 1 ) +custom_colors/font_color_hover = Color( 1, 1, 1, 1 ) +text = "Make another choice" +flat = true +script = ExtResource( 3 ) +__meta__ = { +"_editor_description_": "" +} +scene_to_load = "res://scenes/campfire2.tscn" [connection signal="animation_finished" from="ely" to="ely" method="_on_background_animation_finished"] [connection signal="animation_finished" from="fire" to="fire" method="_on_background_animation_finished"] diff --git a/scripts/Globals.gd b/scripts/Globals.gd index 781111d..3c94bcb 100644 --- a/scripts/Globals.gd +++ b/scripts/Globals.gd @@ -2,3 +2,4 @@ extends Node var ui_accept_tip = false var ui_interact_flatfish_tip = false +var did_already_play_once = false diff --git a/scripts/credits.gd b/scripts/credits.gd new file mode 100644 index 0000000..7fd4159 --- /dev/null +++ b/scripts/credits.gd @@ -0,0 +1,7 @@ +extends Node2D + + +func _input(event): + if event.is_action_pressed("ui_accept"): + Globals.did_already_play_once = true + get_tree().change_scene("res://scenes/main_menu.tscn") diff --git a/scripts/main_menu.gd b/scripts/main_menu.gd index 8cbec23..c08d1cc 100644 --- a/scripts/main_menu.gd +++ b/scripts/main_menu.gd @@ -4,3 +4,5 @@ onready var music_player = get_node('/root/MusicPlayer') as MusicPlayer func _ready(): music_player.play('main_title') + if Globals.did_already_play_once: + $UI/Buttons/AnotherChoiceButton.show()