Merge remote-tracking branch 'warmist/patch-6' into develop

Add furnace to fillsidebarmenu hook
develop
lethosor 2015-11-07 16:04:05 -05:00
commit 8117549175
1 changed files with 17 additions and 0 deletions

@ -287,6 +287,22 @@ struct workshop_hook : df::building_workshopst{
}
};
IMPLEMENT_VMETHOD_INTERPOSE(workshop_hook, fillSidebarMenu);
struct furnace_hook : df::building_furnacest{
typedef df::building_furnacest interpose_base;
DEFINE_VMETHOD_INTERPOSE(void,fillSidebarMenu,())
{
CoreSuspendClaimer suspend;
color_ostream_proxy out(Core::getInstance().getConsole());
bool call_native=true;
onWorkshopFillSidebarMenu(out,this,&call_native);
if(call_native)
INTERPOSE_NEXT(fillSidebarMenu)();
postWorkshopFillSidebarMenu(out,this);
}
};
IMPLEMENT_VMETHOD_INTERPOSE(furnace_hook, fillSidebarMenu);
struct product_hook : item_product {
typedef item_product interpose_base;
@ -430,6 +446,7 @@ static bool find_reactions(color_ostream &out)
static void enable_hooks(bool enable)
{
INTERPOSE_HOOK(workshop_hook,fillSidebarMenu).apply(enable);
INTERPOSE_HOOK(furnace_hook,fillSidebarMenu).apply(enable);
INTERPOSE_HOOK(item_hooks,contaminateWound).apply(enable);
INTERPOSE_HOOK(proj_unit_hook,checkImpact).apply(enable);
INTERPOSE_HOOK(proj_unit_hook,checkMovement).apply(enable);