Dismiss previous command prompt before creating a new one

develop
lethosor 2014-05-14 18:56:30 -04:00
parent e4a6f13347
commit d52a07ef76
1 changed files with 5 additions and 0 deletions

@ -7,6 +7,7 @@
#include <ColorText.h> #include <ColorText.h>
#include <modules/Screen.h> #include <modules/Screen.h>
#include <modules/Gui.h>
#include <set> #include <set>
#include <list> #include <list>
@ -166,6 +167,10 @@ void viewscreen_commandpromptst::feed(std::set<df::interface_key> *events)
DFHACK_PLUGIN("command-prompt"); DFHACK_PLUGIN("command-prompt");
command_result show_prompt(color_ostream &out, std::vector <std::string> & parameters) command_result show_prompt(color_ostream &out, std::vector <std::string> & parameters)
{ {
if (Gui::getCurFocus() == "dfhack/commandprompt")
{
Screen::dismiss(Gui::getCurViewscreen(true));
}
std::string params; std::string params;
for(size_t i=0;i<parameters.size();i++) for(size_t i=0;i<parameters.size();i++)
params+=parameters[i]+" "; params+=parameters[i]+" ";