Skip to content

Commit 81b0b05

Browse files
authored
Merge branch 'develop' into add_library_time_class
2 parents 65a534b + 1d7e936 commit 81b0b05

File tree

27 files changed

+1121
-3493
lines changed

27 files changed

+1121
-3493
lines changed

conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ def write_tool_docs():
7878
os.makedirs(os.path.join('docs/tools', os.path.dirname(k[0])),
7979
mode=0o755, exist_ok=True)
8080
with write_file_if_changed('docs/tools/{}.rst'.format(k[0])) as outfile:
81-
if k[0] != 'search':
82-
outfile.write(label)
81+
outfile.write(label)
8382
outfile.write(include)
8483

8584

data/init/dfhack.tools.init

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080

8181
# Enable system services
8282
enable buildingplan
83+
enable burrow
8384
enable confirm
8485
enable logistics
8586
enable overlay

docs/about/Removed.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ gui/hack-wish
191191
=============
192192
Replaced by `gui/create-item`.
193193

194+
.. _gui/mechanisms:
195+
196+
gui/mechanisms
197+
==============
198+
Linked building interface has been added to the vanilla UI.
199+
194200
.. _gui/no-dfhack-init:
195201

196202
gui/no-dfhack-init
@@ -220,6 +226,12 @@ ruby
220226
Support for the Ruby language in DFHack scripts was removed due to the issues
221227
the Ruby library causes when used as an embedded language.
222228

229+
.. _search-plugin:
230+
231+
search
232+
======
233+
Functionality was merged into `sort`.
234+
223235
.. _show-unit-syndromes:
224236

225237
show-unit-syndromes

docs/changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ Template for new versions:
5252
# Future
5353

5454
## New Tools
55+
- `burrow`: (reinstated) automatically expand burrows as you dig
5556

5657
## New Features
5758
- `prospect`: can now give you an estimate of resources from the embark screen. hover the mouse over a potential embark area and run `prospect`.
59+
- `burrow`: integrated 3d box fill and 2d/3d flood fill extensions for burrow painting mode
5860

5961
## Fixes
6062
- `stockpiles`: hide configure and help buttons when the overlay panel is minimized
@@ -68,9 +70,12 @@ Template for new versions:
6870

6971
## API
7072
- ``Gui::revealInDwarfmodeMap``: gained ``highlight`` parameter to control setting the tile highlight on the zoom target
73+
- ``Maps::getWalkableGroup``: get the walkability group of a tile
7174

7275
## Lua
7376
- ``dfhack.gui.revealInDwarfmodeMap``: gained ``highlight`` parameter to control setting the tile highlight on the zoom target
77+
- ``dfhack.maps.getWalkableGroup``: get the walkability group of a tile
78+
- ``gui.FRAME_THIN``: a panel frame suitable for floating tooltips
7479

7580
## Removed
7681

docs/dev/Lua API.rst

Lines changed: 16 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,10 +1912,11 @@ Maps module
19121912

19131913
Returns the plant struct that owns the tile at the specified position.
19141914

1915-
* ``dfhack.maps.canWalkBetween(pos1, pos2)``
1915+
* ``dfhack.maps.getWalkableGroup(pos)``
19161916

1917-
Checks if a dwarf may be able to walk between the two tiles,
1918-
using a pathfinding cache maintained by the game.
1917+
Returns the walkability group for the given tile position. A return value of
1918+
``0`` indicates that the tile is not walkable. The data comes from a
1919+
pathfinding cache maintained by DF.
19191920

19201921
.. note::
19211922
This cache is only updated when the game is unpaused, and thus
@@ -1924,6 +1925,10 @@ Maps module
19241925
take into account anything that depends on the actual units, like
19251926
burrows, or the presence of invaders.
19261927

1928+
* ``dfhack.maps.canWalkBetween(pos1, pos2)``
1929+
1930+
Checks if both positions are walkable and also share a walkability group.
1931+
19271932
* ``dfhack.maps.hasTileAssignment(tilemask)``
19281933

19291934
Checks if the tile_bitmask object is not *nil* and contains any set bits; returns *true* or *false*.
@@ -1944,9 +1949,11 @@ Maps module
19441949
Burrows module
19451950
--------------
19461951

