simplify issuing urgent messages

Change
 custompline(URGENT_MESSAGE, mesg, ...);
calls to new
 urgent_pline(mesg, ...);
This commit is contained in:
PatR
2021-12-20 08:30:48 -08:00
parent aaed434d46
commit 2278434228
8 changed files with 51 additions and 36 deletions

View File

@@ -207,7 +207,7 @@ RESTORE_WARNING_FORMAT_NONLITERAL
message history (tty interface uses pline() to issue prompts and
they shouldn't be blockable via MSGTYPE=hide) */
void
custompline(unsigned pflags, const char * line, ...)
custompline(unsigned pflags, const char *line, ...)
{
va_list the_args;
@@ -218,6 +218,22 @@ custompline(unsigned pflags, const char * line, ...)
va_end(the_args);
}
/* if player has dismissed --More-- with ESC to suppress further messages
until next input request, tell the interface that it should override that
and re-enable them; equivalent to custompline(URGENT_MESSAGE, line, ...)
but slightly simpler to use */
void
urgent_pline(const char *line, ...)
{
va_list the_args;
va_start(the_args, line);
g.pline_flags = URGENT_MESSAGE;
vpline(line, the_args);
g.pline_flags = 0;
va_end(the_args);
}
void
Norep(const char *line, ...)
{