From c1a0778da77b0659c1d0341637dbbee4887f0ffd Mon Sep 17 00:00:00 2001 From: JerryALT Date: Tue, 26 Mar 2024 08:50:49 +0300 Subject: [PATCH] [Functions]: Added 'DrawWrappedText'. --- src/Game/Functions.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/Game/Functions.hpp | 1 + 2 files changed, 39 insertions(+) diff --git a/src/Game/Functions.cpp b/src/Game/Functions.cpp index dde48ba..638dbc0 100644 --- a/src/Game/Functions.cpp +++ b/src/Game/Functions.cpp @@ -1336,4 +1336,42 @@ namespace Game } return result; } + + void DrawWrappedText(const rectDef_s* rect /*edi*/, Game::Font_s* font /*esi*/, const Game::ScreenPlacement* ScrPlace, const char* text, float x, float y, float scale, const float* color, int style, int textAlignMode, Game::rectDef_s* textRect, const float* glowColor, int subtitle, int cinematic) + { + const uint32_t DrawWrappedText_func = 0x56E440; + __asm + { + pushad; + push cinematic; + push subtitle; + push glowColor; + push textRect; + push textAlignMode; + push style; + push color; //28 + + sub esp, 0Ch; + + fld scale; + fstp [esp + 8h]; + + fld y; + fstp [esp + 4h]; + + fld x; + fstp [esp]; + + push text + push ScrPlace; + + mov edi, [rect]; + mov esi, [font]; + + call DrawWrappedText_func; + add esp, 30h; + + popad; + } + } } \ No newline at end of file diff --git a/src/Game/Functions.hpp b/src/Game/Functions.hpp index 49ea6d0..dca1b62 100644 --- a/src/Game/Functions.hpp +++ b/src/Game/Functions.hpp @@ -261,4 +261,5 @@ namespace Game int String_Parse/*eax*/(const char** p/*eax*/, char* char_out, int len); int UI_GetKeyBindingLocalizedString/*eax*/(int localClientNum/*eax*/, const char* command/*ecx*/, char* keys, int bindNum); + void DrawWrappedText(const rectDef_s* rect /*edi*/, Game::Font_s* font /*esi*/, const Game::ScreenPlacement* ScrPlace, const char* text, float x, float y, float scale, const float* color, int style, int textAlignMode, Game::rectDef_s* textRect, const float* glowColor, int subtitle, int cinematic); } \ No newline at end of file