Merge branch 'dev-plugins' of git://github.com/lethosor/dfhack into develop

develop
Alexander Gavrilov 2014-06-03 12:06:58 +04:00
commit 06304c5a60
4 changed files with 24 additions and 3 deletions

@ -2947,7 +2947,7 @@ in-game help.
gui/mod-manager
===============
A way to simply install and remove small mods. It looks for specially formated mods in
A way to simply install and remove small mods. It looks for specially formatted mods in
df subfolder 'mods'. Mods are not included, for example mods see: `github mini mod repository <https://github.com/warmist/df-mini-mods>`_
.. image:: images/mod-manager.png

@ -42,6 +42,7 @@ using namespace MapExtras;
using namespace DFHack::Random;
using df::global::world;
using df::global::gametype;
command_result cmd_3dveins(color_ostream &out, std::vector <std::string> & parameters);
@ -1573,6 +1574,12 @@ command_result cmd_3dveins(color_ostream &con, std::vector<std::string> & parame
return CR_FAILURE;
}
if (*gametype != game_type::DWARF_MAIN && *gametype != game_type::DWARF_RECLAIM)
{
con.printerr("Must be used in fortress mode!\n");
return CR_FAILURE;
}
VeinGenerator generator(con);
con.print("Collecting statistics...\n");

@ -7,6 +7,7 @@
#include <ColorText.h>
#include <modules/Screen.h>
#include <modules/Gui.h>
#include <set>
#include <list>
@ -55,9 +56,14 @@ public:
df::global::gps->display_frames=show_fps;
}
void add_response(color_value v,std::string s)
void add_response(color_value v, std::string s)
{
responses.push_back(std::make_pair(v,s));
std::stringstream ss(s);
std::string part;
while (std::getline(ss, part))
{
responses.push_back(std::make_pair(v, part + '\n'));
}
}
protected:
std::list<std::pair<color_value,std::string> > responses;
@ -166,6 +172,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]+" ";

@ -180,6 +180,10 @@ public:
{
// Query typing mode
if (input->empty())
{
return false;
}
df::interface_key last_token = *input->rbegin();
if (last_token >= interface_key::STRING_A032 && last_token <= interface_key::STRING_A126)
{