Skip to content

Commit d03fe9c

Browse files
authored
Merge branch 'master' into master
2 parents a45f5ec + d7b64af commit d03fe9c

118 files changed

Lines changed: 2407 additions & 1767 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ repos:
2020
args: ['--fix=lf']
2121
- id: trailing-whitespace
2222
- repo: https://github.com/python-jsonschema/check-jsonschema
23-
rev: 0.17.1
23+
rev: 0.18.2
2424
hooks:
2525
- id: check-github-workflows
2626
- repo: https://github.com/Lucas-C/pre-commit-hooks
27-
rev: v1.3.0
27+
rev: v1.3.1
2828
hooks:
2929
- id: forbid-tabs
3030
exclude_types:

changelog.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ that repo.
1414
# Future
1515

1616
## New Scripts
17-
17+
- `gui/kitchen-info`: adds more info to the Kitchen screen
1818
- `gui/workorder-details`: adjusts work orders' input item, material, traits
1919
- `warn-stealers`: warn when creatures that may steal your food, drinks, or items become visible
2020

2121
## Fixes
22+
- `devel/query`: fixed error when --tile is specified
2223
- `gui/unit-info-viewer`: fix logic for displaying undead creature names
2324
- `gui/workflow`: restore functionality to the add/remove/order hotkeys on the workflow status screen
2425
- `emigration`: fix emigrant logic so unhappy dwarves leave as designed
2526
- `gui/gm-unit`: allow ``+`` and ``-`` to adjust skill values as intended instead of letting the filter intercept the characters
2627
- `dwarf-op`: fixed error when applying the Miner job to dwarves
2728

2829
## Misc Improvements
30+
- `devel/query`: inform the user when a query has been truncated due to ``--maxlength`` being hit.
31+
- `devel/query`: increased default maxlength value from 257 to 2048
2932
- `gui/gm-unit`: don't clear the list filter when you adjust a skill value
3033
- `gui/quickfort`: better formatting for the generated manager orders report
3134
- `gui/quickfort`: display an error message when the blueprints directory cannot be found
@@ -35,6 +38,11 @@ that repo.
3538

3639
## Removed
3740
- `fix/build-location`: The corresponding DF bug (5991) was fixed in DF 0.40.05
41+
- `fix/diplomats`: DF bug 3295 fixed in 0.40.05
42+
- `fix/fat-dwarves`: DF bug 5971 fixed in 0.40.05
43+
- `fix/feeding-timers`: DF bug 2606 is fixed in 0.40.12
44+
- `fix/merchants`: DF bug that prevents humans from making trade agreements has been fixed
45+
- `gui/assign-rack`: No longer useful in current DF versions
3846
- `gui/hack-wish`: Replaced by `gui/create-item`
3947
- `gui/no-dfhack-init`: No longer useful since players don't have to create their own ``dfhack.init`` files anymore
4048

devel/query.lua

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,14 @@ function foreach(table, name, callback)
270270
-- How can the data be iterated?
271271
-- Is the iteration count for the data too high? (Default: 257)
272272

273+
function print_truncation_msg(name,index)
274+
print("<query on " .. name .. " truncated after " .. index .. ">")
275+
end
273276
local index = 0
274277
if getmetatable(table) and table._kind and (table._kind == "enum-type" or table._kind == "bitfield-type") then
275278
for idx, value in ipairs(table) do
276279
if is_exceeding_maxlength(index) then
280+
print_truncation_msg(name, index)
277281
return
278282
end
279283
callback(idx, value)
@@ -284,6 +288,7 @@ function foreach(table, name, callback)
284288
local m = tostring(field):gsub("<.*: ",""):gsub(">.*",""):gsub("%x%x%x%x%x%x","%1 ",1)
285289
local s = string.format("next{%d}->item", index)
286290
if is_exceeding_maxlength(index) then
291+
print_truncation_msg(name, index)
287292
return
288293
end
289294
callback(s, value)
@@ -292,6 +297,7 @@ function foreach(table, name, callback)
292297
else
293298
for field, value in safe_pairs(table) do
294299
if is_exceeding_maxlength(index) then
300+
print_truncation_msg(name, index)
295301
return
296302
end
297303
callback(field, value)
@@ -431,8 +437,8 @@ function processArguments()
431437
elseif args.dumb then
432438
args.maxlength = 10000
433439
else
434-
--257 was chosen with the intent of capturing all enums. Or hopefully most of them.
435-
args.maxlength = 257
440+
--2048 was chosen as it was the smallest power of 2 that can query the `df` table entirely, and it seems likely it'll be able to query most structures fully
441+
args.maxlength = 2048
436442
end
437443

