diff options
| author | david <[email protected]> | 2026-09-20 07:59:28 -0300 |
|---|---|---|
| committer | david <[email protected]> | 2026-09-20 07:59:28 -0300 |
| commit | 6b3829ef5888ff48dbf47b2cf99faf3c4b65e168 (patch) | |
| tree | fc96e7bba52aba6d9339741e7d237e9b77431c65 /rat.c | |
| parent | 9cf79cf6c6b979a85f4423abedb45c686f002c5d (diff) | |
| download | petratc-6b3829ef5888ff48dbf47b2cf99faf3c4b65e168.tar.gz petratc-6b3829ef5888ff48dbf47b2cf99faf3c4b65e168.zip | |
i'm suck a fucking genius
Diffstat (limited to 'rat.c')
| -rw-r--r-- | rat.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -79,12 +79,33 @@ void setstat(){ rat.age = timenow; } +#define minlines 25 +#define mincols 80 + +static void checkminsize(void){ + if(LINES >= minlines && COLS >= mincols) return; + + clear(); + mvprintw(0, 0, "terminal too small! need at least %dx%d, got %dx%d.", mincols, minlines, COLS, LINES); + mvprintw(1, 0, "press any key to exit..."); + refresh(); + + nodelay(stdscr, FALSE); + getch(); + + save(); + endwin(); + exit(1); +} + WINDOW *ratdrawbox(void){ static int initialized = 0; if(!initialized){ initscr(); }else{ refresh(); } ++initialized; + checkminsize(); + noecho(); cbreak(); nodelay(stdscr, TRUE); |
