mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 03:52:12 -04:00
Improve menu tab centering (#1546)
* Improve menu tab centering * Styling
This commit is contained in:
parent
b42ecbcd37
commit
af5cf5ea68
13
src/m_menu.c
13
src/m_menu.c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user