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:
@@ -48,6 +48,7 @@
|
||||
#include "../../lib/mapping/CMap.h"
|
||||
#include "../../lib/NetPacksBase.h"
|
||||
#include "../../lib/StringConstants.h"
|
||||
#include "ClientCommandManager.h"
|
||||
|
||||
CList::CListItem::CListItem(CList * Parent)
|
||||
: CIntObject(LCLICK | RCLICK | HOVER),
|
||||
@@ -1144,15 +1145,18 @@ void CInGameConsole::startEnteringText()
|
||||
GH.statusbar->setEnteredText(enteredText);
|
||||
}
|
||||
|
||||
void CInGameConsole::endEnteringText(bool printEnteredText)
|
||||
void CInGameConsole::endEnteringText(bool processEnteredText)
|
||||
{
|
||||
captureAllKeys = false;
|
||||
prevEntDisp = -1;
|
||||
if(printEnteredText)
|
||||
if(processEnteredText)
|
||||
{
|
||||
std::string txt = enteredText.substr(0, enteredText.size()-1);
|
||||
LOCPLINT->cb->sendMessage(txt, LOCPLINT->getSelection());
|
||||
previouslyEntered.push_back(txt);
|
||||
|
||||
boost::thread clientCommandThread(ClientCommandManager::processCommand, txt, true);
|
||||
clientCommandThread.join();
|
||||
}
|
||||
enteredText.clear();
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@ public:
|
||||
void textEdited(const SDL_TextEditingEvent & event) override;
|
||||
|
||||
void startEnteringText();
|
||||
void endEnteringText(bool printEnteredText);
|
||||
void endEnteringText(bool processEnteredText);
|
||||
void refreshEnteredText();
|
||||
|
||||
CInGameConsole();
|
||||
|
||||
Reference in New Issue
Block a user