From a503e54484b73ce9d8a7dc68a3a6e2b627a731c4 Mon Sep 17 00:00:00 2001 From: Warmist Date: Tue, 3 Nov 2015 17:59:24 +0200 Subject: [PATCH] Add furnaces to sidebar fill event --- plugins/eventful.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/eventful.cpp b/plugins/eventful.cpp index 3a8b6da7a..4c168ab89 100644 --- a/plugins/eventful.cpp +++ b/plugins/eventful.cpp @@ -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;