-- Generated by StepMania to FNF Converter v1.3 (By Slushi) --

function onCreatePost()
    initShaderFromSource("chromAB", "ChromAbEffect")
    setCameraShader("notestuff", "chromAB")

    setProperty("camGame.alpha", 0)
    setProperty("camHUD.alpha", 0)

    canResizableWindow(false)
end

function onBeatHit()
    if curBeat == 220 then
        startTween("hideSLEHUD", "camSLEHUD", { alpha = 0 }, 2.5, { ease = "linear" })
        setWallpaper("")
    end
    if curBeat == 231 then
        setShaderProperty("chromAB", "strength", 0.025)
        tweenShaderFloat("firstShaderTween", "chromAB", "strength", 0, 0.2, "linear")
        setWindowPos("X", getWindowPos("X") + 20)
        setWindowPos("Y", getWindowPos("Y") + 20)
        doTweenWinPos("X", "windowTweenX", getWindowPos("X") - 20, 0.6, "linear")
        doTweenWinPos("Y", "windowTween", getWindowPos("Y") - 20, 0.6, "linear")
    end

    if curBeat == 247 then
        setShaderProperty("chromAB", "strength", 0.025)
        tweenShaderFloat("shaderTween2", "chromAB", "strength", 0, 0.2, "linear")
        setWindowPos("X", getWindowPos("X") - 20)
        doTweenWinPos("X", "windowTweenX", getWindowPos("X") + 20, 0.6, "linear")
    end
    if curBeat >= 295 and curBeat <= 359 then
        if curBeat % 2 == 0 then
            setWindowPos("X", getWindowPos("X") - 20)
            doTweenWinPos("X", "windowTween", getWindowPos("X") + 20, 0.3, "linear")
            tweenDesktopIcons(true)
        else
            setWindowPos("X", getWindowPos("X") + 20)
            doTweenWinPos("X", "windowTweenX", getWindowPos("X") - 20, 0.3, "linear")
            tweenDesktopIcons(false)
        end
    end
end

function onUpdatePost(elapsed)
end

function onDestroy()
    setWallpaper("default")
end

function tweenDesktopIcons(mode)
    local value = 20
    if mode then
        moveDesktopWindows("X", getDesktopWindowsPos("X") + value)
        doTweenDesktopWindows("X", getDesktopWindowsPos("X") - value, 0.2, "linear")
    else
        moveDesktopWindows("X", getDesktopWindowsPos("X") - value)
        doTweenDesktopWindows("X", getDesktopWindowsPos("X") + value, 0.2, "linear")
    end
end
