fixed challenge mode results being able to be closed

This commit is contained in:
JHDev2006
2025-10-13 20:05:42 +01:00
parent 14c193fb27
commit 21499f3697
2 changed files with 3 additions and 2 deletions

View File

@@ -1067,7 +1067,7 @@ metadata/_custom_type_script = "uid://364rywt44hy6"
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="PauseMenu" parent="CanvasLayer" instance=ExtResource("31_1l20f")]
visible = false
can_exit = false
[node name="WorldSelect" parent="CanvasLayer" instance=ExtResource("32_xk7j8")]
visible = false

View File

@@ -7,6 +7,7 @@ var selected_index := 0
var active := false
@export var can_exit := true
@export var is_pause := true
signal option_1_selected
@@ -30,7 +31,7 @@ func handle_inputs() -> void:
selected_index = clamp(selected_index, 0, options.size() - 1)
if Input.is_action_just_pressed("ui_accept"):
option_selected()
elif Input.is_action_just_pressed("pause") or Input.is_action_just_pressed("ui_back"):
elif (Input.is_action_just_pressed("pause") or Input.is_action_just_pressed("ui_back")) and can_exit:
close()
func option_selected() -> void: