mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Improve handling of empty text in console, remove unused includes
This commit is contained in:
@ -20,16 +20,12 @@
|
|||||||
#include "../CMusicHandler.h"
|
#include "../CMusicHandler.h"
|
||||||
#include "../CPlayerInterface.h"
|
#include "../CPlayerInterface.h"
|
||||||
#include "../mainmenu/CMainMenu.h"
|
#include "../mainmenu/CMainMenu.h"
|
||||||
#include "../Graphics.h"
|
|
||||||
#include "../CMessage.h"
|
|
||||||
|
|
||||||
#include "../gui/CGuiHandler.h"
|
#include "../gui/CGuiHandler.h"
|
||||||
#include "../gui/SDL_Pixels.h"
|
#include "../gui/SDL_Pixels.h"
|
||||||
#include "../gui/SDL_Compat.h"
|
|
||||||
|
|
||||||
#include "../windows/InfoWindows.h"
|
#include "../windows/InfoWindows.h"
|
||||||
#include "../windows/CAdvmapInterface.h"
|
#include "../windows/CAdvmapInterface.h"
|
||||||
#include "../windows/GUIClasses.h"
|
|
||||||
|
|
||||||
#include "../battle/BattleInterfaceClasses.h"
|
#include "../battle/BattleInterfaceClasses.h"
|
||||||
#include "../battle/BattleInterface.h"
|
#include "../battle/BattleInterface.h"
|
||||||
@ -42,12 +38,8 @@
|
|||||||
#include "../../lib/CModHandler.h"
|
#include "../../lib/CModHandler.h"
|
||||||
#include "../../lib/CTownHandler.h"
|
#include "../../lib/CTownHandler.h"
|
||||||
#include "../../lib/TerrainHandler.h"
|
#include "../../lib/TerrainHandler.h"
|
||||||
#include "../../lib/filesystem/Filesystem.h"
|
|
||||||
#include "../../lib/JsonNode.h"
|
|
||||||
#include "../../lib/mapObjects/CGHeroInstance.h"
|
#include "../../lib/mapObjects/CGHeroInstance.h"
|
||||||
#include "../../lib/mapping/CMap.h"
|
#include "../../lib/mapping/CMap.h"
|
||||||
#include "../../lib/NetPacksBase.h"
|
|
||||||
#include "../../lib/StringConstants.h"
|
|
||||||
#include "ClientCommandManager.h"
|
#include "ClientCommandManager.h"
|
||||||
|
|
||||||
CList::CListItem::CListItem(CList * Parent)
|
CList::CListItem::CListItem(CList * Parent)
|
||||||
@ -1046,11 +1038,16 @@ void CInGameConsole::keyPressed (const SDL_KeyboardEvent & key)
|
|||||||
}
|
}
|
||||||
case SDLK_RETURN: //enter 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");
|
CCS->soundh->playSound("CHAT");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SDLK_BACKSPACE:
|
case SDLK_BACKSPACE:
|
||||||
|
Reference in New Issue
Block a user