From ba4f90eefbe2e60f2e10442243c0818a91e0dd56 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 26 Apr 2025 12:50:48 -0700 Subject: [PATCH] PR #1406 = use_menu_glyphs for curses and tty Pull request from NullCGT: add 'use_menu_glyphs' option to be able show the object class symbol in menus of objects. tty: |a ? scroll of identify (instead of 'a - scroll of identify'), curses: | a) ? scroll of identify (instead of ' a) scroll of identify'). This commit fixes a bit of formatting in wintty.c. Closes #1406 --- win/tty/wintty.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 7806785aa..d042e6c9d 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1461,15 +1461,19 @@ process_menu_window(winid window, struct WinDesc *cw) (void) putchar('+'); /* all selected */ else (void) putchar('#'); /* count selected */ - } else if (iflags.use_menu_glyphs && n == 2 - && curr->identifier.a_void != 0 - && curr->glyphinfo.glyph != NO_GLYPH) { - /* tty_print_glyph could be used, but is overkill and requires referencing the cursor location */ - toggle_menu_attr(TRUE, curr->glyphinfo.gm.sym.color, ATR_NONE); + } else if (iflags.use_menu_glyphs && n == 2 + && curr->identifier.a_void != 0 + && curr->glyphinfo.glyph != NO_GLYPH) { + int gcolor = curr->glyphinfo.gm.sym.color; + + /* tty_print_glyph could be used, but is overkill + and requires referencing the cursor location */ + toggle_menu_attr(TRUE, gcolor, ATR_NONE); (void) putchar(curr->glyphinfo.ttychar); - toggle_menu_attr(FALSE, curr->glyphinfo.gm.sym.color, ATR_NONE); - } else + toggle_menu_attr(FALSE, gcolor, ATR_NONE); + } else { (void) putchar(*cp); + } } /* for *cp */ if (n > attr_n && (color != NO_COLOR || attr != ATR_NONE)) toggle_menu_attr(FALSE, color, attr);