iw4x-client/iw4/Components/Console.cpp

30 lines
632 B
C++
Raw Normal View History

2015-12-23 08:45:53 -05:00
#include "..\STDInclude.hpp"
namespace Components
{
void Console::ToggleConsole()
{
// possibly cls.keyCatchers?
2015-12-23 09:00:01 -05:00
Utils::Hook::Xor<DWORD>(0xB2C538, 1);
2015-12-23 08:45:53 -05:00
// g_consoleField
Game::Field_Clear((void*)0xA1B6B0);
// show console output?
Utils::Hook::Set<BYTE>(0xA15F38, 0);
}
Console::Console()
{
// External console
Utils::Hook::Nop(0x60BB58, 11);
// Console '%s: %s> ' string
Utils::Hook::Set<char*>(0x5A44B4, "IW4x > ");
// Internal console
Utils::Hook(0x4F690C, Console::ToggleConsole, HOOK_CALL).Install()->Quick();
Utils::Hook(0x4F65A5, Console::ToggleConsole, HOOK_JUMP).Install()->Quick();
}
}