Compares important fields in the job item structures.
Compares important fields in the job item structures.
* ``dfhack.job.linkIntoWorld(job,new_id)``
Adds job into ``df.global.job_list``, and if new_id
is true, then also sets it's id and increases
``df.global.job_next_id``
* ``dfhack.job.listNewlyCreated(first_id)``
* ``dfhack.job.listNewlyCreated(first_id)``
Returns the current value of ``df.global.job_next_id``, and
Returns the current value of ``df.global.job_next_id``, and
@ -3209,7 +3215,8 @@ Functions
5. ``registerSidebar(shop_name,callback)``
5. ``registerSidebar(shop_name,callback)``
Enable callback when sidebar for ``shop_name`` is drawn. Usefull for custom workshop views e.g. using gui.dwarfmode lib.
Enable callback when sidebar for ``shop_name`` is drawn. Usefull for custom workshop views e.g. using gui.dwarfmode lib. Also accepts a ``class`` instead of function
as callback. Best used with ``gui.dwarfmode`` class ``WorkshopOverlay``.
Examples
Examples
--------
--------
@ -3266,6 +3273,7 @@ Functions
a. tables of 4 numbers ``{tile,fore,back,bright}`` OR
a. tables of 4 numbers ``{tile,fore,back,bright}`` OR
b. empty table (tile not modified) OR
b. empty table (tile not modified) OR
c. ``{x=<number> y=<number> + 4 numbers like in first case}``, this generates full frame useful for animations that change little (1-2 tiles)
c. ``{x=<number> y=<number> + 4 numbers like in first case}``, this generates full frame useful for animations that change little (1-2 tiles)
8. canBeRoomSubset -- a flag if this building can be counted in room. 1 means it can, 0 means it can't and -1 default building behaviour
Animate table also might contain:
Animate table also might contain:
1. frameLenght -- how many ticks does one frame take OR
1. frameLenght -- how many ticks does one frame take OR
@ -165,7 +137,7 @@ function showItemPrompt(text,item_filter,hide_none)
end
end
functionshowMaterialPrompt(title,prompt,filter,inorganic,creature,plant)--the one included with DFHack doesn't have a filter or the inorganic, creature, plant things available
functionshowMaterialPrompt(title,prompt,filter,inorganic,creature,plant)--the one included with DFHack doesn't have a filter or the inorganic, creature, plant things available
guimaterials.MaterialDialog{
require('gui.materials').MaterialDialog{
frame_title=title,
frame_title=title,
prompt=prompt,
prompt=prompt,
mat_filter=filter,
mat_filter=filter,
@ -189,10 +161,9 @@ function getCreatureRaceAndCaste(caste)
localitemok,itemtype,itemsubtype=showItemPrompt('What item do you want?',function(itype)returndf.item_type[itype]~='CORPSE'anddf.item_type[itype]~='FOOD'end,true)
localitemok,itemtype,itemsubtype=showItemPrompt('What item do you want?',function(itype)returndf.item_type[itype]~='CORPSE'anddf.item_type[itype]~='FOOD'end,true)
ifnotargs.notRestrictivethen
ifnotargs.notRestrictivethen
@ -210,43 +181,43 @@ function hackWish(posOrUnit)
localdescriptionok
localdescriptionok
descriptionok,description=script.showInputPrompt('Slab','What should the slab say?',COLOR_WHITE)
descriptionok,description=script.showInputPrompt('Slab','What should the slab say?',COLOR_WHITE)
end
end
--repeat amountok,amount=script.showInputPrompt('Wish','How many do you want? (numbers only!)',COLOR_LIGHTGREEN) until tonumber(amount)
ifargs.multithen
repeatamountok,amount=script.showInputPrompt('Wish','How many do you want? (numbers only!)',COLOR_LIGHTGREEN)untiltonumber(amount)