Improve menu tab centering (#1546)

* Improve menu tab centering

* Styling
This commit is contained in:
Alaux 2024-03-03 01:24:24 -03:00 committed by GitHub
parent b42ecbcd37
commit af5cf5ea68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2151,6 +2151,11 @@ static void M_DrawTabs(void)
for (int i = 0; tabs[i].text; ++i)
{
if (i)
{
width += M_TAB_OFFSET;
}
mrect_t *rect = &tabs[i].rect;
if (!rect->w)
{
@ -2158,7 +2163,7 @@ static void M_DrawTabs(void)
rect->y = M_TAB_Y;
rect->h = M_SPC;
}
width += rect->w + M_TAB_OFFSET;
width += rect->w;
}
int x = (SCREENWIDTH - width) / 2;
@ -2167,7 +2172,11 @@ static void M_DrawTabs(void)
{
mrect_t *rect = &tabs[i].rect;
x += M_TAB_OFFSET;
if (i)
{
x += M_TAB_OFFSET;
}
menu_buffer[0] = '\0';
strcpy(menu_buffer, tabs[i].text);
M_DrawMenuStringEx(tabs[i].flags, x, rect->y, CR_GOLD);