context-sensitive inventory item-action split
When picking an item from inventory and then picking 'I - adjust
inventory by splitting this stack' in the item-action menu,
yn_function("Split off how many?") is used to start getting the
count without needing to wait for <return>. It includes the response
in message history (so review of history will see that first digit).
The code then uses get_count() to obtain any additional digits. Tell
the latter to store "Count: N" in message history if N is different
from the first digit.
That's not as good as updating message history to replace the entry
showing the prompt with the first digit with one that shows the full
count but at least it's accurate when the count is 10 or more.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 hack.h $NHDT-Date: 1601595709 2020/10/01 23:41:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.141 $ */
|
||||
/* NetHack 3.7 hack.h $NHDT-Date: 1652861829 2022/05/18 08:17:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.181 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Pasi Kallinen, 2017. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -479,7 +479,9 @@ typedef uint32_t mmflags_nht; /* makemon MM_ flags */
|
||||
/* 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 */
|
||||
#define GC_CONDHIST 2 /* save "Count: N" in message history unless the
|
||||
* first digit is passed in and N matches it */
|
||||
#define GC_ECHOFIRST 4 /* echo "Count: 1" even when there's only one digit */
|
||||
|
||||
/* rloc() flags */
|
||||
#define RLOC_NONE 0x00
|
||||
|
||||
Reference in New Issue
Block a user