Menus: Improve the "Status bar" option when there are only two settings and one is None

git-svn-id: https://svn.eduke32.com/eduke32@7984 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-08-14 03:03:47 +00:00 committed by Christoph Oelckers
parent d143589f3d
commit 0bf4f744a8

View file

@ -613,6 +613,7 @@ static MenuEntry_t ME_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENUENTRY( s_Scale, &MF_R
static int32_t vpsize;
static MenuRangeInt32_t MEO_SCREENSETUP_SCREENSIZE = MAKE_MENURANGE( &vpsize, &MF_Redfont, 0, 0, 0, 1, EnforceIntervals );
static MenuOption_t MEO_SCREENSETUP_SCREENSIZE_TWO = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &vpsize );
static MenuEntry_t ME_SCREENSETUP_SCREENSIZE = MAKE_MENUENTRY( "Status bar:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SCREENSETUP_SCREENSIZE, RangeInt32 );
static MenuRangeInt32_t MEO_SCREENSETUP_TEXTSIZE = MAKE_MENURANGE( &ud.textscale, &MF_Redfont, 100, 400, 0, 16, 2 );
static MenuEntry_t ME_SCREENSETUP_TEXTSIZE = MAKE_MENUENTRY( s_Scale, &MF_Redfont, &MEF_BigOptions_Apply, &MEO_SCREENSETUP_TEXTSIZE, RangeInt32 );
@ -2046,7 +2047,17 @@ static void Menu_Pre(MenuID_t cm)
!(ud.statusbarflags & STATUSBAR_NOFULL) +
!(ud.statusbarflags & STATUSBAR_NOSHRINK) * 14;
MEO_SCREENSETUP_SCREENSIZE.max = MEO_SCREENSETUP_SCREENSIZE.steps - 1;
MenuEntry_DisableOnCondition(&ME_SCREENSETUP_SCREENSIZE, (MEO_SCREENSETUP_SCREENSIZE.steps < 2));
if (MEO_SCREENSETUP_SCREENSIZE.steps <= 2 && !(ud.statusbarflags & STATUSBAR_NONONE))
{
ME_SCREENSETUP_SCREENSIZE.entry = &MEO_SCREENSETUP_SCREENSIZE_TWO;
ME_SCREENSETUP_SCREENSIZE.type = Option;
}
else
{
ME_SCREENSETUP_SCREENSIZE.entry = &MEO_SCREENSETUP_SCREENSIZE;
ME_SCREENSETUP_SCREENSIZE.type = RangeInt32;
}
MenuEntry_HideOnCondition(&ME_SCREENSETUP_SCREENSIZE, (MEO_SCREENSETUP_SCREENSIZE.steps < 2));
vpsize = !(ud.statusbarflags & STATUSBAR_NONONE) +
(ud.screen_size >= 4 && !(ud.statusbarflags & STATUSBAR_NOMODERN)) +
@ -3342,6 +3353,8 @@ static int32_t Menu_EntryOptionModify(MenuEntry_t *entry, int32_t newOption)
break;
}
}
else if (entry == &ME_SCREENSETUP_SCREENSIZE)
G_SetViewportShrink((newOption - vpsize) * 4);
else if (entry == &ME_SOUND)
{
if (newOption == 0)