]> granicus.if.org Git - nethack/commitdiff
menu tab tuning
authornethack.allison <nethack.allison>
Wed, 13 Feb 2002 00:34:35 +0000 (00:34 +0000)
committernethack.allison <nethack.allison>
Wed, 13 Feb 2002 00:34:35 +0000 (00:34 +0000)
src/cmd.c
src/options.c
src/spell.c

index 6d1bafd80b9e4b70aa5894e65b1486bdc1a9bc99..678bda72d0dbde0f91f2afa7c774bebe31f8c3ab 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1048,6 +1048,7 @@ minimal_enlightenment()
        anything any;
        char buf[BUFSZ], buf2[BUFSZ];
        static char fmtstr[] = "%-15s: %-12s";
+       char deity_fmtstr[] = "%-17s%s";
 
        any.a_void = 0;
        buf[0] = buf2[0] = '\0';
@@ -1099,7 +1100,7 @@ minimal_enlightenment()
        /* Deity list */
        add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE);
        add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_BOLD, "Deities", FALSE);
-       Sprintf(buf2, "%-17s%s", align_gname(A_CHAOTIC),
+       Sprintf(buf2, deity_fmtstr, align_gname(A_CHAOTIC),
            (u.ualignbase[A_ORIGINAL] == u.ualign.type
                && u.ualign.type == A_CHAOTIC) ? " (s,c)" :
            (u.ualignbase[A_ORIGINAL] == A_CHAOTIC)       ? " (s)" :
@@ -1107,7 +1108,7 @@ minimal_enlightenment()
        Sprintf(buf, fmtstr, "chaotic deity", buf2);
        add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
 
-       Sprintf(buf2, "%-17s%s", align_gname(A_NEUTRAL),
+       Sprintf(buf2, deity_fmtstr, align_gname(A_NEUTRAL),
            (u.ualignbase[A_ORIGINAL] == u.ualign.type
                && u.ualign.type == A_NEUTRAL) ? " (s,c)" :
            (u.ualignbase[A_ORIGINAL] == A_NEUTRAL)       ? " (s)" :
@@ -1115,7 +1116,7 @@ minimal_enlightenment()
        Sprintf(buf, fmtstr, "neutral deity", buf2);
        add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
 
-       Sprintf(buf2, "%-17s%s", align_gname(A_LAWFUL),
+       Sprintf(buf2, deity_fmtstr, align_gname(A_LAWFUL),
            (u.ualignbase[A_ORIGINAL] == u.ualign.type && u.ualign.type == A_LAWFUL)  ? " (s,c)" :
            (u.ualignbase[A_ORIGINAL] == A_LAWFUL)        ? " (s)" :
            (u.ualign.type   == A_LAWFUL)        ? " (c)" : "");
index a01492b5b42e6c548d2d66c07f14ff5dbdda1561..905faf8755972682cad5394d34a71aef736e713b 100644 (file)
@@ -2196,7 +2196,7 @@ map_menu_cmd(ch)
 #endif
 
 static char fmtstr_doset_add_menu[] = "%s%-15s [%s]   "; 
-static char fmtstr_doset_add_menu_tab[] = "%s\t%s\t[%s]   "; 
+static char fmtstr_doset_add_menu_tab[] = "%s\t[%s]";
 
 STATIC_OVL void
 doset_add_menu(win, option, indexoffset)
@@ -2229,8 +2229,10 @@ doset_add_menu(win, option, indexoffset)
        }
     }
     /* "    " replaces "a - " -- assumes menus follow that style */
-    Sprintf(buf, iflags.menu_tab_sep ? fmtstr_doset_add_menu_tab : fmtstr_doset_add_menu,
-               any.a_int ? "" : iflags.menu_tab_sep ? "" : "    ", option, value);
+    if (!iflags.menu_tab_sep)
+       Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : "    ", option, value);
+    else
+       Sprintf(buf, fmtstr_doset_add_menu_tab, option, value);
     add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED);
 }
 
@@ -2274,8 +2276,7 @@ doset()
                            pass == 0 ? "    " : "",
                            boolopt[i].name, *bool_p ? "true" : "false");
                    else
-                       Sprintf(buf, "%s\t%s\t[%s]",
-                           pass == 0 ? "    " : "",
+                       Sprintf(buf, "%s\t[%s]",
                            boolopt[i].name, *bool_p ? "true" : "false");
                    add_menu(tmpwin, NO_GLYPH, &any, 0, 0,
                             ATR_NONE, buf, MENU_UNSELECTED);
index 6be70615be048a25444911253a63fc5c9985abfe..03fb748631b76e361203011d5c682378accb5a93 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)spell.c    3.4     2002/01/19      */
+/*     SCCS Id: @(#)spell.c    3.4     2002/02/12      */
 /*     Copyright (c) M. Stephenson 1988                          */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -998,10 +998,14 @@ int *spell_no;
         * To do it right would require that we implement columns
         * in the window-ports (say via a tab character).
         */
-       Sprintf(buf, "%-20s     Level  %-12s Fail", "    Name", "Category");
+       if (!iflags.menu_tab_sep)
+               Sprintf(buf, "%-20s     Level  %-12s Fail", "    Name", "Category");
+       else
+               Sprintf(buf, "%-20s\tLevel\tCategory\tFail", "Name");
        add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED);
        for (i = 0; i < MAXSPELL && spellid(i) != NO_SPELL; i++) {
-               Sprintf(buf, "%-20s  %2d%s   %-12s %3d%%",
+               Sprintf(buf, iflags.menu_tab_sep ?
+                       "%s\t%2d%s\t%s\t%3d%%" : "%-20s  %2d%s   %-12s %3d%%",
                        spellname(i), spellev(i),
                        spellknow(i) ? " " : "*",
                        spelltypemnemonic(spell_skilltype(spellid(i))),