extends CanvasLayer


func _on_resume_button_pressed() -> void:
    resume()
    return


func _on_quit_button_pressed() -> void:
    get_tree().quit()
    return


func _on_resume_button_mouse_entered() -> void:
    $'Menu Button Hover'.play(0.0)
    return


func _on_quit_button_mouse_entered() -> void:
    $'Menu Button Hover'.play(0.0)
    return


func _input(event: InputEvent) -> void:
    if event.is_action_pressed('ui_cancel'):
        if get_tree().paused:
            resume()
        else:
            get_tree().paused = true
            $Background.visible = true
            $Menu.visible = true
    return


func resume() -> void:
    $Background.visible = false
    $Menu.visible = false
    get_tree().paused = false
    return
