diff --git a/data/init/dfhack.tools.init b/data/init/dfhack.tools.init index aab17ebbe..0887f80ba 100644 --- a/data/init/dfhack.tools.init +++ b/data/init/dfhack.tools.init @@ -89,6 +89,7 @@ enable automaterial # Other interface improvement tools enable \ + overlay \ confirm \ dwarfmonitor \ mousequery \ diff --git a/plugins/overlay.cpp b/plugins/overlay.cpp index 509fa5597..cb19df892 100644 --- a/plugins/overlay.cpp +++ b/plugins/overlay.cpp @@ -249,10 +249,15 @@ IMPLEMENT_HOOKS(workshop_profile) !INTERPOSE_HOOK(screen##_overlay, feed).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) return CR_OK; + if (enable) { + screenSize = Screen::getWindowSize(); + call_overlay_lua(&out, "reload"); + } + DEBUG(control).print("%sing interpose hooks\n", enable ? "enabl" : "disabl"); if (INTERPOSE_HOOKS_FAILED(adopt_region) || @@ -361,10 +366,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector