fixed bug where pressing pause button when paused

This commit is contained in:
pennyrigate 2023-02-21 04:10:41 -05:00
parent 758cf57f8d
commit 809b6510c4
3 changed files with 8 additions and 3 deletions

View file

@ -158,7 +158,7 @@ func play_music(song):
if Game.ac_music.stream != song or Game.ac_music.playing == false: if Game.ac_music.stream != song or Game.ac_music.playing == false:
play_sound(song,ac_music) play_sound(song,ac_music)
func _process(delta): func _physics_process(delta):
if Debug.entry == false: if Debug.entry == false:
#CRT FILTER #CRT FILTER
if Input.is_action_just_pressed("crt"): if Input.is_action_just_pressed("crt"):
@ -171,6 +171,6 @@ func _process(delta):
else: else:
OS.set_window_fullscreen(false) OS.set_window_fullscreen(false)
#Pause #Pause
if Input.is_action_just_pressed("pause") && can_pause: if Input.is_action_just_pressed("pause") && can_pause && !get_tree().paused:
var viewport = get_parent().get_node("Main/Control/ViewportContainer/Viewport") var viewport = get_parent().get_node("Main/Control/ViewportContainer/Viewport")
viewport.add_child(pause_screen.instance()) viewport.add_child(pause_screen.instance())

View file

@ -8,8 +8,10 @@ func _ready():
func _physics_process(delta): func _physics_process(delta):
#Resume with pause button #Resume with pause button
if Input.is_action_just_pressed("pause"): if Input.is_action_just_pressed("pause"):
get_tree().paused = false
queue_free() queue_free()
get_tree().paused = false
Debug.print(get_tree().paused)
func _on_Resume_pressed(): func _on_Resume_pressed():
get_tree().paused = false get_tree().paused = false

View file

@ -162,6 +162,9 @@ debug_testroom={
pause={ pause={
"deadzone": 0.5, "deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"physical_scancode":0,"unicode":0,"echo":false,"script":null) "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":80,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
] ]
} }