From b14af3433ec8bc6dde0565a36cd67b02b0d90852 Mon Sep 17 00:00:00 2001 From: m Date: Wed, 18 May 2022 19:14:06 -0500 Subject: [PATCH] input + game console, symbol changes playerKeys isn't working though :P --- src/client/component/game_console.cpp | 11 ++++++----- src/client/component/input.cpp | 7 +++++-- src/client/game/symbols.hpp | 18 +++++++++--------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/client/component/game_console.cpp b/src/client/component/game_console.cpp index 95816851..a0f34f28 100644 --- a/src/client/component/game_console.cpp +++ b/src/client/component/game_console.cpp @@ -391,7 +391,7 @@ namespace game_console const auto width = (con.screen_max[0] - con.screen_min[0]) - 12.0f; const auto height = ((con.screen_max[1] - con.screen_min[1]) - 32.0f) - 12.0f; - game::R_AddCmdDrawText("H1-Mod 1.4", 0x7FFFFFFF, console_font, x, + game::R_AddCmdDrawText("H1-Mod 1.15", 0x7FFFFFFF, console_font, x, ((height - 16.0f) + y) + console_font->pixelHeight, 1.0f, 1.0f, 0.0f, color_title, 0); draw_output_scrollbar(x, y, width, height, output); @@ -586,7 +586,9 @@ namespace game_console return false; } - if (game::playerKeys[local_client_num].keys[game::keyNum_t::K_SHIFT].down) + const auto shift_down = game::playerKeys[local_client_num].keys[game::keyNum_t::K_SHIFT].down; + console::info("shift down? %d", shift_down); + if (shift_down) { if (!(*game::keyCatchers & 1)) toggle_console(); @@ -721,14 +723,13 @@ namespace game_console return; } - //scheduler::loop(draw_console, scheduler::pipeline::renderer); + scheduler::loop(draw_console, scheduler::pipeline::renderer); } void post_unpack() override { scheduler::loop(draw_console, scheduler::pipeline::renderer); - if (game::environment::is_dedi()) { return; @@ -797,4 +798,4 @@ namespace game_console }; } -//REGISTER_COMPONENT(game_console::component) +REGISTER_COMPONENT(game_console::component) diff --git a/src/client/component/input.cpp b/src/client/component/input.cpp index ad615b34..45f55e08 100644 --- a/src/client/component/input.cpp +++ b/src/client/component/input.cpp @@ -16,9 +16,9 @@ namespace input utils::hook::detour cl_char_event_hook; utils::hook::detour cl_key_event_hook; - void cl_char_event_stub(const int local_client_num, const int key) { + /* if (ui_scripting::lui_running()) { ui_scripting::notify("keypress", @@ -27,6 +27,7 @@ namespace input {"key", game::Key_KeynumToString(key, 0, 1)}, }); } + */ if (!game_console::console_char_event(local_client_num, key)) { @@ -38,6 +39,7 @@ namespace input void cl_key_event_stub(const int local_client_num, const int key, const int down) { + /* if (ui_scripting::lui_running()) { ui_scripting::notify(down ? "keydown" : "keyup", @@ -46,6 +48,7 @@ namespace input {"key", game::Key_KeynumToString(key, 0, 1)}, }); } + */ if (!game_console::console_key_event(local_client_num, key, down)) { @@ -72,4 +75,4 @@ namespace input }; } -//REGISTER_COMPONENT(input::component) +REGISTER_COMPONENT(input::component) diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 424d035c..c943c028 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -48,7 +48,7 @@ namespace game WEAK symbol CG_GetWeaponDisplayName{0x0, 0x0}; - WEAK symbol CL_IsCgameInitialized{0x0, 0x76A40}; + WEAK symbol CL_IsCgameInitialized{0x0, 0x33C640}; WEAK symbol CL_VirtualLobbyShutdown{0x0, 0x0}; WEAK symbol Dvar_SetCommand{0x0, 0x1857D0}; @@ -69,7 +69,7 @@ namespace game WEAK symbol Dvar_RegisterString{0x0, 0x182AF0}; WEAK symbol Dvar_RegisterVec4{0x0, 0x0}; + float w, float min, float max, unsigned int flags)> Dvar_RegisterVec4{0x0, 0x183010}; WEAK symbol FS_ReadFile{0x0, 0x0}; WEAK symbol FS_FreeFile{0x0, 0x0}; @@ -111,9 +111,9 @@ namespace game WEAK symbol NET_StringToAdr{0x0, 0x4F2150}; WEAK symbol R_AddCmdDrawStretchPic{0x0, 0x0}; + float* color, Material* material)> R_AddCmdDrawStretchPic{0x0, 0x33B2B0}; WEAK symbol R_RegisterFont{0x0, 0x67F630}; - WEAK symbol R_TextWidth{0x0, 0x0}; + WEAK symbol R_TextWidth{0x0, 0x67F8F0}; WEAK symbol R_GetFontHeight{0x0, 0x67F710}; WEAK symbol R_DrawSomething{0x0, 0x67ECE0}; WEAK symbol R_SyncRenderThread{0x0, 0x0}; @@ -144,7 +144,7 @@ namespace game WEAK symbol Scr_GetEntityId{0x0, 0x0}; WEAK symbol Scr_SetObjectField{0x0, 0x0}; - WEAK symbol ScrPlace_GetViewPlacement{0x0, 0x0}; + WEAK symbol ScrPlace_GetViewPlacement{0x0, 0x362840}; WEAK symbol DB_EnumXAssets_Internal{0x0, 0x0}; @@ -181,7 +181,7 @@ namespace game WEAK symbol SV_GetClientPing{0x0, 0x0}; WEAK symbol SV_GetPlayerstateForClientNum{0x0, 0x0}; WEAK symbol SV_SetConfigstring{0x0, 0x0}; - WEAK symbol SV_Loaded{0x0, 0x0}; + WEAK symbol SV_Loaded{0x0, 0x553970}; WEAK symbol SV_KickClientNum{0x0, 0x0}; WEAK symbol SV_MapExists{0x0, 0x0}; WEAK symbol SV_ExecuteClientCommand{0x0, 0x0}; @@ -198,11 +198,11 @@ namespace game WEAK symbol Sys_FileExists{0x0, 0x0}; WEAK symbol UI_GetMapDisplayName{0x0, 0x0}; - WEAK symbol UI_GetGameTypeDisplayName{0x0, 0x0}; + WEAK symbol UI_GetGameTypeDisplayName{0x0, 0x4DD8C0}; WEAK symbol UI_RunMenuScript{0x0, 0x0}; WEAK symbol UI_TextWidth{0x0, 0x0}; - WEAK symbol UI_SafeTranslateString{0x0, 0x0}; + WEAK symbol UI_SafeTranslateString{0x0, 0x4E8BC0}; WEAK symbol longjmp{0x0, 0x0}; WEAK symbol _setjmp{0x0, 0x0}; @@ -239,7 +239,7 @@ namespace game WEAK symbol g_assetNames{0x0, 0x0}; WEAK symbol keyCatchers{0x0, 0x2EC82C4}; - WEAK symbol playerKeys{0x0, 0x0}; + WEAK symbol playerKeys{0x0, 0x2999D00}; WEAK symbol query_socket{0x0, 0xC9DCD38};