From c2e5ae844c75474bed1ca7757ac8379bc9822b6d Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 2 Nov 2019 21:07:10 -0400 Subject: [PATCH] tailor: add docs Ref #1398 --- docs/Plugins.rst | 17 ++++++++++++++++- plugins/devel/tailor.cpp | 8 ++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/Plugins.rst b/docs/Plugins.rst index 2b78fd700..670b93e73 100644 --- a/docs/Plugins.rst +++ b/docs/Plugins.rst @@ -1480,7 +1480,7 @@ Some widgets support additional options: .. _dwarfvet: dwarfvet -============ +======== Enables Animal Caretaker functionality Always annoyed your dragons become useless after a minor injury? Well, with @@ -1831,6 +1831,21 @@ nestboxes Automatically scan for and forbid fertile eggs incubating in a nestbox. Toggle status with `enable` or `disable`. +.. _tailor: + +tailor +====== + +Whenever the bookkeeper updates stockpile records, this plugin will scan every unit in the fort, +count up the number that are worn, and then order enough more made to replace all worn items. +If there are enough replacement items in inventory to replace all worn items, the units wearing them +will have the worn items confiscated (in the same manner as the `cleanowned` plugin) so that they'll +reeequip with replacement items. + +Use the `enable` and `disable` commands to toggle this plugin's status, or run +``tailor status`` to check its current status. + + ================ Map modification ================ diff --git a/plugins/devel/tailor.cpp b/plugins/devel/tailor.cpp index 18db67b38..d59316677 100644 --- a/plugins/devel/tailor.cpp +++ b/plugins/devel/tailor.cpp @@ -50,7 +50,7 @@ const char *usage = ( " tailor status\n" " Display plugin status\n" "\n" - "Whenever the bookkeeper updates stockpile records, the plugin will scan every unit in the fort, \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" @@ -76,7 +76,7 @@ static map itemTypeMap = { { df::item_type::GLOVES, df::job_type::MakeGloves}, { df::item_type::SHOES, df::job_type::MakeShoes} }; - + void do_scan(color_ostream& out) { map, int> available; // key is item type & size @@ -86,7 +86,7 @@ void do_scan(color_ostream& out) map sizes; // this maps body size to races map, int> orders; // key is item type, item subtype, size - + df::item_flags bad_flags; bad_flags.whole = 0; @@ -192,7 +192,7 @@ void do_scan(color_ostream& out) if (oo == itemTypeMap.end()) continue; df::job_type o = oo->second; - + int size = world->raws.creatures.all[w->getMakerRace()]->adultsize; std::string description; w->getItemDescription(&description, 0);