Skip to content

Commit 189b0bf

Browse files
authored
Merge branch 'master' into idle-crafting
2 parents 19f5e01 + 1fdf719 commit 189b0bf

File tree

12 files changed

+1018
-218
lines changed

12 files changed

+1018
-218
lines changed

caravan.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ end
1818
OVERLAY_WIDGETS = {
1919
trade=trade.TradeOverlay,
2020
tradebanner=trade.TradeBannerOverlay,
21+
tradeethics=trade.TradeEthicsWarningOverlay,
2122
tradeagreement=tradeagreement.TradeAgreementOverlay,
2223
movegoods=movegoods.MoveGoodsOverlay,
2324
movegoods_hider=movegoods.MoveGoodsHiderOverlay,

changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ Template for new versions:
2929
## New Tools
3030
- `embark-anyone`: allows you to embark as any civilisation, including dead, and non-dwarven ones
3131
- `idle-crafting`: Allow dwarfs to automatically satisfy their need to craft objects.
32+
- `gui/pregnancy`: view and generate pregnancies with specified parents
3233

3334
## New Features
35+
- `caravan`: DFHack dialogs for trade screens (both ``Bring goods to depot`` and the ``Trade`` barter screen) can now filter by item origins (foreign vs. fort-made) and can filter bins by whether they have a mix of ethically acceptable and unacceptable items in them
36+
- `caravan`: If you have managed to select an item that is ethically unacceptable to the merchant, an "Ethics warning" badge will now appear next to the "Trade" button. Clicking on the badge will show you which items that you have selected are problematic. The dialog has a button that you can click to deselect the problematic items in the trade list.
37+
- `confirm`: If you have ethically unacceptable items selected for trade, the "Are you sure you want to trade" confirmation will warn you about them
3438

3539
## Fixes
3640
- `timestream`: ensure child growth events (e.g. becoming an adult) are not skipped over
41+
- `empty-bin`: ``--liquids`` option correctly emptying containers filled with LIQUID_MISC
3742

3843
## Misc Improvements
3944
- `gui/sitemap`: show whether a unit is friendly, hostile, or wildlife

docs/caravan.rst

Lines changed: 77 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,14 @@ Overlays
4949
--------
5050

5151
Additional functionality is provided on the various trade-related screens via
52-
`overlay` widgets.
53-
54-
Trade screen
55-
````````````
56-
57-
- ``Shift+Click checkbox``: Select all items inside a bin without selecting the
58-
bin itself
59-
- ``Ctrl+Click checkbox``: Collapse or expand a single bin (as is possible in
60-
the "Move goods to/from depot" screen)
61-
- ``Ctrl+c``: Collapses all bins. The hotkey hint can also be clicked as though
62-
it were a button.
63-
- ``Ctrl+x``: Collapses everything (all item categories and anything
64-
collapsible within each category). The hotkey hint can also be clicked as
65-
though it were a button.
66-
67-
There is also a reminder of the fast scroll functionality provided by the
68-
vanilla game when you hold shift while scrolling (this works everywhere).
69-
70-
You can turn the overlay on and off in `gui/control-panel`, or you can
71-
reposition it to your liking with `gui/overlay`. The overlay is named
72-
``caravan.tradeScreenExtension``.
52+
`overlay` widgets. You can turn the overlays on and off in `gui/control-panel`,
53+
or you can reposition them to your liking with `gui/overlay`.
7354

7455
Bring item to depot
7556
```````````````````
7657

58+
**caravan.movegoods**
59+
7760
When the trade depot is selected, a button appears to bring up the DFHack
7861
enhanced move trade goods screen. You'll get a searchable, sortable list of all
7962
your tradeable items, with hotkeys to quickly select or deselect all visible
@@ -82,27 +65,93 @@ items.
8265
There are filter sliders for selecting items of various condition levels and
8366
quality. For example, you can quickly trade all your tattered, frayed, and worn
8467
clothing by setting the condition slider to include from tattered to worn, then
85-
hitting Ctrl-V to select all.
68+
hitting ``Ctrl-a`` to select all.
8669

8770
Click on an item and shift-click on a second item to toggle all items between
8871
the two that you clicked on. If the one that you shift-clicked on was selected,
8972
the range of items will be deselected. If the one you shift-clicked on was not
9073
selected, then the range of items will be selected.
9174

92-
Trade agreement
93-
```````````````
75+
If any current merchants have ethical concerns, the list of goods that you can
76+
bring to the depot is automatically filtered (by default) to only show
77+
ethically acceptible items. Be aware that, again, by default, if you have items
78+
in bins, and there are unethical items mixed into the bins, then the bins will
79+
still be brought to the depot so you can trade the ethical items within those
80+
bins. Please use the DFHack enhanced trade screen for the actual barter to
81+
ensure the unethical items are not actually selected for sale.
82+
83+
**caravan.movegoods_hider**
84+
85+
This overlay simply hides the vanilla "Move trade goods" button, so if you
86+
routinely prefer to use the enhanced DFHack "Move goods" dialog, you won't
87+
accidentally click the vanilla button.
88+
89+
**caravan.assigntrade**
90+
91+
This overlay provides a button on the vanilla "Move trade goods" screen to
92+
launch the DFHack enhanced dialog.
93+
94+
Trade screen
95+
````````````
96+
97+
**caravan.trade**
98+
99+
This overlay enables some convenent gestures and keyboard shortcuts for working
100+
with bins:
101+
102+
- ``Shift-Click checkbox``: Select all items inside a bin without selecting the
103+
bin itself
104+
- ``Ctrl-Click checkbox``: Collapse or expand a single bin
105+
- ``Ctrl-Shift-Click checkbox``: Select all items within the bin and collapse it
106+
- ``Ctrl-c``: Collapse all bins
107+
- ``Ctrl-x``: Collapse everything (all item categories and anything
108+
collapsible within each category)
109+
110+
There is also a reminder of the fast scroll functionality provided by the
111+
vanilla game when you hold shift while scrolling (this works everywhere).
112+
113+
**caravan.tradebanner**
114+
115+
This overlay provides a button you can click to bring up the DFHack enhanced
116+
trade dialog, which you can use to quickly search, filter, and select caravan
117+
and fort goods for trade.
94118

95-
A small panel is shown with some useful shortcuts:
119+
For example, to select all steel items for purchase, search for ``steel`` and
120+
hit ``Ctrl-a`` (or click the "Select all" button) to select them all.
96121

97-
* ``Ctrl-A`` for selecting all/none in the currently shown category.
98-
* ``Ctrl-M`` for selecting items with specific base material price (only
122+
By default, the DFHack trade dialog will automatically filter out items that
123+
the merchants you are trading with find ethically offensive.
124+
125+
You can also bring up the DFHack trade dialog with the keyboard shortcut
126+
``Ctrl-t``.
127+
128+
**caravan.tradeethics**
129+
130+
This overlay shows an "Ethics warning" badge next to the ``Trade`` button when
131+
you have any items selected for sale that would offend the merchants that you
132+
are trading with. Clicking on the badge will show a list of problematic items,
133+
and you can click the button on the dialog to deselect all the problematic
134+
items in your trade list.
135+
136+
Trade agreements
137+
````````````````
138+
139+
**caravan.tradeagreement**
140+
141+
This adds a small panel with some useful shortcuts:
142+
143+
* ``Ctrl-a`` for selecting all/none in the currently shown category.
144+
* ``Ctrl-m`` for selecting items with specific base material price (only
99145
enabled for item categories where this matters, like gems and leather).
100146

101147
Display furniture
102148
`````````````````
103149

150+
**caravan.displayitemselector**
151+
104152
A button is added to the screen when you are viewing display furniture
105-
(pedestals and display cases) where you can launch an item assignment GUI.
153+
(pedestals and display cases) where you can launch a the extended DFhack item
154+
assignment GUI.
106155

107156
The dialog allows you to sort by name, value, or where the item is currently
108157
assigned for display.

docs/gui/pregnancy.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
gui/pregnancy
2+
=============
3+
4+
.. dfhack-tool::
5+
:summary: Generate pregnancies with pairings of your choice.
6+
:tags: adventure fort armok animals units
7+
8+
This tool provides an interface for producing pregnancies with specific mothers
9+
and fathers.
10+
11+
If a unit is selected when you run `gui/pregnancy`, they will be pre-selected
12+
as a parent. If the unit has a spouse of a different gender, they will be
13+
automatically selected as the other parent. You can click on other units on the
14+
map and choose them as alternate mothers or fathers as desired.
15+
16+
If a unit is selected as a mother or father, or is listed as a spouse, you can
17+
zoom the map to their location by clicking on their name in the `gui/pregnancy`
18+
UI.
19+
20+
A unit must be on the map to participate in a pregnancy. For example, you
21+
cannot designate a father that is not on-site, even if they are the selected
22+
mother's spouse.
23+
24+
Children cannot be selected as a parent, and, due to game limitations,
25+
cross-species pregnancies are not supported.
26+
27+
Usage
28+
-----
29+
30+
::
31+
32+
gui/pregnancy

empty-bin.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ local function emptyContainer(container)
1818
print('Emptying ' .. dfhack.items.getReadableDescription(container))
1919
local pos = xyz2pos(dfhack.items.getPosition(container))
2020
for _, item in ipairs(items) do
21-
local skip_liquid = item:getType() == df.item_type.LIQUID_MISC or item:getType() == df.item_type.DRINK and not options.liquids
21+
local skip_liquid = not options.liquids and (item:getType() == df.item_type.LIQUID_MISC or item:getType() == df.item_type.DRINK)
2222
if skip_liquid then
2323
print(' ' .. dfhack.items.getReadableDescription(item) .. ' was skipped because the --liquids flag was not provided')
2424
else

0 commit comments

Comments
 (0)