Support milking and shearing in workflow.

develop
Alexander Gavrilov 2012-11-10 17:06:54 +04:00
parent a7bf526f41
commit eb936c4ce0
7 changed files with 26 additions and 10 deletions

@ -22,6 +22,7 @@ DFHack future
- code for deducing job outputs rewritten in lua for flexibility. - code for deducing job outputs rewritten in lua for flexibility.
- logic fix: collecting webs produces silk, and ungathered webs are not thread. - logic fix: collecting webs produces silk, and ungathered webs are not thread.
- items assigned to squads are considered busy, even if not in inventory. - items assigned to squads are considered busy, even if not in inventory.
- shearing and milking jobs are supported, but only with generic MILK or YARN outputs.
New Fix Armory plugin: New Fix Armory plugin:
Together with a couple of binary patches and the gui/assign-rack script, Together with a couple of binary patches and the gui/assign-rack script,
this plugin makes weapon racks, armor stands, chests and cabinets in this plugin makes weapon racks, armor stands, chests and cabinets in

@ -75,7 +75,7 @@ df::job *DFHack::Job::cloneJobStruct(df::job *job)
{ {
df::general_ref *ref = pnew->references[i]; df::general_ref *ref = pnew->references[i];
if (virtual_cast<df::general_ref_unit_workerst>(ref)) if (virtual_cast<df::general_ref_unit>(ref))
vector_erase_at(pnew->references, i); vector_erase_at(pnew->references, i);
else else
pnew->references[i] = ref->clone(); pnew->references[i] = ref->clone();

@ -425,6 +425,8 @@ bool MaterialInfo::matches(const df::dfhack_material_category &cat)
TEST(glass, IS_GLASS); TEST(glass, IS_GLASS);
if (cat.bits.clay && linear_index(material->reaction_product.id, std::string("FIRED_MAT")) >= 0) if (cat.bits.clay && linear_index(material->reaction_product.id, std::string("FIRED_MAT")) >= 0)
return true; return true;
if (cat.bits.milk && linear_index(material->reaction_product.id, std::string("CHEESE_MAT")) >= 0)
return true;
return false; return false;
} }

@ -1 +1 @@
Subproject commit 4ab899319014d950214714a48cd3049a4beb5eb5 Subproject commit 02e0e0d7b9a7ef708a621ef5511a24bf8657b4a2

@ -301,15 +301,26 @@ function listWeakenedConstraints(outputs)
local mask = cons.mat_mask local mask = cons.mat_mask
if (cons.mat_type or -1) >= 0 then if (cons.mat_type or -1) >= 0 then
cons.mat_mask = nil cons.mat_mask = nil
local info = dfhack.matinfo.decode(cons)
if info then
for i,flag in ipairs(df.dfhack_material_category) do
if flag and flag ~= 'wood2' and info:matches{[flag]=true} then
mask = mask or {}
mask[flag] = true
end
end
end
end end
register(cons) register(cons)
if mask then if mask then
table.insert(generic, { for k,v in pairs(mask) do
item_type = cons.item_type, table.insert(generic, {
item_subtype = cons.item_subtype, item_type = cons.item_type,
is_craft = cons.is_craft, item_subtype = cons.item_subtype,
mat_mask = mask is_craft = cons.is_craft,
}) mat_mask = { [k] = v }
})
end
end end
table.insert(anymat, { table.insert(anymat, {
item_type = cons.item_type, item_type = cons.item_type,

@ -377,7 +377,9 @@ static bool isSupportedJob(df::job *job)
Job::getHolder(job) && Job::getHolder(job) &&
(!job->job_items.empty() || (!job->job_items.empty() ||
job->job_type == job_type::CollectClay || job->job_type == job_type::CollectClay ||
job->job_type == job_type::CollectSand); job->job_type == job_type::CollectSand ||
job->job_type == job_type::MilkCreature ||
job->job_type == job_type::ShearCreature);
} }
static bool isOptionEnabled(unsigned flag) static bool isOptionEnabled(unsigned flag)

@ -306,7 +306,7 @@ function JobConstraints:onNewConstraint()
end end
dlg.showListPrompt( dlg.showListPrompt(
'Job Outputs', 'New limit',
'Select one of the possible outputs:', 'Select one of the possible outputs:',
COLOR_WHITE, COLOR_WHITE,
choices, choices,