aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/sourceconsole.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 19:58:45 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 19:58:45 +0100
commit1885caebdaf971bf68073884754325aa8d1c0da7 (patch)
tree71fae6595c8a24ae067e8a037082e43803920586 /NorthstarDedicatedTest/sourceconsole.cpp
parentbf56157c9a3a50452d322dd99aa5b82baf4b0013 (diff)
downloadNorthstarLauncher-1885caebdaf971bf68073884754325aa8d1c0da7.tar.gz
NorthstarLauncher-1885caebdaf971bf68073884754325aa8d1c0da7.zip
improve showing console for ui script compile errors
Diffstat (limited to 'NorthstarDedicatedTest/sourceconsole.cpp')
-rw-r--r--NorthstarDedicatedTest/sourceconsole.cpp26
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