Smaller branding

This commit is contained in:
fed 2023-01-27 01:03:35 +01:00
parent 2da040d197
commit f5c8bdb600
3 changed files with 34 additions and 12 deletions

View File

@ -31,20 +31,30 @@ namespace branding
void draw_branding() void draw_branding()
{ {
const auto font = game::R_RegisterFont("fonts/fira_mono_bold.ttf", 22); const auto font = game::R_RegisterFont("fonts/fira_mono_bold.ttf", 22);
if (font) if (!font)
{ {
#ifdef DEBUG return;
game::R_AddCmdDrawText("h1-mod: " VERSION " (" __DATE__ " " __TIME__ ")",
0x7FFFFFFF, font, 10.f,
5.f + static_cast<float>(font->pixelHeight),
1.f, 1.f, 0.0f, color, 0);
#else
game::R_AddCmdDrawText("h1-mod",
0x7FFFFFFF, font, 10.f,
5.f + static_cast<float>(font->pixelHeight),
1.f, 1.f, 0.0f, color, 0);
#endif
} }
#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);
} }
} }

View File

@ -1737,6 +1737,16 @@ namespace game
float halfSize[3]; float halfSize[3];
}; };
struct rectDef_s
{
float x;
float y;
float w;
float h;
int horzAlign;
int vertAlign;
};
// made up // made up
struct client_state_t struct client_state_t
{ {

View File

@ -273,6 +273,8 @@ namespace game
WEAK symbol<void(void* dc, void* menuList, int close)> UI_AddMenuList{0x0, 0x1D9960}; WEAK symbol<void(void* dc, void* menuList, int close)> UI_AddMenuList{0x0, 0x1D9960};
WEAK symbol<const char*(const char* string)> UI_SafeTranslateString{0x3840A0, 0x4E8BC0}; WEAK symbol<const char*(const char* string)> UI_SafeTranslateString{0x3840A0, 0x4E8BC0};
WEAK symbol<void(ScreenPlacement* scrPlace, const char* text, rectDef_s* rect, Font_s* font, float x, float y,
float scale, const float* color, int style, int textAlignMode, rectDef_s* textRect, char a12)> UI_DrawWrappedText{0x0, 0x1DCE30};
WEAK symbol<int(int local_client_num, int menu)> UI_SetActiveMenu{0x0, 0x1E4D80}; WEAK symbol<int(int local_client_num, int menu)> UI_SetActiveMenu{0x0, 0x1E4D80};