mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
Merge pull request #1489 from dydzio0614/console-crash-fix
Improve handling of empty text in console, remove unused includes
This commit is contained in:
commit
3cef3c10be
@ -20,16 +20,12 @@
|
||||
#include "../CMusicHandler.h"
|
||||
#include "../CPlayerInterface.h"
|
||||
#include "../mainmenu/CMainMenu.h"
|
||||
#include "../Graphics.h"
|
||||
#include "../CMessage.h"
|
||||
|
||||
#include "../gui/CGuiHandler.h"
|
||||
#include "../gui/SDL_Pixels.h"
|
||||
#include "../gui/SDL_Compat.h"
|
||||
|
||||
#include "../windows/InfoWindows.h"
|
||||
#include "../windows/CAdvmapInterface.h"
|
||||
#include "../windows/GUIClasses.h"
|
||||
|
||||
#include "../battle/BattleInterfaceClasses.h"
|
||||
#include "../battle/BattleInterface.h"
|
||||
@ -42,12 +38,8 @@
|
||||
#include "../../lib/CModHandler.h"
|
||||
#include "../../lib/CTownHandler.h"
|
||||
#include "../../lib/TerrainHandler.h"
|
||||
#include "../../lib/filesystem/Filesystem.h"
|
||||
#include "../../lib/JsonNode.h"
|
||||
#include "../../lib/mapObjects/CGHeroInstance.h"
|
||||
#include "../../lib/mapping/CMap.h"
|
||||
#include "../../lib/NetPacksBase.h"
|
||||
#include "../../lib/StringConstants.h"
|
||||
#include "ClientCommandManager.h"
|
||||
|
||||
CList::CListItem::CListItem(CList * Parent)
|
||||
@ -1046,11 +1038,16 @@ void CInGameConsole::keyPressed (const SDL_KeyboardEvent & key)
|
||||
}
|
||||
case SDLK_RETURN: //enter key
|
||||
{
|
||||
if(enteredText.size() > 0 && captureAllKeys)
|
||||
if(!enteredText.empty() && captureAllKeys)
|
||||
{
|
||||
bool anyTextExceptCaret = enteredText.size() > 1;
|
||||
endEnteringText(anyTextExceptCaret);
|
||||
|
||||
if(anyTextExceptCaret)
|
||||
{
|
||||
endEnteringText(true);
|
||||
CCS->soundh->playSound("CHAT");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SDLK_BACKSPACE:
|
||||
|
Loading…
Reference in New Issue
Block a user