interface feedback by #version
When there was only one supported interface included in the program, feedback of |Supported windowing system: |"tty" (traditional text with optional line-drawing) was missing the intended final period. When there were more than one, the clause describing the default could be preceded by a spurious space. |Supported windowing systems: |"tty" (traditional text with optional line-drawing) and "Qt" , with a |default of "tty". There was a fixup for " , " but it only worked as intended when that was on the last line, not when the default's text spanned lines. This adds description of "Windows GUI" to the mswin entry. X11 could have its formal name "The X Windows System" as the description but I didn't add that since it just seems like extra verbosity. Apparently Qt doesn't stand for anything else so still has no extra description.
This commit is contained in:
39
src/mdlib.c
39
src/mdlib.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 mdlib.c $NHDT-Date: 1593953352 2020/07/05 12:49:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.9 $ */
|
||||
/* NetHack 3.7 mdlib.c $NHDT-Date: 1596567095 2020/08/04 18:51:35 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.10 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
|
||||
/* Copyright (c) M. Stephenson, 1990, 1991. */
|
||||
@@ -63,7 +63,9 @@ static char *FDECL(bannerc_string, (char *, const char *));
|
||||
static int FDECL(case_insensitive_comp, (const char *, const char *));
|
||||
static void NDECL(make_version);
|
||||
static char *FDECL(eos, (char *));
|
||||
#if 0
|
||||
static char *FDECL(mdlib_strsubst, (char *, const char *, const char *));
|
||||
#endif
|
||||
#endif /* MAKEDEFS_C || FOR_RUNTIME */
|
||||
#if !defined(MAKEDEFS_C) && defined(WIN32)
|
||||
extern int GUILaunched;
|
||||
@@ -118,6 +120,11 @@ static struct win_info window_opts[] = {
|
||||
#ifdef QT_GRAPHICS /* too vague; there are multiple incompatible versions */
|
||||
{ "Qt", "Qt", TRUE },
|
||||
#endif
|
||||
#ifdef MSWIN_GRAPHICS /* win32 */
|
||||
{ "mswin", "Windows GUI", TRUE },
|
||||
#endif
|
||||
|
||||
#if 0 /* remainder have been retired */
|
||||
#ifdef GNOME_GRAPHICS /* unmaintained/defunct */
|
||||
{ "Gnome", "Gnome", TRUE },
|
||||
#endif
|
||||
@@ -130,12 +137,10 @@ static struct win_info window_opts[] = {
|
||||
#ifdef GEM_GRAPHICS /* defunct Atari interface */
|
||||
{ "Gem", "Gem", TRUE },
|
||||
#endif
|
||||
#ifdef MSWIN_GRAPHICS /* win32 */
|
||||
{ "mswin", "mswin", TRUE },
|
||||
#endif
|
||||
#ifdef BEOS_GRAPHICS /* unmaintained/defunct */
|
||||
{ "BeOS", "BeOS InterfaceKit", TRUE },
|
||||
#endif
|
||||
#endif /* 0 => retired */
|
||||
{ 0, 0, FALSE }
|
||||
};
|
||||
|
||||
@@ -345,6 +350,7 @@ char *str;
|
||||
return str;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static char *
|
||||
mdlib_strsubst(bp, orig, replacement)
|
||||
char *bp;
|
||||
@@ -363,6 +369,7 @@ const char *orig, *replacement;
|
||||
}
|
||||
return bp;
|
||||
}
|
||||
#endif
|
||||
|
||||
static char save_bones_compat_buf[BUFSZ];
|
||||
|
||||
@@ -615,8 +622,7 @@ int *length_p; /* in/out */
|
||||
} else {
|
||||
Sprintf(eos(optbuf), " "), (*length_p)++;
|
||||
}
|
||||
Sprintf(eos(optbuf),
|
||||
"%s", str), *length_p += (int) strlen(str);
|
||||
Sprintf(eos(optbuf), "%s", str), *length_p += (int) strlen(str);
|
||||
str += strlen(str) + (word ? 1 : 0);
|
||||
}
|
||||
}
|
||||
@@ -694,23 +700,24 @@ build_options()
|
||||
Sprintf(eos(buf), " (%s)", window_opts[i].name);
|
||||
/*
|
||||
* 1 : foo.
|
||||
* 2 : foo and bar (note no period; comes from 'with default' below)
|
||||
* 3+: for, bar, and quux
|
||||
* 2 : foo and bar,
|
||||
* 3+: for, bar, and quux,
|
||||
*
|
||||
* 2+ will be followed by " with a default of..."
|
||||
*/
|
||||
if (cnt != (winsyscnt - 1)) {
|
||||
Strcat(buf, (winsyscnt == 1) ? "." /* no 'default' */
|
||||
: (winsyscnt == 2 && cnt == 0) ? " and"
|
||||
: (cnt == winsyscnt - 2) ? ", and"
|
||||
: ",");
|
||||
}
|
||||
Strcat(buf, (winsyscnt == 1) ? "." /* no 'default' */
|
||||
: (winsyscnt == 2 && cnt == 0) ? " and"
|
||||
: (cnt == winsyscnt - 2) ? ", and"
|
||||
: ",");
|
||||
opt_out_words(buf, &length);
|
||||
cnt++;
|
||||
}
|
||||
if (cnt > 1) {
|
||||
Sprintf(buf, ", with a default of \"%s\".", defwinsys);
|
||||
/* loop ended with a comma; opt_out_words() will insert a space */
|
||||
Sprintf(buf, "with a default of \"%s\".", defwinsys);
|
||||
opt_out_words(buf, &length);
|
||||
}
|
||||
(void) mdlib_strsubst(optbuf, " , ", ", ");
|
||||
|
||||
opttext[idxopttext] = strdup(optbuf);
|
||||
if (idxopttext < (MAXOPT - 1))
|
||||
idxopttext++;
|
||||
|
||||
Reference in New Issue
Block a user