Object lookup via inventory menu.
Adds an option to the inventory item menu which allows a user to look up an item in the database. This uses the existing whatis command. A minor secondary change is switching the failed database lookup message to second person. The use of a first person pronoun here has always been very strange, and switching to second person centers the player in the action.
This commit is contained in:
committed by
PatR
parent
284452796c
commit
880b7e3eef
@@ -2679,6 +2679,7 @@ enum item_action_actions {
|
||||
IA_WEAR_OBJ,
|
||||
IA_SWAPWEAPON,
|
||||
IA_ZAP_OBJ,
|
||||
IA_WHATIS_OBJ, /* '/' specify inventory object */
|
||||
};
|
||||
|
||||
/* construct text for the menu entries for IA_NAME_OBJ and IA_NAME_OTYP */
|
||||
@@ -2898,6 +2899,11 @@ itemactions_pushkeys(struct obj *otmp, int act)
|
||||
cmdq_add_ec(CQ_CANNED, dozap);
|
||||
cmdq_add_key(CQ_CANNED, otmp->invlet);
|
||||
break;
|
||||
case IA_WHATIS_OBJ:
|
||||
cmdq_add_ec(CQ_CANNED, dowhatis);
|
||||
cmdq_add_key(CQ_CANNED, 'i');
|
||||
cmdq_add_key(CQ_CANNED, otmp->invlet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3186,6 +3192,9 @@ itemactions(struct obj *otmp)
|
||||
if (otmp->oclass == WAND_CLASS)
|
||||
ia_addmenu(win, IA_ZAP_OBJ, 'z', "Zap this wand to release its magic");
|
||||
|
||||
/* ?: Look up an item in the game's database */
|
||||
ia_addmenu(win, IA_WHATIS_OBJ, '/', "Look up information about this item");
|
||||
|
||||
Sprintf(buf, "Do what with %s?", the(cxname(otmp)));
|
||||
end_menu(win, buf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user