@ -249,10 +249,15 @@ IMPLEMENT_HOOKS(workshop_profile)
! INTERPOSE_HOOK ( screen # # _overlay , feed ) . apply ( enable ) | | \
! INTERPOSE_HOOK ( screen # # _overlay , feed ) . apply ( enable ) | | \
! INTERPOSE_HOOK ( screen # # _overlay , render ) . apply ( enable )
! INTERPOSE_HOOK ( screen # # _overlay , render ) . apply ( enable )
DFhackCExport command_result plugin_enable ( color_ostream & , bool enable ) {
DFhackCExport command_result plugin_enable ( color_ostream & out , bool enable ) {
if ( is_enabled = = enable )
if ( is_enabled = = enable )
return CR_OK ;
return CR_OK ;
if ( enable ) {
screenSize = Screen : : getWindowSize ( ) ;
call_overlay_lua ( & out , " reload " ) ;
}
DEBUG ( control ) . print ( " %sing interpose hooks \n " , enable ? " enabl " : " disabl " ) ;
DEBUG ( control ) . print ( " %sing interpose hooks \n " , enable ? " enabl " : " disabl " ) ;
if ( INTERPOSE_HOOKS_FAILED ( adopt_region ) | |
if ( INTERPOSE_HOOKS_FAILED ( adopt_region ) | |
@ -361,10 +366,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector <Plugin
" Manage onscreen widgets. " ,
" Manage onscreen widgets. " ,
overlay_cmd ) ) ;
overlay_cmd ) ) ;
screenSize = Screen : : getWindowSize ( ) ;
return CR_OK ;
call_overlay_lua ( & out , " reload " ) ;
return plugin_enable ( out , true ) ;
}
}
DFhackCExport command_result plugin_shutdown ( color_ostream & out ) {
DFhackCExport command_result plugin_shutdown ( color_ostream & out ) {