1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Added GameInstance class

- available as global GAME
- integrates LOCPLINT (CPlayerInterface)
- integrates CGI->mh (CMapHandler)
- integrates CSH (CServerHandler)
This commit is contained in:
Ivan Savenko
2025-02-11 15:23:33 +00:00
parent ffd37a8fa8
commit 156de5b17e
98 changed files with 1288 additions and 1131 deletions

View File

@@ -16,6 +16,7 @@
#include "../GameChatHandler.h"
#include "../ClientCommandManager.h"
#include "../GameEngine.h"
#include "../GameInstance.h"
#include "../gui/WindowHandler.h"
#include "../gui/Shortcut.h"
#include "../gui/TextAlignment.h"
@@ -46,7 +47,7 @@ void CInGameConsole::showAll(Canvas & to)
void CInGameConsole::show(Canvas & to)
{
if (LOCPLINT->cingconsole != this)
if (GAME->interface()->cingconsole != this)
return;
int number = 0;
@@ -142,7 +143,7 @@ bool CInGameConsole::captureThisKey(EShortcut key)
void CInGameConsole::keyPressed (EShortcut key)
{
if (LOCPLINT->cingconsole != this)
if (GAME->interface()->cingconsole != this)
return;
if(!isEnteringText() && key != EShortcut::GAME_ACTIVATE_CONSOLE)
@@ -221,7 +222,7 @@ void CInGameConsole::keyPressed (EShortcut key)
void CInGameConsole::textInputted(const std::string & inputtedText)
{
if (LOCPLINT->cingconsole != this)
if (GAME->interface()->cingconsole != this)
return;
if(!isEnteringText())
@@ -242,7 +243,7 @@ void CInGameConsole::textEdited(const std::string & inputtedText)
void CInGameConsole::showRecentChatHistory()
{
auto const & history = CSH->getGameChat().getChatHistory();
auto const & history = GAME->server().getGameChat().getChatHistory();
texts.clear();
@@ -303,7 +304,7 @@ void CInGameConsole::endEnteringText(bool processEnteredText)
clientCommandThread.detach();
}
else
CSH->getGameChat().sendMessageGameplay(txt);
GAME->server().getGameChat().sendMessageGameplay(txt);
}
enteredText.clear();