Skip to content
This repository
tree: ad46d6ff62
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 21 lines (19 sloc) 0.517 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
namespace Rosella.Terminal.Decorations
{
    function cycle_while(var term, string s, var cond, float frame_time = 0.1)
    {
        term.print(" ");
        while(cond() == true) {
            for (int i = 0; i < length(s); i++) {
                term.print("\b" + substr(s, i, 1));
                term.flush();
                sleep(frame_time);
            }
        }
        term.print("\b ");
    }

    function rotate_waiter_while(var term, var cond)
    {
        cycle_while(term, "\\|/-", cond);
    }
}
Something went wrong with that request. Please try again.