[gd_scene load_steps=5 format=3 uid="uid://do28cwi8t6ptt"]

[ext_resource type="PackedScene" uid="uid://dekuqrdjmnr1m" path="res://Scenes/Prefabs/UI/BasePauseMenu.tscn" id="1_ywuni"]
[ext_resource type="Texture2D" uid="uid://3p2l7rec0gh5" path="res://Assets/Sprites/UI/Cursor.png" id="2_r6hlk"]

[sub_resource type="AtlasTexture" id="AtlasTexture_eud56"]
atlas = ExtResource("2_r6hlk")
region = Rect2(0, 0, 8, 8)

[sub_resource type="GDScript" id="GDScript_r6hlk"]
script/source = "extends Node

func restart_level() -> void:
	AudioManager.stop_all_music()
	Global.player_power_states = \"0000\"
	Global.reset_values()
	DiscoLevel.reset_values()
	if Global.current_game_mode == Global.GameMode.CHALLENGE:
		Global.score = 0
		ChallengeModeHandler.current_run_red_coins_collected = ChallengeModeHandler.red_coins_collected[Global.world_num - 1][Global.level_num - 1]
	Global.current_level.reload_level()
	await Global.current_level.tree_exited
	$\"..\".close()

func quit_to_menu() -> void:
	AudioManager.stop_all_music()
	if Global.current_game_mode == Global.GameMode.CUSTOM_LEVEL:
		Global.transition_to_scene(\"res://Scenes/Levels/CustomLevelMenu.tscn\")
	else:
		Global.transition_to_scene(\"res://Scenes/Levels/TitleScreen.tscn\")
	get_tree().paused = true
	await Global.current_level.tree_exited
	$\"..\".close()
"

[node name="PauseMenu" instance=ExtResource("1_ywuni")]

[node name="Cursor" parent="Control" index="1"]
offset_left = 8.0
offset_top = 4.0
offset_right = 16.0
offset_bottom = 12.0
texture = SubResource("AtlasTexture_eud56")

[node name="Handler" type="Node" parent="." index="2"]
script = SubResource("GDScript_r6hlk")

[connection signal="option_1_selected" from="." to="." method="close"]
[connection signal="option_2_selected" from="." to="Handler" method="restart_level"]
[connection signal="option_4_selected" from="." to="Handler" method="quit_to_menu"]
