]> granicus.if.org Git - nethack/commitdiff
Revert "Omit accel and select char from menu colors"
authorTung Nguyen <tungtn3@gmail.com>
Wed, 23 Mar 2016 08:33:42 +0000 (19:33 +1100)
committerTung Nguyen <tungtn3@gmail.com>
Wed, 23 Mar 2016 08:33:42 +0000 (19:33 +1100)
This reverts commit 2ff96797a8a52d0917529f68f1a3e38dca2668e8.

Since this pull request was made to the DevTeam, a commit has appeared
in the official repo's NetHack-3.6.0 branch which effectively does the
same thing: NetHack commit 98b5f58 (tty menu coloring) by PatR.

win/tty/wintty.c

index e99418d7f7c9fd53931c1c87945425ced654d80d..73166b7db69c312fe7738f8905feedbdc8f38ce1 100644 (file)
@@ -1774,15 +1774,6 @@ struct WinDesc *cw;
                      page_lines++, curr = curr->next) {
                     int color = NO_COLOR, attr = ATR_NONE;
                     boolean menucolr = FALSE;
-                    int select_pos = -1; /* -/+/# position for selectables */
-                    int format_start_pos = 0; /* menu color/attr start pos */
-
-                    if (curr->identifier.a_void != 0) {
-                        /* "a - whatever" */
-                        select_pos = 2; /* '-' */
-                        format_start_pos = 4; /* start of "whatever" */
-                    }
-
                     if (curr->selector)
                         *rp++ = curr->selector;
 
@@ -1799,31 +1790,27 @@ struct WinDesc *cw;
                      * actually output the character.  We're faster doing
                      * this.
                      */
+                    if (iflags.use_menu_color
+                        && (menucolr = get_menu_coloring(curr->str, &color,
+                                                         &attr))) {
+                        term_start_attr(attr);
+#ifdef TEXTCOLOR
+                        if (color != NO_COLOR)
+                            term_start_color(color);
+#endif
+                    } else
+                        term_start_attr(curr->attr);
                     for (n = 0, cp = curr->str;
 #ifndef WIN32CON
                          *cp
                          && (int) ++ttyDisplay->curx < (int) ttyDisplay->cols;
-                         cp++, n++
+                         cp++, n++)
 #else
                          *cp
                          && (int) ttyDisplay->curx < (int) ttyDisplay->cols;
-                         cp++, n++, ttyDisplay->curx++
-#endif
-                        ) {
-                        if (n == format_start_pos) {
-                            if (iflags.use_menu_color
-                                && (menucolr = get_menu_coloring(curr->str,
-                                                                 &color,
-                                                                 &attr))) {
-                                term_start_attr(attr);
-#ifdef TEXTCOLOR
-                                if (color != NO_COLOR)
-                                    term_start_color(color);
+                         cp++, n++, ttyDisplay->curx++)
 #endif
-                            } else
-                                term_start_attr(curr->attr);
-                        }
-                        if (n == select_pos && curr->identifier.a_void != 0
+                        if (n == 2 && curr->identifier.a_void != 0
                             && curr->selected) {
                             if (curr->count == -1L)
                                 (void) putchar('+'); /* all selected */
@@ -1831,7 +1818,6 @@ struct WinDesc *cw;
                                 (void) putchar('#'); /* count selected */
                         } else
                             (void) putchar(*cp);
-                    }
                     if (iflags.use_menu_color && menucolr) {
 #ifdef TEXTCOLOR
                         if (color != NO_COLOR)