#pragma once #include "basepanel.h" #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") class CLauncher { public: CLauncher(const char* pszLoggerName) { m_pSurface = nullptr; m_pLogger = spdlog::stdout_color_mt(pszLoggerName); m_svCurrentDir = fs::current_path().u8string(); } ~CLauncher() { if (m_pSurface) { delete m_pSurface; } } template void AddLog(spdlog::level::level_enum nLevel, T&& svFormat, P &&... vParams) { String svBuffer = fmt::format(std::forward(svFormat), std::forward

(vParams)...).c_str(); m_pLogger->log(nLevel, svBuffer.ToCString()); m_pLogger->flush(); if (m_pSurface) { m_pSurface->m_LogList.push_back(LogList_t(nLevel, svBuffer)); m_pSurface->m_ConsoleListView->SetVirtualListSize(static_cast(m_pSurface->m_LogList.size())); m_pSurface->m_ConsoleListView->Refresh(); } } void InitSurface(); void InitConsole(); void InitLogger(); int HandleCmdLine(int argc, char* argv[]); int HandleInput(); bool Setup(eLaunchMode lMode, eLaunchState lState); bool Setup(eLaunchMode lMode, const string& svCommandLine); bool Launch() const; CUIBaseSurface* GetMainSurface() const { return m_pSurface; } private: CUIBaseSurface* m_pSurface; std::shared_ptr m_pLogger; string m_svWorkerDll; string m_svGameExe; string m_svCmdLine; string m_svCurrentDir; }; extern CLauncher* g_pLauncher;