|
|
|
@ -122,6 +122,7 @@ static void handle_syndrome(color_ostream &out,int32_t,int32_t){};
|
|
|
|
|
static void handle_inventory_change(color_ostream& out,int32_t,int32_t,df::unit_inventory_item*,df::unit_inventory_item*){};
|
|
|
|
|
static void handle_report(color_ostream& out,int32_t){};
|
|
|
|
|
static void handle_unitAttack(color_ostream& out,int32_t,int32_t,int32_t){};
|
|
|
|
|
static void handle_unload(color_ostream& out){};
|
|
|
|
|
DEFINE_LUA_EVENT_1(onBuildingCreatedDestroyed, handle_int32t, int32_t);
|
|
|
|
|
DEFINE_LUA_EVENT_1(onJobInitiated,handle_job_init,df::job*);
|
|
|
|
|
DEFINE_LUA_EVENT_1(onJobCompleted,handle_job_complete,df::job*);
|
|
|
|
@ -132,7 +133,8 @@ DEFINE_LUA_EVENT_2(onSyndrome, handle_syndrome, int32_t,int32_t);
|
|
|
|
|
DEFINE_LUA_EVENT_1(onInvasion,handle_int32t,int32_t);
|
|
|
|
|
DEFINE_LUA_EVENT_4(onInventoryChange,handle_inventory_change,int32_t,int32_t,df::unit_inventory_item*,df::unit_inventory_item*);
|
|
|
|
|
DEFINE_LUA_EVENT_1(onReport,handle_report,int32_t);
|
|
|
|
|
DEFINE_LUA_EVENT_3(onUnitAttack,handle_unitAttack,int32_t,int32_t,int32_t)
|
|
|
|
|
DEFINE_LUA_EVENT_3(onUnitAttack,handle_unitAttack,int32_t,int32_t,int32_t);
|
|
|
|
|
DEFINE_LUA_EVENT_0(onUnload,handle_unload);
|
|
|
|
|
DFHACK_PLUGIN_LUA_EVENTS {
|
|
|
|
|
DFHACK_LUA_EVENT(onWorkshopFillSidebarMenu),
|
|
|
|
|
DFHACK_LUA_EVENT(postWorkshopFillSidebarMenu),
|
|
|
|
@ -154,6 +156,7 @@ DFHACK_PLUGIN_LUA_EVENTS {
|
|
|
|
|
DFHACK_LUA_EVENT(onInventoryChange),
|
|
|
|
|
DFHACK_LUA_EVENT(onReport),
|
|
|
|
|
DFHACK_LUA_EVENT(onUnitAttack),
|
|
|
|
|
DFHACK_LUA_EVENT(onUnload),
|
|
|
|
|
DFHACK_LUA_END
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -221,6 +224,9 @@ static void ev_mng_unitAttack(color_ostream& out, void* ptr) {
|
|
|
|
|
EventManager::UnitAttackData* data = (EventManager::UnitAttackData*)ptr;
|
|
|
|
|
onUnitAttack(out,data->attacker,data->defender,data->wound);
|
|
|
|
|
}
|
|
|
|
|
static void ev_mng_unload(color_ostream& out, void* ptr) {
|
|
|
|
|
onUnload(out);
|
|
|
|
|
}
|
|
|
|
|
std::vector<int> enabledEventManagerEvents(EventManager::EventType::EVENT_MAX,-1);
|
|
|
|
|
typedef void (*handler_t) (color_ostream&,void*);
|
|
|
|
|
static const handler_t eventHandlers[] = {
|
|
|
|
@ -236,6 +242,7 @@ static const handler_t eventHandlers[] = {
|
|
|
|
|
ev_mng_inventory,
|
|
|
|
|
ev_mng_report,
|
|
|
|
|
ev_mng_unitAttack,
|
|
|
|
|
ev_mng_unload,
|
|
|
|
|
};
|
|
|
|
|
static void enableEvent(int evType,int freq)
|
|
|
|
|
{
|
|
|
|
|