Skip to content

Commit 3876892

Browse files
committed
Add order-trim-workorders script and documentation
1 parent ff1b95a commit 3876892

File tree

2 files changed

+1011
-0
lines changed

2 files changed

+1011
-0
lines changed

docs/order-trim-workorders.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
order-trim-workorders
2+
=====================
3+
4+
.. dfhack-tool::
5+
:summary: Pick, pretty-format, and trim work orders from DFHack order JSON files.
6+
:tags: fort gui workorders
7+
8+
This script provides a two-step UI for trimming work order files in
9+
``dfhack-config/orders``:
10+
11+
1. A picker that lists ``.json`` files and filters by filename.
12+
2. A trimmer that opens a pretty-formatted ``.txt`` variant and lets you mark
13+
whole work-order objects for deletion.
14+
15+
When a work order is marked, the full top-level JSON object is targeted
16+
(including lines currently hidden by hide-noise view filtering).
17+
18+
Usage
19+
-----
20+
21+
::
22+
23+
order-trim-workorders
24+
order-trim-workorders --file <orders.json>
25+
26+
Arguments
27+
---------
28+
29+
``--file <path-or-name>``
30+
Pretty-formats the target ``.json`` into its ``.txt`` variant without
31+
opening the picker UI. If only a filename is provided, it is resolved under
32+
``dfhack-config/orders``.
33+
34+
Picker controls
35+
---------------
36+
37+
- Type in ``Search`` to filter filenames.
38+
- :kbd:`Enter` or click opens the selected file in the trimmer.
39+
- :kbd:`Esc` closes.
40+
41+
Trimmer controls
42+
----------------
43+
44+
- Click to select a line.
45+
- Toggle mark for the selected work order with:
46+
47+
- double left-click on the same line, or
48+
- :kbd:`Enter` / :kbd:`Space`
49+
50+
- Hotkeys:
51+
52+
- :kbd:`Alt` + :kbd:`D`: apply deletions (remove all marked lines)
53+
- :kbd:`Alt` + :kbd:`S`: save
54+
- :kbd:`Alt` + :kbd:`R`: reload from disk
55+
- :kbd:`Alt` + :kbd:`H`: toggle hide-noise display filter
56+
57+
- :kbd:`Esc` closes (prompts if there are unsaved changes).
58+
59+
Notes
60+
-----
61+
62+
- Save writes both the working ``.txt`` file and its companion ``.json`` file.
63+
- Search in the trimmer shows whole matching work-order groups.
64+
- Alternating row colors are used to help distinguish adjacent work orders.

0 commit comments

Comments
 (0)