1947-
* ``dfhack.burrows.findByName(name)``
1952+
* ``dfhack.burrows.findByName(name[, ignore_final_plus])``
19481953

1949-
Returns the burrow pointer or *nil*.
1954+
Returns the burrow pointer or *nil*. if ``ignore_final_plus`` is ``true``,
1955+
then ``+`` characters at the end of the names are ignored, both for the
1956+
specified ``name`` and the names of the burrows that it matches against.
19501957

19511958
* ``dfhack.burrows.clearUnits(burrow)``
19521959

@@ -4578,6 +4585,10 @@ There are the following predefined frame style tables:
45784585

45794586
A frame suitable for overlay widget panels.
45804587

4588+
* ``FRAME_THIN``
4589+
4590+
A frame suitable for floating tooltip panels that need the DFHack signature.
4591+
45814592
* ``FRAME_BOLD``
45824593

45834594
A frame suitable for a non-draggable panel meant to capture the user's focus,
@@ -5603,51 +5614,6 @@ Native functions provided by the `buildingplan` plugin:
56035614
* ``void doCycle()`` runs a check for whether buildings in the monitor list can be assigned items and unsuspended. This method runs automatically twice a game day, so you only need to call it directly if you want buildingplan to do a check right now.
56045615
* ``void scheduleCycle()`` schedules a cycle to be run during the next non-paused game frame. Can be called multiple times while the game is paused and only one cycle will be scheduled.
56055616

5606-
burrows
5607-
=======
5608-
5609-
The `burrows` plugin implements extended burrow manipulations.
5610-
5611-
Events:
5612-
5613-
* ``onBurrowRename.foo = function(burrow)``
5614-
5615-
Emitted when a burrow might have been renamed either through
5616-
the game UI, or ``renameBurrow()``.
5617-
5618-
* ``onDigComplete.foo = function(job_type,pos,old_tiletype,new_tiletype,worker)``
5619-
5620-
Emitted when a tile might have been dug out. Only tracked if the
5621-
auto-growing burrows feature is enabled.
5622-
5623-
Native functions:
5624-
5625-
* ``renameBurrow(burrow,name)``
5626-
5627-
Renames the burrow, emitting ``onBurrowRename`` and updating auto-grow state properly.
5628-
5629-
* ``findByName(burrow,name)``
5630-
5631-
Finds a burrow by name, using the same rules as the plugin command line interface.
5632-
Namely, trailing ``'+'`` characters marking auto-grow burrows are ignored.
5633-
5634-
* ``copyUnits(target,source,enable)``
5635-
5636-
Applies units from ``source`` burrow to ``target``. The ``enable``
5637-
parameter specifies if they are to be added or removed.
5638-
5639-
* ``copyTiles(target,source,enable)``
5640-
5641-
Applies tiles from ``source`` burrow to ``target``. The ``enable``
5642-
parameter specifies if they are to be added or removed.
5643-
5644-
* ``setTilesByKeyword(target,keyword,enable)``
5645-
5646-
Adds or removes tiles matching a predefined keyword. The keyword
5647-
set is the same as used by the command line.
5648-
5649-
The lua module file also re-exports functions from ``dfhack.burrows``.
5650-
56515617
.. _cxxrandom-api:
56525618

56535619
cxxrandom

docs/images/search-stockpile.png

-5.01 KB
Binary file not shown.

docs/images/search.png

-4.4 KB
Binary file not shown.

