local function doFadeWipe(state)
  fadeWipe = celeste.FadeWipe(engine.Scene, state, nil)
  engine.Scene:Add(fadeWipe)
  fadeWipe.duration = 2
  fadeWipe.EndTimer = 1
end

local luaCutscenesUtils = require("#Celeste.Mod.MaxHelpingHand.Module.LuaCutscenesUtils")


function onTalk()

  if getFlag("introstart2") then

    setFlag("stophand")
    disablePause()
    disableMovement()
    player.ForceCameraUpdate = true

    coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CBR_WhiteSpace_door_question"))

    coroutine.yield(luaCutscenesUtils.ChoiceWithDifferentFont("OMORI_GAME", "CBR_WhiteSpace_door_answer1", "CBR_WhiteSpace_door_answer2"))
    local multipla = luaCutscenesUtils.GetChoice()

    if multipla == 1 then

      setFlag("decalportawhitespace2")
      doFadeWipe(false)
      wait(1.3)
      setFlag("outwhitespace2")

    else

      wait(0.2)
      enableMovement()
      enablePause()
      setFlag("stophand", false)

    end

  end

end