some symbol tweaks

A few symbol-related modifications:

- fulfill a request from a blind player to allow them to
  specify a unique/recognizable character for all pets and/or
  the player in the config file for use when using a screen
  reader (S_player_override, S_pet_override). Requires sysconf
  setting ACCESSIBILITY to be set to have an effect, although
  they can still be specified in the config file.

- Config file SYMBOLS entries were not working properly on
  the rogue level. Allow ROGUESYMBOLS as well as SYMBOLS to be
  specified in the config file independently.

- When values are moved into showsyms[], the overriding SYMBOLS
  or ROGUESYMBOLS entry from the config file is used if there is
  one; if there is no overriding value for a particular symbol,
  the loaded symset value is used; if there is no symset entry
  loaded for the symbol then a default symbol is used.
This commit is contained in:
nhmall
2019-10-27 23:12:11 -04:00
parent 4f94bcaa8b
commit a399151d01
16 changed files with 306 additions and 127 deletions

View File

@@ -66,11 +66,12 @@ unsigned *ospecial;
{
register int offset, idx;
int color = NO_COLOR;
nhsym ch;
nhsym ch, ovsym;
unsigned special = 0;
/* condense multiple tests in macro version down to single */
boolean has_rogue_ibm_graphics = HAS_ROGUE_IBM_GRAPHICS;
boolean has_rogue_color = (has_rogue_ibm_graphics
boolean has_rogue_ibm_graphics = HAS_ROGUE_IBM_GRAPHICS,
is_you = (x == u.ux && y == u.uy),
has_rogue_color = (has_rogue_ibm_graphics
&& symset[currentgraphics].nocolor == 0);
/*
@@ -206,7 +207,7 @@ unsigned *ospecial;
} else { /* a monster */
idx = mons[glyph].mlet + SYM_OFF_M;
if (has_rogue_color && iflags.use_color) {
if (x == u.ux && y == u.uy)
if (is_you)
/* actually player should be yellow-on-gray if in corridor */
color = CLR_YELLOW;
else
@@ -215,13 +216,26 @@ unsigned *ospecial;
mon_color(glyph);
#ifdef TEXTCOLOR
/* special case the hero for `showrace' option */
if (iflags.use_color && x == u.ux && y == u.uy
&& flags.showrace && !Upolyd)
if (iflags.use_color && is_you && flags.showrace && !Upolyd)
color = HI_DOMESTIC;
#endif
}
}
/* These were requested by a blind player to enhance screen reader use */
if (sysopt.accessibility == 1) {
ovsym = Is_rogue_level(&u.uz)
? ov_rogue_syms[SYM_PET_OVERRIDE + SYM_OFF_X]
: ov_primary_syms[SYM_PET_OVERRIDE + SYM_OFF_X];
if (ovsym && (special & MG_PET))
idx = SYM_PET_OVERRIDE + SYM_OFF_X;
ovsym = Is_rogue_level(&u.uz)
? ov_rogue_syms[SYM_PLAYER_OVERRIDE + SYM_OFF_X]
: ov_primary_syms[SYM_PLAYER_OVERRIDE + SYM_OFF_X];
if (ovsym && is_you)
idx = SYM_PLAYER_OVERRIDE + SYM_OFF_X;
}
ch = showsyms[idx];
#ifdef TEXTCOLOR
/* Turn off color if no color defined, or rogue level w/o PC graphics. */