update docs for jobutils.

I was unable to find an example usage for `job item-type`. I couldn't
find any combination of jobs or parameters that worked.
develop
myk002 2022-07-27 16:03:49 -07:00
parent 117efaa814
commit 2008fd3955
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 49 additions and 64 deletions

@ -1,40 +1,45 @@
.. _job: .. _job:
job jobutils
=== ========
Command for general job query and manipulation. Tags:
:dfhack-keybind:`job`
:dfhack-keybind:`job-duplicate`
:dfhack-keybind:`job-material`
Options: Usage:
*no extra options* ``job``
Print details of the current job. The job can be selected Print details of the current job. The job can be selected in a workshop or
in a workshop, or the unit/jobs screen. the unit/jobs screen.
**list** ``job list``
Print details of all jobs in the selected workshop. Print details of all jobs in the selected workshop.
**item-material <item-idx> <material[:subtoken]>** ``job item-material <item-idx> <material[:subtoken]>``
Replace the exact material id in the job item. Replace the exact material id in the job item.
**item-type <item-idx> <type[:subtype]>** ``job item-type <item-idx> <type[:subtype]>``
Replace the exact item type id in the job item. Replace the exact item type id in the job item.
``job-duplicate``
job-duplicate Duplicates the highlighted job. Must be in :kbd:`q` mode and have a workshop
============= or furnace building selected.
In :kbd:`q` mode, when a job is highlighted within a workshop or furnace ``job-material <inorganic-token>``
building, calling ``job-duplicate`` instantly duplicates the job. Alters the material of the selected job (in :kbd:`q` mode) or jumps to the
selected material when choosing the building component of a planned building
:dfhack-keybind:`job-duplicate` (in :kbd:`b` mode). Note that this form of the command can only handle
inorganic materials.
job-material
============ Use the ``job`` and ``job list`` commands to discover the type and material ids
Alter the material of the selected job. Similar to ``job item-material ...`` for existing jobs, or use the following commands to see the full lists::
Invoked as:: lua @df.item_type
lua "for i,mat in ipairs(df.global.world.raws.inorganics) do if mat.material.flags.IS_STONE and not mat.material.flags.NO_STONE_STOCKPILE then print(i, mat.id) end end"
job-material <inorganic-token>
Examples
:dfhack-keybind:`job-material` --------
* In :kbd:`q` mode, when a job is highlighted within a workshop or furnace, ``job-material GNEISS``
changes the material of the job. Only inorganic materials can be used Change the selected "Construct rock Coffin" job at a Mason's workshop to
in this mode. "Construct gneiss coffin".
* In :kbd:`b` mode, during selection of building components positions the cursor ``job item-material 2 MARBLE``
over the first available choice with the matching material. Change the selected "Construct Traction Bench" job (which has three source
items: a table, a mechanism, and a chain) to specifically use a marble
mechanism.

@ -53,46 +53,26 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
commands.push_back( commands.push_back(
PluginCommand( PluginCommand(
"job", "General job query and manipulation.", "job",
job_cmd, false, "Inspect and modify job item properties.",
" job [query]\n" job_cmd));
" Print details of the current job. The job can be\n"
" selected in a workshop, or the unit/jobs screen.\n"
" job list\n"
" Print details of all jobs in the selected workshop.\n"
" job item-material <item-idx> <material[:subtoken]>\n"
" Replace the exact material id in the job item.\n"
" job item-type <item-idx> <type[:subtype]>\n"
" Replace the exact item type id in the job item.\n"
)
);
if (ui_workshop_job_cursor || ui_build_selector) { if (ui_workshop_job_cursor || ui_build_selector) {
commands.push_back( commands.push_back(
PluginCommand( PluginCommand(
"job-material", "Alter the material of the selected job.", "job-material",
job_material, job_material_hotkey, "Alter the material of the selected job or building.",
" job-material <inorganic-token>\n" job_material,
"Intended to be used as a keybinding:\n" job_material_hotkey));
" - In 'q' mode, when a job is highlighted within a workshop\n"
" or furnace, changes the material of the job. Only inorganic\n"
" materials can be used in this mode.\n"
" - In 'b' mode, during selection of building components\n"
" positions the cursor over the first available choice\n"
" with the matching material.\n"
)
);
} }
if (ui_workshop_job_cursor && job_next_id) { if (ui_workshop_job_cursor && job_next_id) {
commands.push_back( commands.push_back(
PluginCommand( PluginCommand(
"job-duplicate", "Duplicate the selected job in a workshop.", "job-duplicate",
job_duplicate, Gui::workshop_job_hotkey, "Duplicate the selected job in a workshop.",
" - In 'q' mode, when a job is highlighted within a workshop\n" job_duplicate,
" or furnace building, instantly duplicates the job.\n" Gui::workshop_job_hotkey));
)
);
} }
return CR_OK; return CR_OK;