diff --git a/src/Components/Modules/TextRenderer.cpp b/src/Components/Modules/TextRenderer.cpp index 59a07d4..9c0091c 100644 --- a/src/Components/Modules/TextRenderer.cpp +++ b/src/Components/Modules/TextRenderer.cpp @@ -202,6 +202,30 @@ namespace Components } } + __declspec(naked) void TextRenderer::UI_GetKeyBindingLocalizedStringStub() + { + const static uint32_t continue_function = 0x41AA92; + const static uint32_t jump_end = 0x41AAF5; + __asm + { + //stock op's + add esp, 8; + test eax, eax; + //mod + jz isNotKeyBinding; + + pushad; + push edi; + call ButtonAnimation; + add esp, 4; + popad; + + jmp jump_end; + isNotKeyBinding: + jmp continue_function; + } + } + TextRenderer::TextRenderer() { Utils::Hook(0x56E613, R_TextWidth_Stub01, HOOK_JUMP).install()->quick(); @@ -211,5 +235,8 @@ namespace Components Utils::Hook(0x5FE402, DrawHudIconStub, HOOK_JUMP).install()->quick(); Utils::Hook(0x568224, UI_ReplaceConversionStringStub, HOOK_JUMP).install()->quick(); + // GetHudelemDirective + Utils::Hook::Nop(0x41AA8B, 7); + Utils::Hook(0x41AA8B, UI_GetKeyBindingLocalizedStringStub, HOOK_JUMP).install()->quick(); } } \ No newline at end of file diff --git a/src/Components/Modules/TextRenderer.hpp b/src/Components/Modules/TextRenderer.hpp index 24274c1..1e0503f 100644 --- a/src/Components/Modules/TextRenderer.hpp +++ b/src/Components/Modules/TextRenderer.hpp @@ -22,6 +22,7 @@ namespace Components static void DrawHudIconStub(); static void UI_ReplaceConversionStringStub(); static void ButtonAnimation(char* text); + static void UI_GetKeyBindingLocalizedStringStub(); static int R_TextWidth_Hk(const char* text, int maxChars, Game::Font_s* font); static float DrawHudIcon(const char* text, const Game::Font_s* font, const float x, const float y, const float sinAngle, const float cosAngle, const float xScale, const float yScale, Game::GfxColor color);