item-action 'I' - use #adjust to split a stack

More context-sensitive inventory support.  While examining inventory,
if you pick an item other than gold and it has a quantity of more
than 1, "I - Adjust inventory by splitting this stack" will be one
of the menu choices.

Breaking doorganize() into two parts was much easier than expected,
but the new internal command added to be an alternate for the first
part had more niggling details than anticipated.

Message history only shows the first digit with "Split off how many?"
if the player enters more than that.
This commit is contained in:
PatR
2022-04-20 13:38:09 -07:00
parent 627fa5efad
commit a9a9d19038
5 changed files with 120 additions and 36 deletions

View File

@@ -286,7 +286,7 @@ extern const char *directionname(int);
extern int isok(int, int);
extern int get_adjacent_loc(const char *, const char *, xchar, xchar, coord *);
extern const char *click_to_cmd(int, int, int);
extern char get_count(char *, char, long, cmdcount_nht *, boolean);
extern char get_count(const char *, char, long, cmdcount_nht *, unsigned);
#ifdef HANGUPHANDLING
extern void hangup(int);
extern void end_of_input(void);
@@ -1148,6 +1148,7 @@ extern void free_invbuf(void);
extern void reassign(void);
extern boolean check_invent_gold(const char *);
extern int doorganize(void);
extern int adjust_split(void);
extern void free_pickinv_cache(void);
extern int count_unpaid(struct obj *);
extern int count_buc(struct obj *, int, boolean(*)(struct obj *));

View File

@@ -476,6 +476,11 @@ typedef uint32_t mmflags_nht; /* makemon MM_ flags */
#define SUPPRESS_HISTORY 4
#define URGENT_MESSAGE 8
/* get_count flags */
#define GC_NOFLAGS 0
#define GC_SAVEHIST 1 /* save "Count: 123" in message history */
#define GC_ECHOFIRST 2 /* echo "Count: 1" even when there's only one digit */
/* rloc() flags */
#define RLOC_NONE 0x00
#define RLOC_ERR 0x01 /* allow impossible() if no rloc */