diff options
Diffstat (limited to 'NorthstarDedicatedTest/sourceconsole.cpp')
-rw-r--r-- | NorthstarDedicatedTest/sourceconsole.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/NorthstarDedicatedTest/sourceconsole.cpp b/NorthstarDedicatedTest/sourceconsole.cpp index ed986af8..8e1dcb83 100644 --- a/NorthstarDedicatedTest/sourceconsole.cpp +++ b/NorthstarDedicatedTest/sourceconsole.cpp @@ -16,6 +16,16 @@ void ConCommand_toggleconsole(const CCommand& arg) (*g_SourceGameConsole)->Activate(); } +void ConCommand_showconsole(const CCommand& arg) +{ + (*g_SourceGameConsole)->Activate(); +} + +void ConCommand_hideconsole(const CCommand& arg) +{ + (*g_SourceGameConsole)->Hide(); +} + typedef void (*OnCommandSubmittedType)(CConsoleDialog* consoleDialog, const char* pCommand); OnCommandSubmittedType onCommandSubmittedOriginal; void OnCommandSubmittedHook(CConsoleDialog* consoleDialog, const char* pCommand) @@ -48,12 +58,6 @@ void InitialiseConsoleOnInterfaceCreation() reinterpret_cast<LPVOID*>(&onCommandSubmittedOriginal)); } -ON_DLL_LOAD_CLIENT_RELIESON("client.dll", SourceConsole, ConCommand, (HMODULE baseAddress) -{ - g_SourceGameConsole = new SourceInterface<CGameConsole>("client.dll", "GameConsole004"); - RegisterConCommand("toggleconsole", ConCommand_toggleconsole, "toggles the console", FCVAR_DONTRECORD); -}) - // logging stuff SourceConsoleSink::SourceConsoleSink() @@ -78,4 +82,12 @@ void SourceConsoleSink::sink_it_(const spdlog::details::log_msg& msg) ->m_pConsole->m_pConsolePanel->ColorPrint(logColours[msg.level], fmt::to_string(formatted).c_str()); // todo needs colour support } -void SourceConsoleSink::flush_() {}
\ No newline at end of file +void SourceConsoleSink::flush_() {} + +ON_DLL_LOAD_CLIENT_RELIESON("client.dll", SourceConsole, ConCommand, (HMODULE baseAddress) +{ + g_SourceGameConsole = new SourceInterface<CGameConsole>("client.dll", "GameConsole004"); + RegisterConCommand("toggleconsole", ConCommand_toggleconsole, "toggles the console", FCVAR_DONTRECORD); + RegisterConCommand("showconsole", ConCommand_showconsole, "shows the console", FCVAR_DONTRECORD); + RegisterConCommand("hideconsole", ConCommand_hideconsole, "hides the console", FCVAR_DONTRECORD); +})
\ No newline at end of file |