overriding message suppression, revisited
This is more robust than the previous hack. The issue of whether to use it in other places is still unexplored. Ultimately it's the user's fault if overzealous message suppression hides something important. [For an eerie game, try 'MSGTYPE=hide .'.]
This commit is contained in:
@@ -406,6 +406,8 @@ struct plinemsg_type {
|
||||
#define MSGTYP_NOREP 1
|
||||
#define MSGTYP_NOSHOW 2
|
||||
#define MSGTYP_STOP 3
|
||||
/* bitmask for callers of hide_unhide_msgtypes() */
|
||||
#define MSGTYP_MASK_REP_SHOW ((1 << MSGTYP_NOREP) | (1 << MSGTYP_NOSHOW))
|
||||
|
||||
E struct plinemsg_type *plinemsg_types;
|
||||
|
||||
|
||||
@@ -1641,8 +1641,8 @@ E int NDECL(dotogglepickup);
|
||||
E void NDECL(option_help);
|
||||
E void FDECL(next_opt, (winid, const char *));
|
||||
E int FDECL(fruitadd, (char *, struct fruit *));
|
||||
E int FDECL(choose_classes_menu,
|
||||
(const char *, int, BOOLEAN_P, char *, char *));
|
||||
E int FDECL(choose_classes_menu, (const char *, int, BOOLEAN_P,
|
||||
char *, char *));
|
||||
E void FDECL(add_menu_cmd_alias, (CHAR_P, CHAR_P));
|
||||
E char FDECL(map_menu_cmd, (CHAR_P));
|
||||
E void FDECL(assign_warnings, (uchar *));
|
||||
@@ -1666,6 +1666,7 @@ E boolean FDECL(get_menu_coloring, (char *, int *, int *));
|
||||
E void NDECL(free_menu_coloring);
|
||||
E boolean FDECL(msgtype_parse_add, (char *));
|
||||
E int FDECL(msgtype_type, (const char *, BOOLEAN_P));
|
||||
E void FDECL(hide_unhide_msgtypes, (BOOLEAN_P, int));
|
||||
E void NDECL(msgtype_free);
|
||||
|
||||
/* ### pager.c ### */
|
||||
|
||||
@@ -363,13 +363,18 @@ extern NEARDATA struct sysflag sysflags;
|
||||
extern NEARDATA struct instance_flags iflags;
|
||||
|
||||
/* last_msg values */
|
||||
#define PLNMSG_NOSHO_OVERRIDE (-2)
|
||||
#define PLNMSG_NOREP_OVERRIDE (-1)
|
||||
#define PLNMSG_UNKNOWN 0 /* arbitrary */
|
||||
#define PLNMSG_ONE_ITEM_HERE 1 /* "you see <single item> here" */
|
||||
#define PLNMSG_TOWER_OF_FLAME 2 /* scroll of fire */
|
||||
#define PLNMSG_CAUGHT_IN_EXPLOSION 3 /* explode() feedback */
|
||||
#define PLNMSG_OBJ_GLOWS 4 /* "the <obj> glows <color>" */
|
||||
/* Usage:
|
||||
* pline("some message");
|
||||
* pline: vsprintf + putstr + iflags.last_msg = PLNMSG_UNKNOWN;
|
||||
* iflags.last_msg = PLNMSG_some_message;
|
||||
* and subsequent code can adjust the next message if it is affected
|
||||
* by some_message. The next message will clear iflags.last_msg.
|
||||
*/
|
||||
|
||||
/* runmode options */
|
||||
#define RUN_TPORT 0 /* don't update display until movement stops */
|
||||
|
||||
Reference in New Issue
Block a user