extends LimboState

@export var sprite: SpineSprite

func _enter() -> void:
  sprite.animation_event.connect(emit_show_laptop)
  var a = sprite.get_animation_state()
  if agent.can_pause:
    a.set_empty_animation(0, 0.4)
    a.set_animation("holding/laptop", false, 1)
    #Messagebus.PAUSE.emit(true)


func emit_show_laptop(sprite: SpineSprite, animation_state: SpineAnimationState, track_entry: SpineTrackEntry, event: SpineEvent):
  print("spine event"+str(event))
  var event_name = event.get_data().get_event_name()
  if event_name == "show_laptop":
    Messagebus.LAPTOP.emit(true)
        
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
  pass
