mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Remove main menu global. Now accessed via GameInstance
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
#include "CServerHandler.h"
|
||||
#include "mapView/mapHandler.h"
|
||||
#include "globalLobby/GlobalLobbyClient.h"
|
||||
#include "mainmenu/CMainMenu.h"
|
||||
|
||||
#include "../lib/CConfigHandler.h"
|
||||
|
||||
std::unique_ptr<GameInstance> GAME = nullptr;
|
||||
|
||||
@@ -41,6 +44,17 @@ CMapHandler & GameInstance::map()
|
||||
return *mapInstance;
|
||||
}
|
||||
|
||||
std::shared_ptr<CMainMenu> GameInstance::mainmenu()
|
||||
{
|
||||
if(settings["session"]["headless"].Bool())
|
||||
return nullptr;
|
||||
|
||||
if (!mainMenuInstance)
|
||||
mainMenuInstance = std::shared_ptr<CMainMenu>(new CMainMenu());
|
||||
|
||||
return mainMenuInstance;
|
||||
}
|
||||
|
||||
CPlayerInterface * GameInstance::interface()
|
||||
{
|
||||
return interfaceInstance;
|
||||
@@ -58,7 +72,7 @@ void GameInstance::setMapInstance(std::unique_ptr<CMapHandler> ptr)
|
||||
|
||||
void GameInstance::setInterfaceInstance(CPlayerInterface * ptr)
|
||||
{
|
||||
interfaceInstance = std::move(ptr);
|
||||
interfaceInstance = ptr;
|
||||
}
|
||||
|
||||
void GameInstance::onGlobalLobbyInterfaceActivated()
|
||||
|
||||
Reference in New Issue
Block a user