-/* SCCS Id: @(#)options.c 3.3 2000/08/01 */
+/* SCCS Id: @(#)options.c 3.3 2002/02/02 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
* and also the Guidebooks.
*/
+/*
+ * Option flags
+ * Each higher number includes the characteristics of the numbers
+ * below it.
+ */
+#define SET_IN_FILE 0 /* config file option only, not visible in game
+ * or via program */
+#define SET_VIA_PROG 1 /* may be set via extern program, not seen in game */
+#define DISP_IN_GAME 2 /* may be set via extern program, displayed in game */
+#define SET_IN_GAME 3 /* may be set via extern program or set in the game */
+
static struct Bool_Opt
{
const char *name;
boolean *addr, initvalue;
+ int optflags;
} boolopt[] = {
#ifdef AMIGA
- {"altmeta", &flags.altmeta, TRUE},
+ {"altmeta", &flags.altmeta, TRUE, DISP_IN_GAME},
#else
- {"altmeta", (boolean *)0, TRUE},
+ {"altmeta", (boolean *)0, TRUE, DISP_IN_GAME},
#endif
+ {"ascii_map", &iflags.wc_ascii_map, TRUE, SET_IN_GAME}, /*WC*/
#ifdef MFLOPPY
- {"asksavedisk", &flags.asksavedisk, FALSE},
+ {"asksavedisk", &flags.asksavedisk, FALSE, SET_IN_GAME},
#else
- {"asksavedisk", (boolean *)0, FALSE},
+ {"asksavedisk", (boolean *)0, FALSE, SET_IN_FILE},
#endif
- {"autodig", &flags.autodig, FALSE},
- {"autopickup", &flags.pickup, TRUE},
- {"autoquiver", &flags.autoquiver, FALSE},
+ {"autodig", &flags.autodig, FALSE, SET_IN_GAME},
+ {"autopickup", &flags.pickup, TRUE, SET_IN_GAME},
+ {"autoquiver", &flags.autoquiver, FALSE, SET_IN_GAME},
#if defined(MICRO) && !defined(AMIGA)
- {"BIOS", &iflags.BIOS, FALSE},
+ {"BIOS", &iflags.BIOS, FALSE, SET_IN_FILE},
#else
- {"BIOS", (boolean *)0, FALSE},
+ {"BIOS", (boolean *)0, FALSE, SET_IN_FILE},
#endif
#ifdef INSURANCE
- {"checkpoint", &flags.ins_chkpt, TRUE},
+ {"checkpoint", &flags.ins_chkpt, TRUE, DISP_IN_GAME},
#else
- {"checkpoint", (boolean *)0, FALSE},
+ {"checkpoint", (boolean *)0, FALSE, SET_IN_FILE},
#endif
#ifdef MFLOPPY
- {"checkspace", &iflags.checkspace, TRUE},
+ {"checkspace", &iflags.checkspace, TRUE, SET_IN_GAME},
#else
- {"checkspace", (boolean *)0, FALSE},
+ {"checkspace", (boolean *)0, FALSE, SET_IN_FILE},
#endif
-#ifdef TEXTCOLOR
# ifdef MICRO
- {"color", &iflags.use_color, TRUE},
+ {"color", &iflags.wc_color,TRUE, SET_IN_GAME}, /*WC*/
# else /* systems that support multiple terminals, many monochrome */
- {"color", &iflags.use_color, FALSE},
+ {"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/
# endif
-#else
- {"color", (boolean *)0, FALSE},
-#endif
- {"confirm",&flags.confirm, TRUE},
+ {"confirm",&flags.confirm, TRUE, SET_IN_GAME},
#ifdef TERMLIB
- {"DECgraphics", &iflags.DECgraphics, FALSE},
+ {"DECgraphics", &iflags.DECgraphics, FALSE, DISP_IN_GAME},
#else
- {"DECgraphics", (boolean *)0, FALSE},
+ {"DECgraphics", (boolean *)0, FALSE, SET_IN_FILE},
#endif
+ {"eight_bit_tty", &iflags.wc_eight_bit_input, FALSE, DISP_IN_GAME}, /*WC*/
#ifdef TTY_GRAPHICS
- {"eight_bit_tty", &iflags.eight_bit_tty, FALSE},
- {"extmenu", &iflags.extmenu, FALSE},
+ {"extmenu", &iflags.extmenu, FALSE, SET_IN_GAME},
#else
- {"eight_bit_tty", (boolean *)0, FALSE},
- {"extmenu", (boolean *)0, FALSE},
+ {"extmenu", (boolean *)0, FALSE, SET_IN_FILE},
#endif
#ifdef OPT_DISPMAP
- {"fast_map", &flags.fast_map, TRUE},
+ {"fast_map", &flags.fast_map, TRUE, SET_IN_GAME},
#else
- {"fast_map", (boolean *)0, TRUE},
+ {"fast_map", (boolean *)0, TRUE, SET_IN_FILE},
#endif
- {"female", &flags.female, FALSE},
- {"fixinv", &flags.invlet_constant, TRUE},
+ {"female", &flags.female, FALSE, DISP_IN_GAME},
+ {"fixinv", &flags.invlet_constant, TRUE, DISP_IN_GAME},
#ifdef AMIFLUSH
- {"flush", &flags.amiflush, FALSE},
+ {"flush", &flags.amiflush, FALSE, SET_IN_GAME},
#else
- {"flush", (boolean *)0, FALSE},
+ {"flush", (boolean *)0, FALSE, SET_IN_FILE},
#endif
- {"help", &flags.help, TRUE},
- {"hilite_pet", &iflags.hilite_pet, FALSE},
+ {"help", &flags.help, TRUE, SET_IN_GAME},
+ {"hilite_pet", &iflags.wc_hilite_pet, FALSE, SET_IN_GAME}, /*WC*/
#ifdef ASCIIGRAPH
- {"IBMgraphics", &iflags.IBMgraphics, FALSE},
+ {"IBMgraphics", &iflags.IBMgraphics, FALSE, DISP_IN_GAME},
#else
- {"IBMgraphics", (boolean *)0, FALSE},
+ {"IBMgraphics", (boolean *)0, FALSE, SET_IN_FILE},
#endif
- {"ignintr", &flags.ignintr, FALSE},
+ {"ignintr", &flags.ignintr, FALSE, SET_IN_GAME},
+ {"large_font", &iflags.wc_large_font, FALSE, SET_IN_GAME}, /*WC*/
+ {"legacy", &flags.legacy, TRUE, DISP_IN_GAME},
+ {"lit_corridor", &flags.lit_corridor, FALSE, SET_IN_GAME},
#ifdef MAC_GRAPHICS_ENV
- {"large_font", &iflags.large_font, FALSE},
+ {"Macgraphics", &iflags.MACgraphics, TRUE, DISP_IN_GAME},
#else
- {"large_font", (boolean *)0, FALSE},
-#endif
- {"legacy", &flags.legacy, TRUE},
- {"lit_corridor", &flags.lit_corridor, FALSE},
-#ifdef MAC_GRAPHICS_ENV
- {"Macgraphics", &iflags.MACgraphics, TRUE},
-#else
- {"Macgraphics", (boolean *)0, FALSE},
+ {"Macgraphics", (boolean *)0, FALSE, SET_IN_FILE},
#endif
#ifdef MAIL
- {"mail", &flags.biff, TRUE},
+ {"mail", &flags.biff, TRUE, SET_IN_GAME},
#else
- {"mail", (boolean *)0, TRUE},
+ {"mail", (boolean *)0, TRUE, SET_IN_FILE},
#endif
#ifdef TTY_GRAPHICS
- {"msg_window", &iflags.prevmsg_window, FALSE},
+ {"msg_window", &iflags.prevmsg_window, FALSE, SET_IN_GAME},
#else
- {"msg_window", (boolean *)0, FALSE},
+ {"msg_window", (boolean *)0, FALSE, SET_IN_FILE},
#endif
#ifdef NEWS
- {"news", &iflags.news, TRUE},
-#else
- {"news", (boolean *)0, FALSE},
-#endif
- {"null", &flags.null, TRUE},
- {"number_pad", &iflags.num_pad, FALSE},
-#ifdef MAC
- {"page_wait", &flags.page_wait, TRUE},
+ {"news", &iflags.news, TRUE, DISP_IN_GAME},
#else
- {"page_wait", (boolean *)0, FALSE},
+ {"news", (boolean *)0, FALSE, SET_IN_FILE},
#endif
- {"perm_invent", &flags.perm_invent, FALSE},
+ {"null", &flags.null, TRUE, SET_IN_GAME},
+ {"number_pad", &iflags.num_pad, FALSE, SET_IN_GAME},
#ifdef MAC
- {"popup_dialog", &iflags.popup_dialog, FALSE},
-#else
- {"popup_dialog", (boolean *)0, FALSE},
-#endif
- {"prayconfirm", &flags.prayconfirm, TRUE},
-#if defined(MSDOS) && defined(USE_TILES)
- {"preload_tiles", &iflags.preload_tiles, TRUE},
+ {"page_wait", &flags.page_wait, TRUE, SET_IN_GAME},
#else
- {"preload_tiles", (boolean *)0, FALSE},
+ {"page_wait", (boolean *)0, FALSE, SET_IN_FILE},
#endif
- {"pushweapon", &flags.pushweapon, FALSE},
+ {"perm_invent", &flags.perm_invent, FALSE, SET_IN_GAME},
+ {"popup_dialog", &iflags.wc_popup_dialog, FALSE, SET_IN_GAME}, /*WC*/
+ {"prayconfirm", &flags.prayconfirm, TRUE, SET_IN_GAME},
+ {"preload_tiles", &iflags.wc_preload_tiles, TRUE, DISP_IN_GAME}, /*WC*/
+ {"pushweapon", &flags.pushweapon, FALSE, SET_IN_GAME},
#if defined(MICRO) && !defined(AMIGA)
- {"rawio", &iflags.rawio, FALSE},
+ {"rawio", &iflags.rawio, FALSE, DISP_IN_GAME},
#else
- {"rawio", (boolean *)0, FALSE},
+ {"rawio", (boolean *)0, FALSE, SET_IN_FILE},
#endif
- {"rest_on_space", &flags.rest_on_space, FALSE},
- {"safe_pet", &flags.safe_dog, TRUE},
+ {"rest_on_space", &flags.rest_on_space, FALSE, SET_IN_GAME},
+ {"safe_pet", &flags.safe_dog, TRUE, SET_IN_GAME},
#ifdef WIZARD
- {"sanity_check", &iflags.sanity_check, FALSE},
+ {"sanity_check", &iflags.sanity_check, FALSE, SET_IN_GAME},
#else
- {"sanity_check", (boolean *)0, FALSE},
+ {"sanity_check", (boolean *)0, FALSE, SET_IN_FILE},
#endif
#ifdef EXP_ON_BOTL
- {"showexp", &flags.showexp, FALSE},
+ {"showexp", &flags.showexp, FALSE, SET_IN_GAME},
#else
- {"showexp", (boolean *)0, FALSE},
+ {"showexp", (boolean *)0, FALSE, SET_IN_FILE},
#endif
#ifdef SCORE_ON_BOTL
- {"showscore", &flags.showscore, FALSE},
+ {"showscore", &flags.showscore, FALSE, SET_IN_GAME},
#else
- {"showscore", (boolean *)0, FALSE},
-#endif
- {"silent", &flags.silent, TRUE},
- {"sortpack", &flags.sortpack, TRUE},
- {"sound", &flags.soundok, TRUE},
- {"sparkle", &flags.sparkle, TRUE},
- {"standout", &flags.standout, FALSE},
- {"time", &flags.time, FALSE},
+ {"showscore", (boolean *)0, FALSE, SET_IN_FILE},
+#endif
+ {"silent", &flags.silent, TRUE, SET_IN_GAME},
+ {"sortpack", &flags.sortpack, TRUE, SET_IN_GAME},
+ {"sound", &flags.soundok, TRUE, SET_IN_GAME},
+ {"sparkle", &flags.sparkle, TRUE, SET_IN_GAME},
+ {"standout", &flags.standout, FALSE, SET_IN_GAME},
+ {"time", &flags.time, FALSE, SET_IN_GAME},
+ {"tiled_map", &iflags.wc_tiled_map, FALSE, DISP_IN_GAME}, /*WC*/
+ {"tiles_8x16", &iflags.wc_tiles_8x16, FALSE, DISP_IN_GAME}, /*WC*/
+ {"tiles_16x16", &iflags.wc_tiles_16x16, FALSE, DISP_IN_GAME}, /*WC*/
+ {"tiles_32x32", &iflags.wc_tiles_32x32, FALSE, DISP_IN_GAME}, /*WC*/
#ifdef TIMED_DELAY
- {"timed_delay", &flags.nap, TRUE},
+ {"timed_delay", &flags.nap, TRUE, SET_IN_GAME},
#else
- {"timed_delay", (boolean *)0, FALSE},
+ {"timed_delay", (boolean *)0, FALSE, SET_IN_GAME},
#endif
- {"tombstone",&flags.tombstone, TRUE},
- {"toptenwin",&flags.toptenwin, FALSE},
- {"use_inverse", &iflags.use_inverse, FALSE},
- {"verbose", &flags.verbose, TRUE},
- {(char *)0, (boolean *)0, FALSE}
+ {"tombstone",&flags.tombstone, TRUE, SET_IN_GAME},
+ {"toptenwin",&flags.toptenwin, FALSE, SET_IN_GAME},
+ {"use_inverse", &iflags.wc_inverse, FALSE, SET_IN_GAME}, /*WC*/
+ {"verbose", &flags.verbose, TRUE, SET_IN_GAME},
+ {(char *)0, (boolean *)0, FALSE, 0}
};
/* compound options, for option_help() and external programs like Amiga
* frontend */
-#define SET_IN_FILE 0 /* config file option only, not visible in game
- * or via program */
-#define SET_VIA_PROG 1 /* may be set via extern program, not seen in game */
-#define DISP_IN_GAME 2 /* may be set via extern program, displayed in game */
-#define SET_IN_GAME 3 /* may be set via extern program or set in the game */
static struct Comp_Opt
{
const char *name, *descr;
} compopt[] = {
{ "align", "your starting alignment (lawful, neutral, or chaotic)",
8, DISP_IN_GAME },
+ { "align_message", "message window alignment", 20, DISP_IN_GAME }, /*WC*/
+ { "align_status", "status window alignment", 20, DISP_IN_GAME }, /*WC*/
#ifdef MAC
{ "background", "the color of the background (black or white)",
6, SET_IN_FILE },
MAXDCHARS+1, SET_IN_FILE },
{ "effects", "the symbols to use in drawing special effects",
MAXECHARS+1, SET_IN_FILE },
-#ifdef MAC
- { "fontmap", "the font to use in the map window", 40, SET_IN_FILE },
- { "fontmessage", "the font to use in the message window",
- 40, SET_IN_FILE },
- { "fonttext", "the font to use in text windows", 40, SET_IN_FILE },
-#endif
+ { "font_map", "the font to use in the map window", 40, DISP_IN_GAME }, /*WC*/
+ { "font_menu", "the font to use in menus", 40, DISP_IN_GAME }, /*WC*/
+ { "font_message", "the font to use in the message window",
+ 40, DISP_IN_GAME }, /*WC*/
+ { "font_size_map", "the size of the map font", 20, DISP_IN_GAME }, /*WC*/
+ { "font_size_menu", "the size of the map font", 20, DISP_IN_GAME }, /*WC*/
+ { "font_size_message", "the size of the map font", 20, DISP_IN_GAME }, /*WC*/
+ { "font_size_status", "the size of the map font", 20, DISP_IN_GAME }, /*WC*/
+ { "font_size_text", "the size of the map font", 20, DISP_IN_GAME }, /*WC*/
+ { "font_status", "the font to use in status window", 40, DISP_IN_GAME }, /*WC*/
+ { "font_text", "the font to use in text windows", 40, DISP_IN_GAME }, /*WC*/
{ "fruit", "the name of a fruit you enjoy eating",
PL_FSIZ, SET_IN_GAME },
{ "gender", "your starting gender (male or female)",
8, DISP_IN_GAME },
{ "horsename", "the name of your (first) horse (e.g., horsename:Silver)",
PL_PSIZ, DISP_IN_GAME },
+ { "map_mode", "map display mode under Windows", 20, DISP_IN_GAME }, /*WC*/
{ "menustyle", "user interface for object selection",
MENUTYPELEN, SET_IN_GAME },
{ "menu_deselect_all", "deselect all items in a menu", 4, SET_IN_FILE },
PL_CSIZ, DISP_IN_GAME },
{ "scores", "the parts of the score list you wish to see",
32, SET_IN_GAME },
+ { "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/
#ifdef MSDOS
{ "soundcard", "type of sound card to use", 20, SET_IN_FILE },
#endif
#ifdef MAC
{"use_stone", "use stone background patterns", 8, SET_IN_FILE },
#endif
+ { "vary_msgcount", "show more old messages at a time", 20, DISP_IN_GAME }, /*WC*/
#ifdef MSDOS
{ "video", "method of video updating", 20, SET_IN_FILE },
#endif
40, DISP_IN_GAME },
{ "videoshades", "gray shades to map to black/gray/white",
32, DISP_IN_GAME },
-#endif
-#if 0
- { "warnlevel", "minimum monster level to trigger warning", 4, SET_IN_GAME },
-#endif
-#ifdef MSWIN_GRAPHICS
- { "win32_map_mode", "map display mode under Windows", 20, SET_IN_FILE },
- { "win32_align_status", "status window alignment", 20, SET_IN_FILE },
- { "win32_align_message", "message window alignment", 20, SET_IN_FILE },
#endif
{ "windowtype", "windowing system to use", WINTYPELEN, DISP_IN_GAME },
{ (char *)0, (char *)0, 0, 0 }
#endif
STATIC_DCL void FDECL(duplicate_opt_detection, (const char *, int));
+STATIC_OVL void FDECL(wc_set_font_name, (int, char *));
+STATIC_OVL boolean FDECL(is_wc_option, (const char *));
+STATIC_OVL boolean FDECL(wc_supported, (const char *));
+
/* check whether a user-supplied option string is a proper leading
substring of a particular option name; option string might have
a colon or equals sign and arbitrary value appended to it */
*tp = '\0';
}
+#if 0
/* some boolean options can only be set on start-up */
STATIC_OVL int
boolopt_only_initial(i)
#endif
);
}
+#endif
STATIC_OVL void
rejectoption(optname)
return;
}
+ /* WINCAP
+ * setting font options */
+ fullname = "font";
+ if (!strncmpi(opts, fullname, 4))
+ { int wintype = -1;
+
+ opts += 4;
+ if (!strncmpi(opts, "map", 3) ||
+ !strncmpi(opts, "_map", 4))
+ wintype = NHW_MAP;
+ else if (!strncmpi(opts, "message", 7) ||
+ !strncmpi(opts, "_message", 8))
+ wintype = NHW_MESSAGE;
+ else if (!strncmpi(opts, "text", 4) ||
+ !strncmpi(opts, "_text", 5))
+ wintype = NHW_TEXT;
+ else if (!strncmpi(opts, "menu", 4) ||
+ !strncmpi(opts, "_menu", 5))
+ wintype = NHW_MENU;
+ else if (!strncmpi(opts, "status", 6) ||
+ !strncmpi(opts, "_status", 7))
+ wintype = NHW_STATUS;
+
+ if (wintype > 0 &&
+ (op = string_for_env_opt(fullname, opts, FALSE)) != 0) {
+ wc_set_font_name(wintype, op);
+#ifdef MAC
+ set_font_name (wintype, op);
+#endif
+ return;
+ }
+ if (!strncmpi(opts, "_size_map", 8))
+ wintype = NHW_MAP;
+ else if (!strncmpi(opts, "_size_message", 12))
+ wintype = NHW_MESSAGE;
+ else if (!strncmpi(opts, "_size_text", 9))
+ wintype = NHW_TEXT;
+ else if (!strncmpi(opts, "_size_menu", 9))
+ wintype = NHW_MENU;
+ else if (!strncmpi(opts, "_size_status", 11))
+ wintype = NHW_STATUS;
+
+ if (wintype > 0 && !negated &&
+ (op = string_for_env_opt(fullname, opts, FALSE)) != 0) {
+ switch(wintype) {
+ case NHW_MAP:
+ iflags.wc_fontsiz_map = atoi(op);
+ break;
+ case NHW_MESSAGE:
+ iflags.wc_fontsiz_message = atoi(op);
+ break;
+ case NHW_TEXT:
+ iflags.wc_fontsiz_text = atoi(op);
+ break;
+ case NHW_MENU:
+ iflags.wc_fontsiz_menu = atoi(op);
+ break;
+ case NHW_STATUS:
+ iflags.wc_fontsiz_status = atoi(op);
+ break;
+ }
+ } else if (negated) bad_negation(fullname, TRUE);
+ return;
+ }
#ifdef CHANGE_COLOR
#ifdef MAC
fullname = "use_stone";
}
return;
}
-
- fullname = "font";
- if (!strncmpi(opts, fullname, 4))
- { int wintype = -1;
-
- opts += 4;
- if (!strncmpi (opts, "map", 3))
- wintype = NHW_MAP;
- else if (!strncmpi (opts, "message", 7))
- wintype = NHW_MESSAGE;
- else if (!strncmpi (opts, "text", 4))
- wintype = NHW_TEXT;
-
- if (wintype > 0 && (op = string_for_env_opt(fullname, opts, FALSE)) != 0)
- { set_font_name (wintype, op);
- }
- return;
- }
-#endif
+#endif
+
if (match_optname(opts, "palette", 3, TRUE)
# ifdef MAC
|| match_optname(opts, "hicolor", 3, TRUE)
}
return;
}
-#endif
+#endif /* CHANGE_COLOR */
if (match_optname(opts, "fruit", 2, TRUE)) {
char empty_str = '\0';
else warning_opts(opts, fullname);
return;
}
-#if 0
+#if 0 /* do not enable post 3.3.0 */
fullname = "warnlevel";
if (match_optname(opts, fullname, 5, TRUE)) {
op = string_for_opt(opts, negated);
return;
}
+ /* WINCAP
+ * align_status:[left|top|right|bottom] */
+ fullname = "align_status";
+ if (match_optname(opts, fullname, sizeof("align_status")-1, TRUE)) {
+ op = string_for_env_opt(fullname, opts, negated);
+ if (!negated) {
+ if (!strncmpi (op, "left", sizeof("left")-1))
+ iflags.wc_align_status = ALIGN_LEFT;
+ else if (!strncmpi (op, "top", sizeof("top")-1))
+ iflags.wc_align_status = ALIGN_TOP;
+ else if (!strncmpi (op, "right", sizeof("right")-1))
+ iflags.wc_align_status = ALIGN_RIGHT;
+ else if (!strncmpi (op, "bottom", sizeof("bottom")-1))
+ iflags.wc_align_status = ALIGN_BOTTOM;
+ else
+ badoption(opts);
+ } else if (negated) bad_negation(fullname, TRUE);
+ return;
+ }
+ /* WINCAP
+ * align_message:[left|top|right|bottom] */
+ fullname = "align_message";
+ if (match_optname(opts, fullname, sizeof("align_message")-1, TRUE)) {
+ op = string_for_env_opt(fullname, opts, negated);
+ if (!negated) {
+ if (!strncmpi (op, "left", sizeof("left")-1))
+ iflags.wc_align_message = ALIGN_LEFT;
+ else if (!strncmpi (op, "top", sizeof("top")-1))
+ iflags.wc_align_message = ALIGN_TOP;
+ else if (!strncmpi (op, "right", sizeof("right")-1))
+ iflags.wc_align_message = ALIGN_RIGHT;
+ else if (!strncmpi (op, "bottom", sizeof("bottom")-1))
+ iflags.wc_align_message = ALIGN_BOTTOM;
+ else
+ badoption(opts);
+ } else if (negated) bad_negation(fullname, TRUE);
+ return;
+ }
/* align:string */
fullname = "align";
- if (match_optname(opts, fullname, 4, TRUE)) {
+ if (match_optname(opts, fullname, sizeof("align")-1, TRUE)) {
if (negated) bad_negation(fullname, FALSE);
else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
if ((flags.initalign = str2align(op)) == ROLE_NONE)
}
#endif /* MSDOS */
-#ifdef MSWIN_GRAPHICS
- /* win32_map_mode:[tiles|ascii4x6|ascii6x8|ascii8x8|ascii16x8|ascii7x12|ascii8x12|ascii15x12
- |ascii12x16|ascii10x18|fit_to_screen] */
- fullname = "win32_map_mode";
- if (match_optname(opts, fullname, sizeof("win32_map_mode")-1, TRUE)) {
- if (negated) {
- bad_negation(fullname, FALSE);
- return;
- }
- else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) {
- return;
- }
- if (!set_win32_option(fullname, opts))
- badoption(opts);
- return;
- }
-
- /* win32_align_status:[left|top|right|bottom] */
- fullname = "win32_align_status";
- if (match_optname(opts, fullname, sizeof("win32_align_status")-1, TRUE)) {
- if (negated) {
- bad_negation(fullname, FALSE);
- return;
- }
- else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) {
- return;
- }
- if (!set_win32_option(fullname, opts))
- badoption(opts);
+ /* WINCAP
+ * map_mode:[tiles|ascii4x6|ascii6x8|ascii8x8|ascii16x8|ascii7x12|ascii8x12|
+ ascii15x12|ascii12x16|ascii10x18|fit_to_screen] */
+ fullname = "map_mode";
+ if (match_optname(opts, fullname, sizeof("map_mode")-1, TRUE)) {
+ op = string_for_env_opt(fullname, opts, negated);
+ if (!negated) {
+ if (!strncmpi (op, "tiles", sizeof("tiles")-1))
+ iflags.wc_map_mode = MAP_MODE_TILES;
+ else if (!strncmpi (op, "ascii4x6", sizeof("ascii4x6")-1))
+ iflags.wc_map_mode = MAP_MODE_ASCII4x6;
+ else if (!strncmpi (op, "ascii6x8", sizeof("ascii6x8")-1))
+ iflags.wc_map_mode = MAP_MODE_ASCII6x8;
+ else if (!strncmpi (op, "ascii8x8", sizeof("ascii8x8")-1))
+ iflags.wc_map_mode = MAP_MODE_ASCII8x8;
+ else if (!strncmpi (op, "ascii16x8", sizeof("ascii16x8")-1))
+ iflags.wc_map_mode = MAP_MODE_ASCII16x8;
+ else if (!strncmpi (op, "ascii7x12", sizeof("ascii7x12")-1))
+ iflags.wc_map_mode = MAP_MODE_ASCII7x12;
+ else if (!strncmpi (op, "ascii8x12", sizeof("ascii8x12")-1))
+ iflags.wc_map_mode = MAP_MODE_ASCII8x12;
+ else if (!strncmpi (op, "ascii15x12", sizeof("ascii15x12")-1))
+ iflags.wc_map_mode = MAP_MODE_ASCII16x12;
+ else if (!strncmpi (op, "ascii12x16", sizeof("ascii12x16")-1))
+ iflags.wc_map_mode = MAP_MODE_ASCII12x16;
+ else if (!strncmpi (op, "ascii10x18", sizeof("ascii10x18")-1))
+ iflags.wc_map_mode = MAP_MODE_ASCII10x18;
+ else if (!strncmpi (op, "fit_to_screen", sizeof("fit_to_screen")-1))
+ iflags.wc_map_mode = MAP_MODE_ASCII_FIT_TO_SCREEN;
+ else
+ badoption(opts);
+ } else if (negated) bad_negation(fullname, TRUE);
return;
}
- /* win32_align_message:[left|top|right|bottom] */
- fullname = "win32_align_message";
- if (match_optname(opts, fullname, sizeof("win32_align_message")-1, TRUE)) {
- if (negated) {
- bad_negation(fullname, FALSE);
- return;
- }
- else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) {
- return;
- }
- if (!set_win32_option(fullname, opts))
- badoption(opts);
+ /* WINCAP
+ * scroll_margin:nn */
+ fullname = "scroll_margin";
+ if (match_optname(opts, fullname, sizeof("scroll_margin")-1, TRUE)) {
+ op = string_for_env_opt(fullname, opts, negated);
+ if ((negated && !op) || (!negated && op)) {
+ iflags.wc_scroll_margin = negated ? 5 : atoi(op);
+ } else if (negated) bad_negation(fullname, TRUE);
return;
}
- /* win32_map_cliparound_margin:nn */
- fullname = "win32_map_cliparound_margin";
- if (match_optname(opts, fullname, sizeof("win32_map_cliparound_margin")-1, TRUE)) {
- if (negated) {
- bad_negation(fullname, FALSE);
- return;
- }
- else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) {
- return;
- }
- if (!set_win32_option(fullname, opts))
- badoption(opts);
+ /* WINCAP
+ * vary_msgcount:nn */
+ fullname = "vary_msgcount";
+ if (match_optname(opts, fullname, sizeof("vary_msgcount")-1, TRUE)) {
+ op = string_for_env_opt(fullname, opts, negated);
+ if ((negated && !op) || (!negated && op)) {
+ iflags.wc_vary_msgcount = negated ? 0 : atoi(op);
+ } else if (negated) bad_negation(fullname, TRUE);
return;
}
-#endif /* MSWIN_GRAPHICS */
-#ifdef WIN32CON
- /* ignore the graphical win32 graphical options silently,
- * so defaults.nh can be easily used by both tty and win32
- */
- if (match_optname(opts, "win32_map_mode",
- sizeof("win32_map_mode")-1, TRUE) ||
- match_optname(opts, "win32_align_status",
- sizeof("win32_align_status")-1, TRUE) ||
- match_optname(opts, "win32_align_message",
- sizeof("win32_align_message")-1, TRUE) ||
- match_optname(opts, "win32_map_cliparound_margin",
- sizeof("win32_map_cliparound_margin")-1, TRUE))
- return;
-#endif
fullname = "windowtype";
if (match_optname(opts, fullname, 3, TRUE)) {
return;
}
/* options that must come from config file */
+#if 0
if (!initial && boolopt_only_initial(i)) {
+#else
+ if (!initial && (boolopt[i].optflags == SET_IN_FILE)) {
+#endif
rejectoption(boolopt[i].name);
return;
}
for (pass = 0; pass <= 1; pass++)
for (i = 0; boolopt[i].name; i++)
if ((bool_p = boolopt[i].addr) != 0 &&
- (boolopt_only_initial(i) ^ pass)) {
+ ((boolopt[i].optflags == DISP_IN_GAME && pass == 0) ||
+ (boolopt[i].optflags == SET_IN_GAME && pass == 1))) {
if (bool_p == &flags.female) continue; /* obsolete */
#ifdef WIZARD
if (bool_p == &iflags.sanity_check && !wizard) continue;
#endif
+ if (is_wc_option(boolopt[i].name) &&
+ !wc_supported(boolopt[i].name)) continue;
any.a_int = (pass == 0) ? 0 : i + 1;
Sprintf(buf, "%s%-13s [%s]",
pass == 0 ? " " : "",
!strcmp(compopt[i].name, "race") ||
!strcmp(compopt[i].name, "gender"))
continue;
+ else if (is_wc_option(compopt[i].name) &&
+ !wc_supported(compopt[i].name))
+ continue;
else
doset_add_menu(tmpwin, compopt[i].name,
(pass == DISP_IN_GAME) ? 0 : indexoffset);
Sprintf(buf, "%s%s", *boolopt[opt_indx].addr ? "!" : "",
boolopt[opt_indx].name);
parseoptions(buf, setinitial, fromfile);
+ if (wc_supported(boolopt[opt_indx].name))
+ preference_update(boolopt[opt_indx].name);
} else {
/* compound option */
opt_indx -= boolcount;
/* pass the buck */
parseoptions(buf, setinitial, fromfile);
}
+ if (wc_supported(compopt[opt_indx].name))
+ preference_update(boolopt[opt_indx].name);
}
}
free((genericptr_t)pick_list);
int i;
buf[0] = '\0';
- if (!strcmp(optname,"align"))
+ if (!strcmp(optname,"align_message"))
+ Sprintf(buf, "%s", iflags.wc_align_message == ALIGN_TOP ? "top" :
+ iflags.wc_align_message == ALIGN_LEFT ? "left" :
+ iflags.wc_align_message == ALIGN_BOTTOM ? "bottom" :
+ iflags.wc_align_message == ALIGN_RIGHT ? "right" :
+ "unknown");
+ else if (!strcmp(optname,"align_status"))
+ Sprintf(buf, "%s", iflags.wc_align_message == ALIGN_TOP ? "top" :
+ iflags.wc_align_message == ALIGN_LEFT ? "left" :
+ iflags.wc_align_message == ALIGN_BOTTOM ? "bottom" :
+ iflags.wc_align_message == ALIGN_RIGHT ? "right" :
+ "unknown");
+ else if (!strcmp(optname,"align"))
Sprintf(buf, "%s", rolestring(flags.initalign, aligns, adj));
else if (!strcmp(optname, "boulder"))
Sprintf(buf, "%c", iflags.bouldersym ?
Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "effects"))
Sprintf(buf, "%s", to_be_done);
+ else if (!strcmp(optname, "font_map"))
+ Sprintf(buf, "%s", iflags.wc_font_map ? iflags.wc_font_map : none);
+ else if (!strcmp(optname, "font_message"))
+ Sprintf(buf, "%s", iflags.wc_font_message ? iflags.wc_font_message : none);
+ else if (!strcmp(optname, "font_status"))
+ Sprintf(buf, "%s", iflags.wc_font_status ? iflags.wc_font_status : none);
+ else if (!strcmp(optname, "font_menu"))
+ Sprintf(buf, "%s", iflags.wc_font_menu ? iflags.wc_font_menu : none);
+ else if (!strcmp(optname, "font_text"))
+ Sprintf(buf, "%s", iflags.wc_font_text ? iflags.wc_font_text : none);
+ else if (!strcmp(optname, "font_size_map"))
+ Sprintf(buf, "%d", iflags.wc_fontsiz_map);
+ else if (!strcmp(optname, "font_size_message"))
+ Sprintf(buf, "%d", iflags.wc_fontsiz_message);
+ else if (!strcmp(optname, "font_size_status"))
+ Sprintf(buf, "%d", iflags.wc_fontsiz_status);
+ else if (!strcmp(optname, "font_size_menu"))
+ Sprintf(buf, "%d", iflags.wc_fontsiz_menu);
+ else if (!strcmp(optname, "font_size_text"))
+ Sprintf(buf, "%d", iflags.wc_fontsiz_text);
else if (!strcmp(optname, "fruit"))
Sprintf(buf, "%s", pl_fruit);
else if (!strcmp(optname, "gender"))
Sprintf(buf, "%s", rolestring(flags.initgend, genders, adj));
else if (!strcmp(optname, "horsename"))
Sprintf(buf, "%s", horsename[0] ? horsename : none);
+ else if (!strcmp(optname, "map_mode"))
+ Sprintf(buf, "%s",
+ iflags.wc_map_mode == MAP_MODE_TILES ? "tiles" :
+ iflags.wc_map_mode == MAP_MODE_ASCII4x6 ? "ascii4x6" :
+ iflags.wc_map_mode == MAP_MODE_ASCII6x8 ? "ascii6x8" :
+ iflags.wc_map_mode == MAP_MODE_ASCII8x8 ? "ascii8x8" :
+ iflags.wc_map_mode == MAP_MODE_ASCII16x8 ? "ascii16x8" :
+ iflags.wc_map_mode == MAP_MODE_ASCII7x12 ? "ascii7x12" :
+ iflags.wc_map_mode == MAP_MODE_ASCII8x12 ? "ascii8x12" :
+ iflags.wc_map_mode == MAP_MODE_ASCII16x12 ? "ascii16x12" :
+ iflags.wc_map_mode == MAP_MODE_ASCII12x16 ? "ascii12x16" :
+ iflags.wc_map_mode == MAP_MODE_ASCII10x18 ? "ascii10x18" :
+ iflags.wc_map_mode == MAP_MODE_ASCII_FIT_TO_SCREEN ?
+ "fit_to_screen" : "unknown");
else if (!strcmp(optname, "menustyle"))
Sprintf(buf, "%s", menutype[(int)flags.menu_style] );
else if (!strcmp(optname, "menu_deselect_all"))
else if (!strcmp(optname, "scores")) {
Sprintf(buf, "%d top/%d around%s", flags.end_top,
flags.end_around, flags.end_own ? "/own" : "");
- }
+ }
+ else if (!strcmp(optname, "scroll_margin"))
+ Sprintf(buf, "%d", iflags.wc_scroll_margin);
#ifdef MSDOS
else if (!strcmp(optname, "soundcard"))
Sprintf(buf, "%s", to_be_done);
FEATURE_NOTICE_VER_PATCH);
} else if (!strcmp(optname, "traps"))
Sprintf(buf, "%s", to_be_done);
+ else if (!strcmp(optname, "vary_msgcount"))
+ Sprintf(buf, "%d", iflags.wc_vary_msgcount);
#ifdef MSDOS
else if (!strcmp(optname, "video"))
Sprintf(buf, "%s", to_be_done);
return ret;
}
+struct wc_Opt wc_options[] = {
+ {"ascii_map", WC_ASCII_MAP},
+ {"color", WC_COLOR},
+ {"eight_bit_tty", WC_EIGHT_BIT_IN},
+ {"hilite_pet", WC_HILITE_PET},
+ {"large_font", WC_LARGE_FONT},
+ {"popup_dialog", WC_POPUP_DIALOG},
+ {"preload_tiles", WC_PRELOAD_TILES},
+ {"tiled_map", WC_TILED_MAP},
+ {"tiles_16x16", WC_TILES_16x16},
+ {"tiles_32x32", WC_TILES_32x32},
+ {"tiles_8x16", WC_TILES_8x16},
+ {"use_inverse", WC_INVERSE},
+ {"align_message", WC_ALIGN_MESSAGE},
+ {"align_status", WC_ALIGN_STATUS},
+ {"font_map", WC_FONT_MAP},
+ {"font_menu", WC_FONT_MENU},
+ {"font_message",WC_FONT_MESSAGE},
+#if 0
+ {"perm_invent",WC_PERM_INVENT},
+#endif
+ {"font_size_map", WC_FONTSIZ_MAP},
+ {"font_size_menu", WC_FONTSIZ_MENU},
+ {"font_size_message", WC_FONTSIZ_MESSAGE},
+ {"font_size_status", WC_FONTSIZ_STATUS},
+ {"font_size_text", WC_FONTSIZ_TEXT},
+ {"font_status", WC_FONT_STATUS},
+ {"font_text", WC_FONT_TEXT},
+ {"map_mode", WC_MAP_MODE},
+ {"scroll_margin", WC_SCROLL_MARGIN},
+ {"vary_msgcount",WC_VARY_MSGCOUNT},
+ {(char *)0, 0L}
+};
+
+STATIC_OVL boolean
+is_wc_option(optnam)
+const char *optnam;
+{
+ int k = 0;
+ while (wc_options[k].wc_name) {
+ if (strcmp(wc_options[k].wc_name, optnam) == 0)
+ return TRUE;
+ k++;
+ }
+ return FALSE;
+}
+
+STATIC_OVL boolean
+wc_supported(optnam)
+const char *optnam;
+{
+ int k = 0;
+ while (wc_options[k].wc_name) {
+ if (!strcmp(wc_options[k].wc_name, optnam) &&
+ (windowprocs.wincap & wc_options[k].wc_bit))
+ return TRUE;
+ k++;
+ }
+ return FALSE;
+}
+
+STATIC_OVL void
+wc_set_font_name(wtype, fontname)
+int wtype;
+char *fontname;
+{
+ char **fn = (char **)0;
+ switch(wtype) {
+ case NHW_MAP:
+ fn = &iflags.wc_font_map;
+ break;
+ case NHW_MESSAGE:
+ fn = &iflags.wc_font_message;
+ break;
+ case NHW_TEXT:
+ fn = &iflags.wc_font_text;
+ break;
+ case NHW_MENU:
+ fn = &iflags.wc_font_menu;
+ break;
+ case NHW_STATUS:
+ fn = &iflags.wc_font_status;
+ break;
+ }
+ if (fn) {
+ if (*fn) free(*fn);
+ *fn = (char *)alloc(strlen(fontname) + 1);
+ Strcpy(*fn, fontname);
+ }
+ return;
+}
+
#endif /* OPTION_LISTS_ONLY */
/*options.c*/