From 93758c24f29f54c6f6a54b14d84ac8c1d439d9e7 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 20 Sep 2017 06:04:47 +1000 Subject: [PATCH] Add More (Y/N/C) to display ansi pause --- bbs.c | 19 +++++++++++++++---- magicka.strings | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bbs.c b/bbs.c index feb8a61..9b19f03 100644 --- a/bbs.c +++ b/bbs.c @@ -293,9 +293,9 @@ void s_putstring(char *c) { void s_displayansi_pause(char *file, int pause) { FILE *fptr; char c; - + char ch; int lines = 0; - + fptr = fopen(file, "r"); if (!fptr) { return; @@ -308,8 +308,19 @@ void s_displayansi_pause(char *file, int pause) { if (c == '\n') { lines++; if (lines == 24) { - s_printf(get_string(6)); - s_getchar(); + s_printf(get_string(223)); + ch = s_getchar(); + s_printf("\r\n"); + switch(tolower(ch)) { + case 'c': + pause = 0; + break; + case 'n': + fclose(fptr); + return; + default: + break; + } lines = 0; } } diff --git a/magicka.strings b/magicka.strings index 44d683f..62d4865 100644 --- a/magicka.strings +++ b/magicka.strings @@ -221,3 +221,4 @@ File exists!\r\n %s on node %d says:\r\n %s\r\n\r\n \e[0;36mC. \e[1;37mCodepage (\e[1;33m%s\e[1;37m)\r\n \e[0;36mE. \e[1;37mUse External Editor (\e[1;33m%s\e[1;37m)\r\n +\e[1;37mMore? (Y/N/C) \e[0m