command-prompt: Prevent unloading when prompt is active

develop
lethosor 2015-08-29 19:38:41 -04:00
parent 906fba9b54
commit 7437400c18
1 changed files with 7 additions and 0 deletions

@ -330,6 +330,13 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <Plug
return CR_OK;
}
DFhackCExport command_result plugin_onstatechange (color_ostream &out, state_change_event e)
{
if (e == SC_BEGIN_UNLOAD && Gui::getCurFocus() == "dfhack/commandprompt")
return CR_FAILURE;
return CR_OK;
}
DFhackCExport command_result plugin_shutdown ( color_ostream &out )
{
return CR_OK;