make dfhack.job.attachJobItem available to Lua

develop
Myk Taylor 2023-02-18 01:09:54 -08:00
parent 34c8a21c54
commit 2b59d6ee3d
No known key found for this signature in database
2 changed files with 10 additions and 0 deletions

@ -1219,6 +1219,15 @@ Job module
if there are any jobs with ``first_id <= id < job_next_id``, if there are any jobs with ``first_id <= id < job_next_id``,
a lua list containing them. a lua list containing them.
* ``dfhack.job.attachJobItem(job, item, role, filter_idx, insert_idx)``
Attach a real item to this job. If the item is intended to satisfy a job_item
filter, the index of that filter should be passed in ``filter_idx``; otherwise,
pass ``-1``. Similarly, if you don't care where the item is inserted, pass
``-1`` for ``insert_idx``. The ``role`` param is a ``df.job_item_ref.T_role``.
If the item needs to be brought to the job site, then the value should be
``df.job_item_ref.T_role.Hauled``.
* ``dfhack.job.isSuitableItem(job_item, item_type, item_subtype)`` * ``dfhack.job.isSuitableItem(job_item, item_type, item_subtype)``
Does basic sanity checks to verify if the suggested item type matches Does basic sanity checks to verify if the suggested item type matches

@ -1659,6 +1659,7 @@ static bool jobItemEqual(const df::job_item *job1, const df::job_item *job2)
} }
static const LuaWrapper::FunctionReg dfhack_job_module[] = { static const LuaWrapper::FunctionReg dfhack_job_module[] = {
WRAPM(Job,attachJobItem),
WRAPM(Job,cloneJobStruct), WRAPM(Job,cloneJobStruct),
WRAPM(Job,printItemDetails), WRAPM(Job,printItemDetails),
WRAPM(Job,printJobDetails), WRAPM(Job,printJobDetails),