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 <modules/Screen.h>
#include <modules/Gui.h>
#include <set>
#include <list>
@ -166,6 +167,10 @@ void viewscreen_commandpromptst::feed(std::set<df::interface_key> *events)
DFHACK_PLUGIN("command-prompt");
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;
for(size_t i=0;i<parameters.size();i++)
params+=parameters[i]+" ";