mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Allow ingame console to use clientside commands and print output
This commit is contained in:
@@ -230,7 +230,7 @@ int CConsoleHandler::run()
|
||||
{
|
||||
if ( getline(std::cin, buffer).good() )
|
||||
if ( cb && *cb )
|
||||
(*cb)(buffer);
|
||||
(*cb)(buffer, false);
|
||||
}
|
||||
else
|
||||
boost::this_thread::sleep(boost::posix_time::millisec(100));
|
||||
@@ -239,7 +239,7 @@ int CConsoleHandler::run()
|
||||
#else
|
||||
std::getline(std::cin, buffer);
|
||||
if ( cb && *cb )
|
||||
(*cb)(buffer);
|
||||
(*cb)(buffer, false);
|
||||
#endif
|
||||
}
|
||||
return -1;
|
||||
@@ -263,7 +263,7 @@ CConsoleHandler::CConsoleHandler() : thread(nullptr)
|
||||
#else
|
||||
defColor = "\x1b[0m";
|
||||
#endif
|
||||
cb = new std::function<void(const std::string &)>;
|
||||
cb = new std::function<void(const std::string &, bool)>;
|
||||
}
|
||||
CConsoleHandler::~CConsoleHandler()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user