Add More (Y/N/C) to display ansi pause
This commit is contained in:
parent
655e7d87b4
commit
93758c24f2
19
bbs.c
19
bbs.c
@ -293,9 +293,9 @@ void s_putstring(char *c) {
|
|||||||
void s_displayansi_pause(char *file, int pause) {
|
void s_displayansi_pause(char *file, int pause) {
|
||||||
FILE *fptr;
|
FILE *fptr;
|
||||||
char c;
|
char c;
|
||||||
|
char ch;
|
||||||
int lines = 0;
|
int lines = 0;
|
||||||
|
|
||||||
fptr = fopen(file, "r");
|
fptr = fopen(file, "r");
|
||||||
if (!fptr) {
|
if (!fptr) {
|
||||||
return;
|
return;
|
||||||
@ -308,8 +308,19 @@ void s_displayansi_pause(char *file, int pause) {
|
|||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
lines++;
|
lines++;
|
||||||
if (lines == 24) {
|
if (lines == 24) {
|
||||||
s_printf(get_string(6));
|
s_printf(get_string(223));
|
||||||
s_getchar();
|
ch = s_getchar();
|
||||||
|
s_printf("\r\n");
|
||||||
|
switch(tolower(ch)) {
|
||||||
|
case 'c':
|
||||||
|
pause = 0;
|
||||||
|
break;
|
||||||
|
case 'n':
|
||||||
|
fclose(fptr);
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
lines = 0;
|
lines = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,3 +221,4 @@ File exists!\r\n
|
|||||||
%s on node %d says:\r\n %s\r\n\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;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[0;36mE. \e[1;37mUse External Editor (\e[1;33m%s\e[1;37m)\r\n
|
||||||
|
\e[1;37mMore? (Y/N/C) \e[0m
|
||||||
|
Reference in New Issue
Block a user