docs/plugins/burrow.rst

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
burrow
2+
======
3+
4+
.. dfhack-tool::
5+
:summary: Quickly adjust burrow tiles and units.
6+
:tags: fort auto design productivity units
7+
8+
This tool has two modes. When enabled, it monitors burrows with names that end
9+
in ``+``. If a wall at the edge of such a burrow is dug out, the burrow will be
10+
automatically extended to include the newly-revealed adjacent walls. If a miner
11+
digs into an open space, such as a cavern, the open space will *not* be
12+
included in the burrow.
13+
14+
When run as a command, it can quickly adjust which tiles and/or units are
15+
associated with the burrow.
16+
17+
Usage
18+
-----
19+
20+
::
21+
22+
enable burrow
23+
burrow tiles|units clear <target burrow> [<target burrow> ...] [<options>]
24+
burrow tiles|units set|add|remove <target burrow> <burrow> [...] [<options>]
25+
burrow tiles box-add|box-remove <target burrow> [<pos>] [<pos>] [<options>]
26+
burrow tiles flood-add|flood-remove <target burrow> [<options>]
27+
28+
The burrows can be referenced by name or by the internal numeric burrow ID. If
29+
referenced by name, the first burrow that matches the name (case sensitive)
30+
will be targeted. If a burrow name ends in ``+`` (to indicate that it should be
31+
auto-expanded), the final ``+`` does not need to be specified on the
32+
commandline.
33+
34+
For ``set``, ``add``, or ``remove`` commands, instead of a burrow, you can
35+
specify one of the following all-caps keywords:
36+
37+
- ``ABOVE_GROUND``
38+
- ``SUBTERRANEAN``
39+
- ``INSIDE``
40+
- ``OUTSIDE``
41+
- ``LIGHT``
42+
- ``DARK``
43+
- ``HIDDEN``
44+
- ``REVEALED``
45+
46+
to add or remove tiles with the corresponding properties.
47+
48+
Flood fill selects tiles spreading out from a starting tile if they:
49+
50+
- match the inside/outside and hidden/revealed properties of the starting tile
51+
- match the walkability group of the starting tile OR (if the starting tile is
52+
walkable) is adjacent to a tile with the same walkability group as the
53+
starting tile
54+
55+
When flood adding, the flood fill will also stop at any tiles that have already
56+
been added to the burrow. Similarly for flood removing, the flood will also
57+
stop at tiles that are not in the burrow.
58+
59+
Examples
60+
--------
61+
62+
``enable burrow``
63+
Start monitoring burrows that have names ending in '+' and automatically
64+
expand them when walls that border the burrows are dug out.
65+
``burrow tiles clear Safety``
66+
Remove all tiles from the burrow named ``Safety`` (in preparation for
67+
adding new tiles elsewhere, presumably).
68+
``burrow units clear Farmhouse Workshops``
69+
Remove all units from the burrows named ``Farmhouse`` and ``Workshops``.
70+
``multicmd burrow tiles set Inside INSIDE; burrow tiles remove Inside HIDDEN``
71+
Reset the burrow named ``Inside`` to include all the currently revealed,
72+
interior tiles.
73+
``burrow units set "Core Fort" Peasants Skilled``
74+
Clear all units from the burrow named ``Core Fort``, then add units
75+
currently assigned to the ``Peasants`` and ``Skilled`` burrows.
76+
``burrow tiles box-add Safety 0,0,0``
77+
Add all tiles to the burrow named ``Safety`` that are within the volume of
78+
the box starting at coordinate 0, 0, 0 (the upper left corner of the bottom
79+
level) and ending at the current location of the keyboard cursor.
80+
``burrow tiles flood-add Safety --cur-zlevel``
81+
Flood-add the tiles on the current z-level with the same properties as the
82+
tile under the keyboard cursor to the burrow named ``Safety``.
83+
84+
Options
85+
-------
86+
87+
``-c``, ``--cursor <pos>``
88+
Indicate the starting position of the box or flood fill. If not specified,
89+
the position of the keyboard cursor is used.
90+
``-z``, ``--cur-zlevel``
91+
Restricts a flood fill operation to the currently visible z-level.
92+
93+
Note
94+
----
95+
96+
If you are auto-expanding a burrow (whose name ends in a ``+``) and the miner
97+
who is digging to expand the burrow is assigned to that burrow, then 1-wide
98+
corridors that expand the burrow will have very slow progress. This is because
99+
the burrow is expanded to include the next dig job only after the miner has
100+
chosen a next tile to dig, which may be far away. 2-wide cooridors are much
101+
more efficient when expanding a burrow since the "next" tile to dig will still
102+
be nearby.
103+
104+
Overlay
105+
-------
106+
107+
When painting burrows in the vanilla UI, a few extra mouse operations are
108+
supported. If you box select across multiple z-levels, you will be able to
109+
select the entire volume instead of just the selected area on the z-level that
110+
you are currently looking at.
111+
112+
In addition, double-clicking will start a flood fill from the target tile.
113+
114+
The box and flood fill actions respect the UI setting for whether the burrow is
115+
being added to or erased.

docs/plugins/burrows.rst

Lines changed: 0 additions & 54 deletions
This file was deleted.

docs/plugins/search.rst

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)