mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-15 23:50:38 +00:00
feat(console): add pitchLimit, AppendLogToFile and 4.3.4's Tab completion
Cross-checked against the 4.3.4 decompilation (wowdecomp15595): - The handler's first argument is the command name, not unused (the shared CVar handler looks its CVar up by it); Game::Console::Write takes 4.3.4's COLOR_T, and Game::Console::Printf is the engine's own ConsolePrintf (0x0063CD50). - pitchLimit <deg>: writes the camera pitch clamp, which 1.12 keeps as two .rdata floats read only by camera code. - Ctrl+Tab lists every command containing the typed text; Tab after set/cvar_reset/cvar_default completes CVar names (extension). Our key handler registers at the console's own priority 7.0, which the engine's tie rule runs first, so no hook is needed. - AppendLogToFile [file] [numLines]: implements the contract 4.3.4's help text documents (the shipped command prints "Access Denied"). - The command-list walk moves into console/Registry.h, and EnsureParentDirs into Common.
This commit is contained in:
@@ -45,7 +45,6 @@ namespace Console::Shell {
|
||||
namespace {
|
||||
|
||||
using ConsoleExec_t = void(__fastcall *)(const char *line, int addToHistory);
|
||||
using ConsoleWrite_t = void(__fastcall *)(const char *line, int colorType);
|
||||
using ConsoleSetKey_t = void(__fastcall *)(int keyCode);
|
||||
|
||||
// `ConsoleExec(command)` — run a console command line.
|
||||
@@ -74,8 +73,8 @@ int __fastcall Script_ConsoleEcho(void *L) {
|
||||
if (colorType < 0 || colorType >= Offsets::CONSOLE_COLOR_COUNT)
|
||||
colorType = 0;
|
||||
}
|
||||
reinterpret_cast<ConsoleWrite_t>(Offsets::FUN_CONSOLE_WRITE)(Game::Lua::ToString(L, 1),
|
||||
colorType);
|
||||
Game::Console::Write(Game::Lua::ToString(L, 1),
|
||||
static_cast<Game::Console::Color>(colorType));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user