438444
new_value = toType(args.setvalue)
@@ -740,7 +746,9 @@ function printParents(path, field, value)
740746
elseif string.find(word,"%a+%[%d+%]%[%d+%]") then
741747
value_printed = true
742748
cur_path = appendField(cur_path, word)
743-
print(makeIndentedField(path, word, value))
749+
local f = presentField(path, field, value)
750+
local v = presentValue(field, value)
751+
print(f .. v .. presentDebugData(f, field, value))
744752
end
745753
cur_depth = cur_depth + 1
746754
end

docs/assign-attributes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Options
4444
``--unit <id>``
4545
The target unit ID. If not present, the currently selected unit will be the
4646
target.
47-
``--attributes "[" <attribute> <tier> [<attribute> <tier> ...] "]"``
47+
``--attributes [ <attribute> <tier> [<attribute> <tier> ...] ]``
4848
The list of the attributes to modify and their tiers. The valid attribute
4949
names can be found in the :wiki:`Attribute` (substitute any space with
5050
underscores). Tiers range from -4 to 4. There must be a space before and

docs/assign-beliefs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Options
4444
``--unit <id>``
4545
The target unit ID. If not present, the currently selected unit will be the
4646
target.
47-
``--beliefs "[" <belief> <level> [<belief> <level> ...] "]"``
47+
``--beliefs [ <belief> <level> [<belief> <level> ...] ]``
4848
The list of the beliefs to modify and their levels. The valid belief tokens
4949
can be found in the :wiki:`Personality_trait` (substitute any space with
5050
underscores). Levels range from -3 to 3. There must be a space before and

docs/assign-facets.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Options
4141
``--unit <id>``
4242
The target unit ID. If not present, the currently selected unit will be the
4343
target.
44-
``--facets "[" <facet> <level> [<facet> <level> ...] "]"``
44+
``--facets [ <facet> <level> [<facet> <level> ...] ]``
4545
The list of the facets to modify and their levels. The valid facet tokens
4646
can be found in the :wiki:`Personality_trait` (substitute any space with
4747
underscores). Levels range from -3 to 3. There must be a space before and

docs/assign-goals.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Options
3636
``--unit <id>``
3737
The target unit ID. If not present, the currently selected unit will be the
3838
target.
39-
``--goals "[" <goal> false [<goal> false ...] "]"``
39+
``--goals [ <goal> false [<goal> false ...] ]``
4040
The list of goals to add. The valid goal tokens can be found in the
4141
:wiki:`Personality_trait` (substitute any space with underscores). There
4242
must be a space before and after each square bracket.

