Merge branch 'master' into win32-x64-working
Conflicts: include/config.h include/extern.h src/do.c src/files.c src/hack.c src/mkobj.c src/mon.c src/objnam.c src/vision.c sys/share/pcmain.c win/share/other.txt win/share/renumtiles.pl
This commit is contained in:
@@ -104,6 +104,7 @@ static struct Bool_Opt
|
||||
{"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/
|
||||
# endif
|
||||
{"confirm",&flags.confirm, TRUE, SET_IN_GAME},
|
||||
{"dark_room", &flags.dark_room, TRUE, SET_IN_GAME},
|
||||
{"eight_bit_tty", &iflags.wc_eight_bit_input, FALSE, SET_IN_GAME}, /*WC*/
|
||||
#ifdef TTY_GRAPHICS
|
||||
{"extmenu", &iflags.extmenu, FALSE, SET_IN_GAME},
|
||||
@@ -345,6 +346,7 @@ static struct Comp_Opt
|
||||
{ "scroll_amount", "amount to scroll map when scroll_margin is reached",
|
||||
20, DISP_IN_GAME }, /*WC*/
|
||||
{ "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/
|
||||
{ "sortloot", "sort object selection lists by description", 4, SET_IN_GAME },
|
||||
#ifdef MSDOS
|
||||
{ "soundcard", "type of sound card to use", 20, SET_IN_FILE },
|
||||
#endif
|
||||
@@ -495,6 +497,35 @@ STATIC_OVL boolean FDECL(wc2_supported, (const char *));
|
||||
STATIC_DCL void FDECL(remove_autopickup_exception, (struct autopickup_exception *));
|
||||
STATIC_OVL int FDECL(count_ape_maps, (int *, int *));
|
||||
|
||||
|
||||
void
|
||||
reglyph_darkroom()
|
||||
{
|
||||
xchar x,y;
|
||||
for (x = 0; x < COLNO; x++)
|
||||
for (y = 0; y < ROWNO; y++) {
|
||||
struct rm *lev = &levl[x][y];
|
||||
if (!flags.dark_room) {
|
||||
if (lev->glyph == cmap_to_glyph(S_darkroom))
|
||||
lev->glyph = lev->waslit ? cmap_to_glyph(S_room) : cmap_to_glyph(S_stone);
|
||||
} else {
|
||||
if (lev->glyph == cmap_to_glyph(S_room) &&
|
||||
lev->seenv &&
|
||||
lev->waslit && !cansee(x,y))
|
||||
lev->glyph = cmap_to_glyph(S_darkroom);
|
||||
else if (lev->glyph == cmap_to_glyph(S_stone) &&
|
||||
lev->typ == ROOM &&
|
||||
lev->seenv &&
|
||||
!cansee(x,y))
|
||||
lev->glyph = cmap_to_glyph(S_darkroom);
|
||||
}
|
||||
}
|
||||
if (flags.dark_room && iflags.use_color)
|
||||
showsyms[S_darkroom]=showsyms[S_room];
|
||||
else
|
||||
showsyms[S_darkroom]=showsyms[S_stone];
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
@@ -628,6 +659,7 @@ initoptions_init()
|
||||
(genericptr_t)def_inv_order, sizeof flags.inv_order);
|
||||
flags.pickup_types[0] = '\0';
|
||||
flags.pickup_burden = MOD_ENCUMBER;
|
||||
flags.sortloot = 'l'; /* sort only loot by default */
|
||||
|
||||
for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++)
|
||||
flags.end_disclose[i] = DISCLOSE_PROMPT_DEFAULT_NO;
|
||||
@@ -703,6 +735,8 @@ initoptions_finish()
|
||||
/* result in the player's preferred fruit [better than "\033"]. */
|
||||
obj_descr[SLIME_MOLD].oc_name = "fruit";
|
||||
|
||||
reglyph_darkroom();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2327,6 +2361,22 @@ goodfruit:
|
||||
return;
|
||||
}
|
||||
|
||||
fullname = "sortloot";
|
||||
if (match_optname(opts, fullname, 4, TRUE)) {
|
||||
op = string_for_env_opt(fullname, opts, FALSE);
|
||||
if (op) {
|
||||
switch (tolower(*op)) {
|
||||
case 'n':
|
||||
case 'l':
|
||||
case 'f': flags.sortloot = tolower(*op);
|
||||
break;
|
||||
default: badoption(opts);
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fullname = "suppress_alert";
|
||||
if (match_optname(opts, fullname, 4, TRUE)) {
|
||||
if (duplicate) complain_about_duplicate(opts,1);
|
||||
@@ -2809,7 +2859,8 @@ goodfruit:
|
||||
else if ((boolopt[i].addr) == &flags.invlet_constant) {
|
||||
if (flags.invlet_constant) reassign();
|
||||
}
|
||||
else if ((boolopt[i].addr) == &flags.lit_corridor) {
|
||||
else if (((boolopt[i].addr) == &flags.lit_corridor) ||
|
||||
((boolopt[i].addr) == &flags.dark_room)) {
|
||||
/*
|
||||
* All corridor squares seen via night vision or
|
||||
* candles & lamps change. Update them by calling
|
||||
@@ -2819,6 +2870,7 @@ goodfruit:
|
||||
*/
|
||||
vision_recalc(2); /* shut down vision */
|
||||
vision_full_recalc = 1; /* delayed recalc */
|
||||
if (iflags.use_color) need_redraw = TRUE; /* darkroom refresh */
|
||||
}
|
||||
else if ((boolopt[i].addr) == &iflags.use_inverse ||
|
||||
(boolopt[i].addr) == &flags.showrace ||
|
||||
@@ -2861,6 +2913,10 @@ static NEARDATA const char *runmodes[] = {
|
||||
"teleport", "run", "walk", "crawl"
|
||||
};
|
||||
|
||||
static NEARDATA const char *sortltype[] = {
|
||||
"none", "loot", "full"
|
||||
};
|
||||
|
||||
/*
|
||||
* Convert the given string of object classes to a string of default object
|
||||
* symbols.
|
||||
@@ -3148,8 +3204,10 @@ doset()
|
||||
}
|
||||
|
||||
destroy_nhwindow(tmpwin);
|
||||
if (need_redraw)
|
||||
if (need_redraw) {
|
||||
reglyph_darkroom();
|
||||
(void) doredraw();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3167,7 +3225,8 @@ boolean setinitial,setfromfile;
|
||||
char buf[BUFSZ];
|
||||
|
||||
/* Special handling of menustyle, pickup_burden, pickup_types,
|
||||
* disclose, runmode, msg_window, menu_headings, and number_pad options.
|
||||
* disclose, runmode, msg_window, menu_headings, sortloot,
|
||||
* and number_pad options.
|
||||
* Also takes care of interactive autopickup_exception_handling changes.
|
||||
*/
|
||||
if (!strcmp("menustyle", optname)) {
|
||||
@@ -3348,6 +3407,23 @@ boolean setinitial,setfromfile;
|
||||
}
|
||||
destroy_nhwindow(tmpwin);
|
||||
#endif
|
||||
} else if (!strcmp("sortloot", optname)) {
|
||||
const char *sortl_name;
|
||||
menu_item *sortl_pick = (menu_item *)0;
|
||||
tmpwin = create_nhwindow(NHW_MENU);
|
||||
start_menu(tmpwin);
|
||||
for (i = 0; i < SIZE(sortltype); i++) {
|
||||
sortl_name = sortltype[i];
|
||||
any.a_char = *sortl_name;
|
||||
add_menu(tmpwin, NO_GLYPH, &any, *sortl_name, 0,
|
||||
ATR_NONE, sortl_name, MENU_UNSELECTED);
|
||||
}
|
||||
end_menu(tmpwin, "Select loot sorting type:");
|
||||
if (select_menu(tmpwin, PICK_ONE, &sortl_pick) > 0) {
|
||||
flags.sortloot = sortl_pick->item.a_char;
|
||||
free((genericptr_t)sortl_pick);
|
||||
}
|
||||
destroy_nhwindow(tmpwin);
|
||||
} else if (!strcmp("align_message", optname) ||
|
||||
!strcmp("align_status", optname)) {
|
||||
menu_item *window_pick = (menu_item *)0;
|
||||
@@ -3937,6 +4013,15 @@ char *buf;
|
||||
if (iflags.wc_scroll_margin) Sprintf(buf, "%d",iflags.wc_scroll_margin);
|
||||
else Strcpy(buf, defopt);
|
||||
}
|
||||
else if (!strcmp(optname, "sortloot")) {
|
||||
char *sortname = (char *)NULL;
|
||||
for (i=0; i < SIZE(sortltype) && sortname==(char *)NULL; i++) {
|
||||
if (flags.sortloot == sortltype[i][0])
|
||||
sortname = (char *)sortltype[i];
|
||||
}
|
||||
if (sortname != (char *)NULL)
|
||||
Sprintf(buf, "%s", sortname);
|
||||
}
|
||||
else if (!strcmp(optname, "player_selection"))
|
||||
Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog");
|
||||
#ifdef MSDOS
|
||||
|
||||
Reference in New Issue
Block a user