status condition options

Option parsing rejected
|OPTIONS=!cond_X
for all valid X.

Using the menu to unselect all condition options treated that as not
having made any choice and didn't make any changes.  That would be
reasonable if nothing was preselected, but things are so unselecting
all of them is a choice.  (A bizarre one, but still should be viable.)

Mostly this deals with including cond_X options when #saveoptions is
used to write a new RC file.  It now produces something like
|OPTIONS=!cond_barehanded,cond_blind,!cond_busy,cond_conf,!cond_deaf,\
|        cond_iron,cond_fly,cond_foodPois,!cond_glowhands,cond_grab,\
|        cond_hallucinat,!cond_held,!cond_ice,cond_lava,cond_levitate,\
|        !cond_paralyzed,cond_ride,!cond_sleep,cond_slime,!cond_slip,\
|        cond_stone,cond_strngl,cond_stun,!cond_submerged,cond_termIll,\
|        !cond_tethered,!cond_trap,!cond_unconscious,!cond_woundedlegs,\
|        !cond_holding
after the last alphabetical option and before the bound keys, menu
colors, and others which aren't simple OPTIONS=X settings.  This only
happens if there is already one or more OPTIONS=cond_X entries in the
old file when it was read or if 'mO' gets used to make any changes.

Not fixed:  after my RC had something similar to the above and before
I changed status conditions to accept negation, I was getting several
"the cond_ option may not both have a value and be negated" messages
written to stdout instead of the config file error handler.  So they
vanished when the screen was initialized without providing a --More--
prompt to acknowledge that they have been seen.
This commit is contained in:
PatR
2022-10-31 00:53:10 -07:00
parent ad23b4e8e1
commit 220726f7ba
4 changed files with 114 additions and 27 deletions

View File

@@ -197,6 +197,7 @@ extern const char *bl_idx_to_fldname(int);
extern void condopt(int, boolean *, boolean);
extern int parse_cond_option(boolean, char *);
extern void cond_menu(void);
extern boolean opt_next_cond(int, char *);
#ifdef STATUS_HILITES
extern void status_eval_next_unhilite(void);
extern void reset_status_hilites(void);

View File

@@ -686,7 +686,7 @@ static int optfn_##a(int, int, boolean, char *, char *);
*/
NHOPTP(cond_, Advanced, 0, opt_in, set_hidden,
No, No, Yes, Yes, NoAlias, "prefix for cond_ options")
Yes, No, Yes, Yes, NoAlias, "prefix for cond_ options")
NHOPTP(font, Advanced, 0, opt_in, set_hidden,
Yes, Yes, Yes, No, NoAlias, "prefix for font options")
#if defined(MICRO) && !defined(AMIGA)