diff --git a/src/client/component/branding.cpp b/src/client/component/branding.cpp index 342b8b0f..f22b9e5c 100644 --- a/src/client/component/branding.cpp +++ b/src/client/component/branding.cpp @@ -31,20 +31,30 @@ namespace branding void draw_branding() { const auto font = game::R_RegisterFont("fonts/fira_mono_bold.ttf", 22); - if (font) + if (!font) { -#ifdef DEBUG - game::R_AddCmdDrawText("h1-mod: " VERSION " (" __DATE__ " " __TIME__ ")", - 0x7FFFFFFF, font, 10.f, - 5.f + static_cast(font->pixelHeight), - 1.f, 1.f, 0.0f, color, 0); -#else - game::R_AddCmdDrawText("h1-mod", - 0x7FFFFFFF, font, 10.f, - 5.f + static_cast(font->pixelHeight), - 1.f, 1.f, 0.0f, color, 0); -#endif + return; } + +#ifdef DEBUG + const auto text = "h1-mod: " VERSION " (" __DATE__ " " __TIME__ ")"; +#else + const auto text = "h1-mod: " VERSION "; +#endif + + const auto placement = game::ScrPlace_GetViewPlacement(); + float text_color[4] = {0.6f, 0.6f, 0.6f, 0.6f}; + + game::rectDef_s rect{}; + rect.x = 0; + rect.y = 0; + rect.w = 500; + rect.horzAlign = 0; + rect.vertAlign = 0; + + game::rectDef_s text_rect{}; + + game::UI_DrawWrappedText(placement, text, &rect, font, -102.5f, 10.f, 0.17f, text_color, 0, 0, &text_rect, 0); } } diff --git a/src/client/game/structs.hpp b/src/client/game/structs.hpp index 5459fa34..5e607871 100644 --- a/src/client/game/structs.hpp +++ b/src/client/game/structs.hpp @@ -1737,6 +1737,16 @@ namespace game float halfSize[3]; }; + struct rectDef_s + { + float x; + float y; + float w; + float h; + int horzAlign; + int vertAlign; + }; + // made up struct client_state_t { diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index e9fc2096..44a936d6 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -273,6 +273,8 @@ namespace game WEAK symbol UI_AddMenuList{0x0, 0x1D9960}; WEAK symbol UI_SafeTranslateString{0x3840A0, 0x4E8BC0}; + WEAK symbol UI_DrawWrappedText{0x0, 0x1DCE30}; WEAK symbol UI_SetActiveMenu{0x0, 0x1E4D80};