Skip to content

Commit

Permalink
Console toggle F2
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-k0 committed Apr 20, 2024
1 parent 1e784e4 commit 76f7999
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Console.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,21 @@ namespace Console {
LOGLEVEL = (LOGLEVEL + 1) % 3;
std::cout << "Log level set to " << LOGLEVEL << ": 0 INFO - 1 WARN - 2 ERR"<< std::endl;
}

void HideConsole() {
ShowWindow(GetConsoleWindow(), SW_HIDE);
}

void ShowConsole() {
ShowWindow(GetConsoleWindow(), SW_SHOW);
}

void ToggleConsole() {
if (IsWindowVisible(GetConsoleWindow())) {
HideConsole();
}
else {
ShowConsole();
}
}
}
6 changes: 5 additions & 1 deletion Trampoline.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ namespace Trampoline {
{
std::cout << "Failed to install detour luasteam_getSteamID" << std::endl;
}
Console::Print("End of loading libraries and installing hooks. Hopefully everything works correctly now.", 69);
Console::Print("End of loading libraries and installing hooks.\nHopefully everything works correctly now.\nYou can hide this window by pressing F2.", 69);
return TRUE;

}
Expand All @@ -338,6 +338,10 @@ namespace Trampoline {
{
Console::CycleLogLevel();
}
if (GetAsyncKeyState(VK_F2) & 1)
{
Console::ToggleConsole();
}
}
}
}

0 comments on commit 76f7999

Please sign in to comment.