custompline(SUPPRESS_HISTORY,...) for curses
The curses interface already has a hack to keep 'Count: 12', 'Count: 123' intermediate multi-digit counts out of its message recall history for ^P, but it was flushing real messages when getpos()'s 'autodescribe' reported what the cursor moved over. Overload the count hack to support putstr(WIN_MESSAGE, ATR_NOHISTORY, text) (which is what custompline(SUPPRESS_HISTORY, ...) eventually calls). The conditional logic for when to create the 'count_window' was pretty convoluted. This simplification has the same semantics but I don't have PDCURSES to actually verify that.
This commit is contained in:
@@ -632,7 +632,7 @@ curses_get_count(int first_digit)
|
||||
current_count = LARGEST_INT;
|
||||
}
|
||||
|
||||
pline("Count: %ld", current_count);
|
||||
custompline(SUPPRESS_HISTORY, "Count: %ld", current_count);
|
||||
current_char = curses_read_char();
|
||||
}
|
||||
|
||||
@@ -647,13 +647,17 @@ curses_get_count(int first_digit)
|
||||
|
||||
|
||||
/* Convert the given NetHack text attributes into the format curses
|
||||
understands, and return that format mask. */
|
||||
understands, and return that format mask. */
|
||||
|
||||
int
|
||||
curses_convert_attr(int attr)
|
||||
{
|
||||
int curses_attr;
|
||||
|
||||
/* first, strip off control flags masked onto the display attributes
|
||||
(caller should have already done this...) */
|
||||
attr &= ~(ATR_URGENT | ATR_NOHISTORY);
|
||||
|
||||
switch (attr) {
|
||||
case ATR_NONE:
|
||||
curses_attr = A_NORMAL;
|
||||
|
||||
Reference in New Issue
Block a user