update docs for tailor

develop
myk002 2022-07-31 13:30:46 -07:00
parent 3d0eab1a9b
commit b240748684
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 38 additions and 30 deletions

@ -1,11 +1,37 @@
tailor tailor
====== ======
Tags:
:dfhack-keybind:`tailor`
Whenever the bookkeeper updates stockpile records, this plugin will scan every unit in the fort, Automatically keep your dwarves in fresh clothing. Whenever the bookkeeper
count up the number that are worn, and then order enough more made to replace all worn items. updates stockpile records, this plugin will scan the fort. If there are
If there are enough replacement items in inventory to replace all worn items, the units wearing them fresh cloths available, dwarves who are wearing tattered clothing will have
will have the worn items confiscated (in the same manner as the `cleanowned` plugin) so that they'll their rags confiscated (in the same manner as the `cleanowned` tool) so that
reeequip with replacement items. they'll reequip with replacement clothes.
Use the `enable` and `disable <disable>` commands to toggle this plugin's status, or run If there are not enough clothes available, manager orders will be generated
``tailor status`` to check its current status. to manufacture some more. ``tailor`` will intelligently create orders using
raw materials that you have on hand in the fort. For example, if you have
lots of silk, but no cloth, then ``tailor`` will order only silk clothing to
be made.
Usage::
enable tailor
tailor status
tailor materials <material> [<material> ...]
By default, ``tailor`` will prefer using materials in this order::
silk cloth yarn leather
but you can use the ``tailor materials`` command to restrict which materials
are used, and in what order.
Example
-------
``tailor materials silk cloth yarn``
Restrict the materials used for automatically manufacturing clothing to
silk, cloth, and yarn, preferred in that order. This saves leather for
other uses, like making armor.

@ -41,26 +41,6 @@ DFHACK_PLUGIN_IS_ENABLED(enabled);
REQUIRE_GLOBAL(world); REQUIRE_GLOBAL(world);
REQUIRE_GLOBAL(ui); REQUIRE_GLOBAL(ui);
const char* tagline = "Allow the bookkeeper to queue jobs to keep dwarfs in adequate clothing.";
const char* usage = (
" tailor enable\n"
" Enable the plugin.\n"
" tailor disable\n"
" Disable the plugin.\n"
" tailor status\n"
" Display plugin status\n"
" tailor materials ...\n"
" for example: tailor materials silk cloth yarn leather\n"
" Set allowed material list to the specified list.\n"
" The example sets the list to silk, cloth, yarn, leather, in that order, which is the default.\n"
"\n"
"Whenever the bookkeeper updates stockpile records, this plugin will scan every unit in the fort,\n"
"count up the number that are worn, and then order enough more made to replace all worn items.\n"
"If there are enough replacement items in inventory to replace all worn items, the units wearing them\n"
"will have the worn items confiscated (in the same manner as the _cleanowned_ plugin) so that they'll\n"
"reeequip with replacement items.\n"
);
class Tailor { class Tailor {
// ARMOR, SHOES, HELM, GLOVES, PANTS // ARMOR, SHOES, HELM, GLOVES, PANTS
@ -581,8 +561,7 @@ static command_result tailor_cmd(color_ostream& out, vector <string>& parameters
} }
else if (parameters.size() == 1 && (parameters[0] == "usage" || parameters[0] == "help" || parameters[0] == "?")) else if (parameters.size() == 1 && (parameters[0] == "usage" || parameters[0] == "help" || parameters[0] == "?"))
{ {
out.print("%s: %s\nUsage:\n%s", plugin_name, tagline, usage); return CR_WRONG_USAGE;
return CR_OK;
} }
else if (parameters.size() == 1 && parameters[0] == "test") else if (parameters.size() == 1 && parameters[0] == "test")
{ {
@ -649,7 +628,10 @@ DFhackCExport command_result plugin_init(color_ostream& out, std::vector <Plugin
enabled = true; enabled = true;
} }
commands.push_back(PluginCommand(plugin_name, tagline, tailor_cmd, false, usage)); commands.push_back(PluginCommand(
plugin_name,
"Automatically keep your dwarves in fresh clothing.",
tailor_cmd));
return CR_OK; return CR_OK;
} }