wiz_identify change (trunk only)

This patch alters wiz_identify so that it displays an
inventory menu with all items shown identified
without actually identifying them.

You can just press ^I (or whatever the wiz_identify command
is) a second time, while the menu is displayed to actually identify
them (tested with TTY menus only).
This commit is contained in:
nethack.allison
2006-01-14 17:02:22 +00:00
parent 40b426a977
commit 70b04bfb6e
5 changed files with 116 additions and 56 deletions

View File

@@ -150,6 +150,7 @@ STATIC_PTR int NDECL(doattributes);
STATIC_PTR int NDECL(doconduct); /**/
STATIC_PTR boolean NDECL(minimal_enlightenment);
STATIC_DCL char FDECL(cmd_from_func, (int NDECL((*))));
STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *,char *));
STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *));
#if defined(UNIX) || defined(SAFERHANGUP)
@@ -516,9 +517,13 @@ wiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */
STATIC_PTR int
wiz_identify()
{
if (wizard) identify_pack(0);
else pline("Unavailable command '^I'.");
return 0;
if (wizard) {
iflags.override_ID = (int)cmd_from_func(wiz_identify);
if (display_inventory((char *)0, TRUE) == -1)
identify_pack(0);
iflags.override_ID = 0;
} else pline("Unavailable command '^I'.");
return 0;
}
/* ^F command - reveal the level map and any traps on it */
@@ -1749,6 +1754,17 @@ boolean initial;
Cmd.move_SW = Cmd.dirchars[7];
}
STATIC_OVL char
cmd_from_func(fn)
int NDECL((*fn));
{
int i;
for (i = 0; i < SIZE(cmdlist); ++i)
if (cmdlist[i].f_funct == fn)
return cmdlist[i].f_char;
return 0;
}
/* decide whether a character (user input keystroke) requests screen repaint */
boolean
redraw_cmd(c)