function showMenu()

in scripts/file_manager.ts [30:58]


function showMenu() {
    if (cursor < scrollTop + 2)
        scrollTop = cursor - 2
    else if (cursor > scrollTop + 11)
        scrollTop = cursor - 11
    if (scrollTop < 0)
        scrollTop = 0
    let num = 0
    for (let i = 0; i < todel.length; ++i)
        if (todel[i]) num++
    programs[programs.length - 1] =
        confirm ? "Enter to confirm" : "Delete " + num + " file(s)"

    brick.clearScreen()

    const h = brick.lineHeight()
    for (let i = 0; i < 13; ++i) {
        const y = i * h
        const idx = scrollTop + i
        const fg = idx == cursor ? 0 : 1
        const bg = idx == cursor ? 1 : 0
        // screen.fillRect(0, y, screen.width, h, bg);
        let text = (idx == cursor ? ">" : " ")
            + (todel[idx] ? "*" : " ")
            + " "
            + (programs[scrollTop + i] || "")
        screen.print(text, 0, y, fg, brick.font);
    }
}