diff --git a/plugins/eventful.cpp b/plugins/eventful.cpp index 42cfbdf69..820b53922 100644 --- a/plugins/eventful.cpp +++ b/plugins/eventful.cpp @@ -96,6 +96,7 @@ DEFINE_LUA_EVENT_NH_1(onProjUnitCheckMovement, df::proj_unitst*); //event manager DEFINE_LUA_EVENT_NH_1(onBuildingCreatedDestroyed, int32_t); DEFINE_LUA_EVENT_NH_1(onJobInitiated, df::job*); +DEFINE_LUA_EVENT_NH_1(onJobStarted, df::job*); DEFINE_LUA_EVENT_NH_1(onJobCompleted, df::job*); DEFINE_LUA_EVENT_NH_1(onUnitDeath, int32_t); DEFINE_LUA_EVENT_NH_1(onItemCreated, int32_t); @@ -122,6 +123,7 @@ DFHACK_PLUGIN_LUA_EVENTS { DFHACK_LUA_EVENT(onBuildingCreatedDestroyed), DFHACK_LUA_EVENT(onConstructionCreatedDestroyed), DFHACK_LUA_EVENT(onJobInitiated), + DFHACK_LUA_EVENT(onJobStarted), DFHACK_LUA_EVENT(onJobCompleted), DFHACK_LUA_EVENT(onUnitDeath), DFHACK_LUA_EVENT(onItemCreated), @@ -140,6 +142,11 @@ static void ev_mng_jobInitiated(color_ostream& out, void* job) df::job* ptr=reinterpret_cast(job); onJobInitiated(out,ptr); } +static void ev_mng_jobStarted(color_ostream& out, void* job) +{ + df::job* ptr=reinterpret_cast(job); + onJobStarted(out,ptr); +} void ev_mng_jobCompleted(color_ostream& out, void* job) { df::job* ptr=reinterpret_cast(job); @@ -211,6 +218,7 @@ typedef void (*handler_t) (color_ostream&,void*); static const handler_t eventHandlers[] = { NULL, ev_mng_jobInitiated, + ev_mng_jobStarted, ev_mng_jobCompleted, ev_mng_unitDeath, ev_mng_itemCreate, diff --git a/plugins/lua/eventful.lua b/plugins/lua/eventful.lua index 3fc192505..79e33d785 100644 --- a/plugins/lua/eventful.lua +++ b/plugins/lua/eventful.lua @@ -152,6 +152,7 @@ end eventType=invertTable{ [0]="TICK", "JOB_INITIATED", + "JOB_STARTED", "JOB_COMPLETED", "UNIT_DEATH", "ITEM_CREATED",