Skip to content

Commit 8c49e5c

Browse files
Merge pull request #170 from k21971/A-changes
A changes
2 parents 499dd05 + d547222 commit 8c49e5c

File tree

8 files changed

+43
-15
lines changed

8 files changed

+43
-15
lines changed

dat/opthelp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Boolean options not under specific compile flags (with default values in []):
33
option setting, which is reached via the 'O' command.)
44

55
acoustics can your character hear anything [TRUE]
6+
autoall_menu show inventory menu with the 'A' key when looting [FALSE]
67
autodescribe describe the terrain under cursor [FALSE]
78
autodig dig if moving and wielding digging tool [FALSE]
89
autoopen walking into a door attempts to open it [TRUE]

doc/Guidebook.mn

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,6 +2925,13 @@ If you prefix the value with \(oq!\(cq or \(lqno\(rq, you will
29252925
exclude that alignment from being picked randomly.
29262926
Cannot be set with the \(oqO\(cq command.
29272927
Persistent.
2928+
.lp autoall_menu
2929+
When selecting the 'A' option while looting a bag, show a menu of inventory
2930+
items with everything preselected instead of immediately moving the items
2931+
(default false).
2932+
'A' can be combined with other filters to show a preselected
2933+
list of all items satisfying the filters. Only matters with full menustyle.
2934+
Persistent.
29282935
.lp autodescribe
29292936
Automatically describe the terrain under cursor when asked to get a location
29302937
on the map (default true).

doc/Guidebook.tex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3217,6 +3217,13 @@ \subsection*{Customization options}
32173217
exclude that alignment from being picked randomly.
32183218
Cannot be set with the `{\tt O}' command. Persistent.
32193219
%.lp
3220+
\item[\ib{autoall\verb+_+menu}]
3221+
When selecting the 'A' option while looting a bag, show a menu of inventory
3222+
items with everything preselected instead of immediately moving the items
3223+
(default false). 'A' can be combined with other filters to show a preselected
3224+
list of all items satisfying the filters. Only matters with full menustyle.
3225+
Persistent.
3226+
%.lp
32203227
\item[\ib{autodescribe}]
32213228
Automatically describe the terrain under cursor when asked to get a location
32223229
on the map (default true).
@@ -3802,7 +3809,7 @@ \subsection*{Customization options}
38023809
Likewise for the `a' (apply) command if it causes the applied item to
38033810
become wielded. Persistent.
38043811
%.lp
3805-
\item[\ib(quick\verb+_+farsight}
3812+
\item[\ib{quick\verb+_+farsight}]
38063813
When set, usually prevents the ``you sense your surroundings'' message
38073814
where play pauses to allow you to browse the map whenever clairvoyance
38083815
randomly activates.

doc/Guidebook.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,6 +3288,14 @@
32883288
ment from being picked randomly. Cannot be set with the `O'
32893289
command. Persistent.
32903290

3291+
autoall_menu
3292+
When selecting the 'A' option while looting a bag, show a menu
3293+
of inventory items with everything preselected instead of
3294+
immediately moving the items (default false). 'A' can be
3295+
combined with other filters to show a preselected list of all
3296+
items satisfying the filters. Only matters with full menustyle.
3297+
Persistent.
3298+
32913299
autodescribe
32923300
Automatically describe the terrain under cursor when asked to
32933301
get a location on the map (default true). The whatis_coord op-

include/flag.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@
1616
*/
1717

1818
struct flag {
19-
boolean acoustics; /* allow dungeon sound messages */
20-
boolean autodig; /* MRKR: Automatically dig */
21-
boolean autoquiver; /* Automatically fill quiver */
22-
boolean autoopen; /* open doors by walking into them */
23-
boolean autounlock; /* automatically apply unlocking tools */
24-
boolean beginner; /* True early in each game; affects feedback */
25-
boolean biff; /* enable checking for mail */
26-
boolean bones; /* allow saving/loading bones */
27-
boolean confirm; /* confirm before hitting tame monsters */
28-
boolean dark_room; /* show shadows in lit rooms */
29-
boolean debug; /* in debugging mode (aka wizard mode) */
19+
boolean acoustics; /* allow dungeon sound messages */
20+
boolean autoall_menu; /* show menu with 'A' menu option */
21+
boolean autodig; /* MRKR: Automatically dig */
22+
boolean autoquiver; /* Automatically fill quiver */
23+
boolean autoopen; /* open doors by walking into them */
24+
boolean autounlock; /* automatically apply unlocking tools */
25+
boolean beginner; /* True early in each game; affects feedback */
26+
boolean biff; /* enable checking for mail */
27+
boolean bones; /* allow saving/loading bones */
28+
boolean confirm; /* confirm before hitting tame monsters */
29+
boolean dark_room; /* show shadows in lit rooms */
30+
boolean debug; /* in debugging mode (aka wizard mode) */
3031
#define wizard flags.debug
3132
boolean end_own; /* list all own scores */
3233
boolean explore; /* in exploration mode (aka discover mode) */

include/wintype.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ typedef struct mi {
6464
#define PICK_NONE 0 /* user picks nothing (display only) */
6565
#define PICK_ONE 1 /* only pick one */
6666
#define PICK_ANY 2 /* can pick any amount */
67+
#define PICK_ALL 3 /* start with every menu item autoselected */
6768

6869
/* window types */
6970
/* any additional port specific types should be defined in win*.h */

src/options.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static struct Bool_Opt {
103103
#else
104104
{ "asksavedisk", (boolean *) 0, FALSE, SET_IN_FILE },
105105
#endif
106+
{ "autoall_menu", &flags.autoall_menu, FALSE, SET_IN_GAME },
106107
{ "autodescribe", &iflags.autodescribe, TRUE, SET_IN_GAME },
107108
{ "autodig", &flags.autodig, FALSE, SET_IN_GAME },
108109
{ "autoopen", &flags.autoopen, TRUE, SET_IN_GAME },

src/pickup.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,8 @@ boolean FDECL((*allow), (OBJ_P)); /* allow function */
943943
(qflags & USE_INVLET) ? curr->invlet
944944
: (first && curr->oclass == COIN_CLASS) ? '$' : 0,
945945
def_oc_syms[(int) objects[curr->otyp].oc_class].sym,
946-
ATR_NONE, doname_with_price(curr), MENU_UNSELECTED);
946+
ATR_NONE, doname_with_price(curr),
947+
how == PICK_ALL ? MENU_SELECTED : MENU_UNSELECTED);
947948
first = FALSE;
948949
}
949950
}
@@ -3148,7 +3149,7 @@ boolean put_in;
31483149
free((genericptr_t) pick_list);
31493150
}
31503151

3151-
if (loot_everything) {
3152+
if (!flags.autoall_menu && loot_everything) {
31523153
if (!put_in) {
31533154
current_container->cknown = 1;
31543155
for (otmp = current_container->cobj; otmp; otmp = otmp2) {
@@ -3175,7 +3176,8 @@ boolean put_in;
31753176
current_container->cknown = 1;
31763177
Sprintf(buf, "%s what?", action);
31773178
n = query_objlist(buf, put_in ? &invent : &(current_container->cobj),
3178-
mflags, &pick_list, PICK_ANY,
3179+
mflags, &pick_list, loot_everything ? PICK_ALL
3180+
: PICK_ANY,
31793181
all_categories ? allow_all : allow_category);
31803182
if (n) {
31813183
n_looted = n;

0 commit comments

Comments
 (0)