mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 07:28:14 +00:00
fixed a bug where the puase menu couldnt be closed by pressing the pause button again
This commit is contained in:
@@ -8,6 +8,21 @@
|
|||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dnx1i"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dnx1i"]
|
||||||
size = Vector2(10, 8)
|
size = Vector2(10, 8)
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_5y583"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite:offset")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_dnx1i"]
|
[sub_resource type="Animation" id="Animation_dnx1i"]
|
||||||
resource_name = "Shake"
|
resource_name = "Shake"
|
||||||
length = 0.2
|
length = 0.2
|
||||||
@@ -25,21 +40,6 @@ tracks/0/keys = {
|
|||||||
"values": [Vector2(-1, 0), Vector2(1, 0)]
|
"values": [Vector2(-1, 0), Vector2(1, 0)]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_5y583"]
|
|
||||||
length = 0.001
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("Sprite:offset")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0, 0)]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_2sios"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_2sios"]
|
||||||
_data = {
|
_data = {
|
||||||
&"RESET": SubResource("Animation_5y583"),
|
&"RESET": SubResource("Animation_5y583"),
|
||||||
|
@@ -105,6 +105,7 @@ visible = true
|
|||||||
[node name="LabelFontChanger" parent="SettingsMenu" index="1" node_paths=PackedStringArray("labels")]
|
[node name="LabelFontChanger" parent="SettingsMenu" index="1" node_paths=PackedStringArray("labels")]
|
||||||
labels = [NodePath("../PanelContainer/MarginContainer/VBoxContainer/Title"), NodePath("../PanelContainer/MarginContainer/VBoxContainer/CategorySelect/HBoxContainer/Category"), null, null, null, null, null, null, null, NodePath("../PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode/Value"), null, NodePath("../PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode2/Value"), null, NodePath("../PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode3/Value"), NodePath("../PanelContainer/MarginContainer/VBoxContainer/Difficulty/Description/AutoScrollContainer/MarginContainer/Desc")]
|
labels = [NodePath("../PanelContainer/MarginContainer/VBoxContainer/Title"), NodePath("../PanelContainer/MarginContainer/VBoxContainer/CategorySelect/HBoxContainer/Category"), null, null, null, null, null, null, null, NodePath("../PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode/Value"), null, NodePath("../PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode2/Value"), null, NodePath("../PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode3/Value"), NodePath("../PanelContainer/MarginContainer/VBoxContainer/Difficulty/Description/AutoScrollContainer/MarginContainer/Desc")]
|
||||||
|
|
||||||
|
[connection signal="closed" from="." to="SettingsMenu" method="close"]
|
||||||
[connection signal="option_3_selected" from="." to="." method="open_settings"]
|
[connection signal="option_3_selected" from="." to="." method="open_settings"]
|
||||||
|
|
||||||
[editable path="SettingsMenu"]
|
[editable path="SettingsMenu"]
|
||||||
|
@@ -221,12 +221,14 @@ metadata/_custom_type_script = "uid://364rywt44hy6"
|
|||||||
[node name="6" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot1/ChallengeModeBits"]
|
[node name="6" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot1/ChallengeModeBits"]
|
||||||
position = Vector2(41, 4)
|
position = Vector2(41, 4)
|
||||||
texture = ExtResource("11_sk22j")
|
texture = ExtResource("11_sk22j")
|
||||||
region_enabled = true
|
hframes = 3
|
||||||
|
vframes = 2
|
||||||
region_rect = Rect2(0, 0, 8, 8)
|
region_rect = Rect2(0, 0, 8, 8)
|
||||||
script = ExtResource("6_x05vu")
|
script = ExtResource("6_x05vu")
|
||||||
metadata/_custom_type_script = "uid://364rywt44hy6"
|
metadata/_custom_type_script = "uid://364rywt44hy6"
|
||||||
|
|
||||||
[node name="Full" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot1/ChallengeModeBits/6"]
|
[node name="Full" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot1/ChallengeModeBits/6"]
|
||||||
|
visible = false
|
||||||
texture = ExtResource("11_sk22j")
|
texture = ExtResource("11_sk22j")
|
||||||
region_enabled = true
|
region_enabled = true
|
||||||
region_rect = Rect2(8, 0, 8, 8)
|
region_rect = Rect2(8, 0, 8, 8)
|
||||||
@@ -417,14 +419,16 @@ metadata/_custom_type_script = "uid://364rywt44hy6"
|
|||||||
[node name="6" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot2/ChallengeModeBits"]
|
[node name="6" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot2/ChallengeModeBits"]
|
||||||
position = Vector2(41, 4)
|
position = Vector2(41, 4)
|
||||||
texture = ExtResource("11_sk22j")
|
texture = ExtResource("11_sk22j")
|
||||||
region_enabled = true
|
hframes = 3
|
||||||
|
vframes = 2
|
||||||
region_rect = Rect2(0, 0, 8, 8)
|
region_rect = Rect2(0, 0, 8, 8)
|
||||||
script = ExtResource("6_x05vu")
|
script = ExtResource("6_x05vu")
|
||||||
metadata/_custom_type_script = "uid://364rywt44hy6"
|
metadata/_custom_type_script = "uid://364rywt44hy6"
|
||||||
|
|
||||||
[node name="Full" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot2/ChallengeModeBits/6"]
|
[node name="Full" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot2/ChallengeModeBits/6"]
|
||||||
texture = ExtResource("11_sk22j")
|
texture = ExtResource("11_sk22j")
|
||||||
region_enabled = true
|
hframes = 3
|
||||||
|
vframes = 2
|
||||||
region_rect = Rect2(16, 0, 8, 8)
|
region_rect = Rect2(16, 0, 8, 8)
|
||||||
script = ExtResource("6_x05vu")
|
script = ExtResource("6_x05vu")
|
||||||
metadata/_custom_type_script = "uid://364rywt44hy6"
|
metadata/_custom_type_script = "uid://364rywt44hy6"
|
||||||
@@ -613,14 +617,16 @@ metadata/_custom_type_script = "uid://364rywt44hy6"
|
|||||||
[node name="6" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot3/ChallengeModeBits"]
|
[node name="6" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot3/ChallengeModeBits"]
|
||||||
position = Vector2(41, 4)
|
position = Vector2(41, 4)
|
||||||
texture = ExtResource("11_sk22j")
|
texture = ExtResource("11_sk22j")
|
||||||
region_enabled = true
|
hframes = 3
|
||||||
|
vframes = 2
|
||||||
region_rect = Rect2(0, 0, 8, 8)
|
region_rect = Rect2(0, 0, 8, 8)
|
||||||
script = ExtResource("6_x05vu")
|
script = ExtResource("6_x05vu")
|
||||||
metadata/_custom_type_script = "uid://364rywt44hy6"
|
metadata/_custom_type_script = "uid://364rywt44hy6"
|
||||||
|
|
||||||
[node name="Full" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot3/ChallengeModeBits/6"]
|
[node name="Full" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot3/ChallengeModeBits/6"]
|
||||||
texture = ExtResource("11_sk22j")
|
texture = ExtResource("11_sk22j")
|
||||||
region_enabled = true
|
hframes = 3
|
||||||
|
vframes = 2
|
||||||
region_rect = Rect2(0, 8, 8, 8)
|
region_rect = Rect2(0, 8, 8, 8)
|
||||||
script = ExtResource("6_x05vu")
|
script = ExtResource("6_x05vu")
|
||||||
metadata/_custom_type_script = "uid://364rywt44hy6"
|
metadata/_custom_type_script = "uid://364rywt44hy6"
|
||||||
@@ -809,14 +815,16 @@ metadata/_custom_type_script = "uid://364rywt44hy6"
|
|||||||
[node name="6" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot4/ChallengeModeBits"]
|
[node name="6" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot4/ChallengeModeBits"]
|
||||||
position = Vector2(41, 4)
|
position = Vector2(41, 4)
|
||||||
texture = ExtResource("11_sk22j")
|
texture = ExtResource("11_sk22j")
|
||||||
region_enabled = true
|
hframes = 3
|
||||||
|
vframes = 2
|
||||||
region_rect = Rect2(0, 0, 8, 8)
|
region_rect = Rect2(0, 0, 8, 8)
|
||||||
script = ExtResource("6_x05vu")
|
script = ExtResource("6_x05vu")
|
||||||
metadata/_custom_type_script = "uid://364rywt44hy6"
|
metadata/_custom_type_script = "uid://364rywt44hy6"
|
||||||
|
|
||||||
[node name="Full" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot4/ChallengeModeBits/6"]
|
[node name="Full" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/ScrollContainer/SlotContainer/Slot4/ChallengeModeBits/6"]
|
||||||
texture = ExtResource("11_sk22j")
|
texture = ExtResource("11_sk22j")
|
||||||
region_enabled = true
|
hframes = 3
|
||||||
|
vframes = 2
|
||||||
region_rect = Rect2(8, 8, 8, 8)
|
region_rect = Rect2(8, 8, 8, 8)
|
||||||
script = ExtResource("6_x05vu")
|
script = ExtResource("6_x05vu")
|
||||||
metadata/_custom_type_script = "uid://364rywt44hy6"
|
metadata/_custom_type_script = "uid://364rywt44hy6"
|
||||||
|
@@ -14,6 +14,8 @@ signal option_2_selected
|
|||||||
signal option_3_selected
|
signal option_3_selected
|
||||||
signal option_4_selected
|
signal option_4_selected
|
||||||
|
|
||||||
|
signal closed
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
if active:
|
if active:
|
||||||
handle_inputs()
|
handle_inputs()
|
||||||
@@ -28,6 +30,8 @@ func handle_inputs() -> void:
|
|||||||
selected_index = clamp(selected_index, 0, options.size() - 1)
|
selected_index = clamp(selected_index, 0, options.size() - 1)
|
||||||
if Input.is_action_just_pressed("ui_accept"):
|
if Input.is_action_just_pressed("ui_accept"):
|
||||||
option_selected()
|
option_selected()
|
||||||
|
elif Input.is_action_just_pressed("pause") or Input.is_action_just_pressed("ui_back"):
|
||||||
|
close()
|
||||||
|
|
||||||
func option_selected() -> void:
|
func option_selected() -> void:
|
||||||
emit_signal("option_" + str(selected_index + 1) + "_selected")
|
emit_signal("option_" + str(selected_index + 1) + "_selected")
|
||||||
@@ -51,6 +55,7 @@ func close() -> void:
|
|||||||
active = false
|
active = false
|
||||||
selected_index = 0
|
selected_index = 0
|
||||||
hide()
|
hide()
|
||||||
|
closed.emit()
|
||||||
for i in 2:
|
for i in 2:
|
||||||
await get_tree().physics_frame
|
await get_tree().physics_frame
|
||||||
Global.game_paused = false
|
Global.game_paused = false
|
||||||
|
Reference in New Issue
Block a user