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

@@ -2540,10 +2540,18 @@ char *origbuf;
if (sysopt.greppath)
free((genericptr_t) sysopt.greppath);
sysopt.greppath = dupstr(bufp);
} else if (src == SET_IN_SYS
&& match_varname(buf, "ACCESSIBILITY", 19)) {
n = atoi(bufp);
if (n < 0 || n > 1) {
config_error_add("Illegal value in ACCESSIBILITY (not 0,1).");
return FALSE;
}
sysopt.accessibility = n;
#endif /* SYSCF */
} else if (match_varname(buf, "BOULDER", 3)) {
(void) get_uchars(bufp, &iflags.bouldersym, TRUE, 1,
(void) get_uchars(bufp, &ov_primary_syms[SYM_BOULDER + SYM_OFF_X], TRUE, 1,
"BOULDER");
} else if (match_varname(buf, "MENUCOLOR", 9)) {
if (!add_menu_coloring(bufp))
@@ -2557,8 +2565,14 @@ char *origbuf;
(void) get_uchars(bufp, translate, FALSE, WARNCOUNT,
"WARNINGS");
assign_warnings(translate);
} else if (match_varname(buf, "ROGUESYMBOLS", 4)) {
if (!parsesymbols(bufp, ROGUESET)) {
config_error_add("Error in ROGUESYMBOLS definition '%s'", bufp);
retval = FALSE;
}
switch_symbols(TRUE);
} else if (match_varname(buf, "SYMBOLS", 4)) {
if (!parsesymbols(bufp)) {
if (!parsesymbols(bufp, PRIMARY)) {
config_error_add("Error in SYMBOLS definition '%s'", bufp);
retval = FALSE;
}
@@ -3338,9 +3352,9 @@ int which_set;
chosen_symset_start = TRUE;
/* these init_*() functions clear symset fields too */
if (which_set == ROGUESET)
init_r_symbols();
init_rogue_symbols();
else if (which_set == PRIMARY)
init_l_symbols();
init_primary_symbols();
}
break;
case 1:
@@ -3393,9 +3407,9 @@ int which_set;
val = sym_val(bufp);
if (chosen_symset_start) {
if (which_set == PRIMARY) {
update_l_symset(symp, val);
update_primary_symset(symp, val);
} else if (which_set == ROGUESET) {
update_r_symset(symp, val);
update_rogue_symset(symp, val);
}
}
}