docs/assign-preferences.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,25 @@ brackets can be omitted.
7272
``--unit <id>``
7373
The target unit ID. If not present, the currently selected unit will be the
7474
target.
75-
``--likematerial "[" <token> [<token> ...] "]"``
75+
``--likematerial [ <token> [<token> ...] ]``
7676
This is usually set to three tokens: a type of stone, a type of metal, and a
7777
type of gem. It can also be a type of wood, glass, leather, horn, pearl,
7878
ivory, a decoration material - coral or amber, bone, shell, silk, yarn, or
7979
cloth. Please include the full tokens, not just a part.
80-
``--likecreature "[" <token> [<token> ...] "]"``
80+
``--likecreature [ <token> [<token> ...] ]``
8181
For this preference, you can just list the species as the token. For
8282
example, a creature token can be something like ``CREATURE:SPARROW:SKIN``.
8383
Here, you can just say ``SPARROW``.
84-
``--likefood "[" <token> [<token> ...] "]"``
84+
``--likefood [ <token> [<token> ...] ]``
8585
This usually contains at least a type of alcohol. It can also be a type of
8686
meat, fish, cheese, edible plant, cookable plant/creature extract, cookable
8787
mill powder, cookable plant seed, or cookable plant leaf. Please write the
8888
full tokens.
89-
``--hatecreature "[" <token> [<token> ...] "]"``
89+
``--hatecreature [ <token> [<token> ...] ]``
9090
As in ``--likecreature`` above, you can just list the species in the token.
9191
The creature should be a type of ``HATEABLE`` vermin which isn't already
9292
explicitly liked, but no check is performed to enforce this.
93-
``--likeitem "[" <token> [<token> ...] "]"``
93+
``--likeitem [ <token> [<token> ...] ]``
9494
This can be a kind of weapon, a kind of ammo, a piece of armor, a piece of
9595
clothing (including backpacks or quivers), a type of furniture (doors,
9696
floodgates, beds, chairs, windows, cages, barrels, tables, coffins, statues,
@@ -106,15 +106,15 @@ brackets can be omitted.
106106
column "Subtype" of the wiki page (they are in the "/raw/ojects/" folder),
107107
then specify the items using the full tokens found in those files (see
108108
examples in this help).
109-
``--likeplant "[" <token> [<token> ...] "]"``
109+
``--likeplant [ <token> [<token> ...] ]``
110110
As in ``--likecreature`` above, you can just list the tree or plant species
111111
in the token.
112-
``--likecolor "[" <token> [<token> ...] "]"``
112+
``--likecolor [ <token> [<token> ...] ]``
113113
You can find the color tokens here:
114114
https://dwarffortresswiki.org/index.php/DF2014:Color#Color_tokens
115115
or inside the "descriptor_color_standard.txt" file (in the "/raw/ojects/"
116116
folder). You can use the full token or just the color name.
117-
``--likeshape "[" <token> [<token> ...] "]"``
117+
``--likeshape [ <token> [<token> ...] ]``
118118
I couldn't find a list of shape tokens in the wiki, but you can find them
119119
inside the "descriptor_shape_standard.txt" file (in the "/raw/ojects/"
120120
folder). You can use the full token or just the shape name.

docs/assign-skills.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Options
3131
``--unit <id>``
3232
The target unit ID. If not present, the currently selected unit will be the
3333
target.
34-
``--skills "[" <skill> <rank> [<skill> <rank> ...] "]"``
34+
``--skills [ <skill> <rank> [<skill> <rank> ...] ]``
3535
The list of the skills to modify and their ranks. Rank values range from -1
3636
(the skill is not learned) to 20 (legendary + 5). It is actually possible to
3737
go beyond 20 (no check is performed), but the effect on the game may not be

docs/color-schemes.rst

Lines changed: 61 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,73 @@
1-
21
color-schemes
32
=============
43

54
.. dfhack-tool::
6-
:summary: todo.
5+
:summary: Modify the colors used by the DF UI.
76
:tags: fort gameplay graphics
87

8+
This tool allows you to set exactly which shades of colors should be used in the
9+
DF interface color palette.
10+
11+
To set up the colors, you must first create at least one file with color
12+
definitions inside. These files must be in the same format as
13+
:file:`data/init/colors.txt` and contain RGB values for each of the color names.
14+
Just copy :file:`colors.txt` and edit the values for your custom color schemes.
15+
16+
If you are interested in alternate color schemes, also see:
17+
18+
- `gui/color-schemes`: the in-game GUI for this script
19+
- `season-palette`: automatically swaps color schemes when the season changes
20+
21+
Usage
22+
-----
23+
24+
``color-schemes register <directory> [-f] [-q]``
25+
Register the directory (relative to the main DF game directory) where your
26+
color scheme files are stored.
27+
``color-schemes list``
28+
List the color schemes from the registered directories.
29+
``color-schemes default set <scheme name> [-q]``
30+
Set the named color scheme as the default. This value is stored so you only
31+
have to set it once, even if you start a new adventure/fort.
32+
``color-schemes default load [-q]``
33+
Load the default color scheme that you previously set with ``default set``.
34+
``color-schemes load <scheme name> [-q]``
35+
Load the named color scheme.
36+
37+
Examples
38+
--------
39+
40+
Read your color scheme files from the :file:`colorschemes` directory (a
41+
directory you created and populated with color scheme files) and set the
42+
default to the scheme named ``mydefault``::
43+
44+
color-schemes register colorschemes
45+
color-schemes default set mydefault
46+
47+
Read your color scheme files from the :file:`colorschemes` directory (a
48+
directory you created and populated with color scheme files) and load the saved
49+
default. If you have a color scheme that you always want loaded, put these
50+
commands in your :file:`dfhack-config/init/dfhack.init` file::
951

10-
A script to manage color schemes.
52+
color-schemes -q register colorschemes
53+
color-schemes default load
1154

12-
Current features are :
13-
* :Registration:
14-
* :Loading:
15-
* :Listing:
16-
* :Default: Setting/Loading
55+
Options
56+
-------
1757

18-
For detailed information and usage, type ``color-schemes`` in console.
58+
``-f``, ``--force``
59+
Register and read color schemes that are incomplete or are syntactically
60+
incorrect.
61+
``-q``, ``--quiet``
62+
Don't print any informational output.
1963

20-
Loaded as a module, this script will export those methods :
21-
* register(path, force) : Register colors schemes by path (file or directory), relative to DF main directory
22-
* load(name) : Load a registered color scheme by name
23-
* list() : Return a list of registered color schemes
24-
* set_default(name) : Set the default color scheme
25-
* load_default() : Load the default color scheme
64+
API
65+
---
2666

27-
For more information about arguments and return values, see ``hack/scripts/color-schemes.lua``.
67+
When loaded as a module, this script will export the following functions:
2868

29-
Related scripts:
30-
* `gui/color-schemes` is the in-game GUI for this script.
31-
* `season-palette` swaps color schemes when the season changes.
69+
- ``register(path, force)`` : Register colors schemes by path (file or directory), relative to DF main directory
70+
- ``load(name)`` : Load a registered color scheme by name
71+
- ``list()`` : Return a list of registered color schemes
72+
- ``set_default(name)`` : Set the default color scheme
73+
- ``load_default()`` : Load the default color scheme

0 commit comments

Comments
 (0)