context menu tweaks

Fix several warnings about using 'void *' for a function pointer and
a couple of unused variables.  Add a_nfunc for 'int NDECL((*func))'
alternative for union anything.  Make the enum list of union anything
types actually match the alternatives (field a_uchar was missing from
enums, enum mask32 had no corresponding a_mask32 field).

Add another command, #therecmdmenu, so that the context menu for an
adjacent spot can be tested without mouse support.  It revealed that
you could get an empty menu if nothing applicable was at target spot.

Add a few adjacent actions:  lock/unlock door if carrying suitable
implement, search door for traps, examine known trap (door/ceiling,
not door), #untrap known trap, mount saddled critter, remove saddle.
Make "kick door" be the last choice for closed door instead of first.

Add one 'here' action:  dismount.

Both #herecmdmenu and #therecmdmenu interact strangely with ^A, but
differently from each other.  I didn't make any attempt to solve this.

There's no documentation for #therecmdmenu.
This commit is contained in:
PatR
2017-10-10 15:56:18 -07:00
parent 76a47b5e34
commit 5d1f77301a
2 changed files with 140 additions and 42 deletions

View File

@@ -15,6 +15,7 @@ typedef union any {
int a_int;
char a_char;
schar a_schar;
uchar a_uchar;
unsigned int a_uint;
long a_long;
unsigned long a_ulong;
@@ -23,6 +24,8 @@ typedef union any {
unsigned long *a_ulptr;
unsigned *a_uptr;
const char *a_string;
int NDECL((*a_nfunc));
unsigned long a_mask32; /* used by status highlighting */
/* add types as needed */
} anything;
#define ANY_P union any /* avoid typedef in prototypes */
@@ -45,6 +48,7 @@ enum any_types {
ANY_LPTR, /* pointer to long */
ANY_ULPTR, /* pointer to unsigned long */
ANY_STR, /* pointer to null-terminated char string */
ANY_NFUNC, /* pointer to function taking no args, returning int */
ANY_MASK32 /* 32-bit mask (stored as unsigned long) */
};