mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-25 23:11:20 +00:00
Merge branch 'menu-indents-pass-1' into 'master'
Menu indentation for selected options (first pass) See merge request KartKrew/Kart!1736
This commit is contained in:
commit
d0e1d0a42a
3 changed files with 66 additions and 29 deletions
|
|
@ -1191,6 +1191,7 @@ void M_DrawMenuForeground(void);
|
|||
void M_Drawer(void);
|
||||
void M_DrawGenericMenu(void);
|
||||
void M_DrawKartGamemodeMenu(void);
|
||||
void M_FlipKartGamemodeMenu(boolean slide);
|
||||
void M_DrawHorizontalMenu(void);
|
||||
void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines);
|
||||
void M_DrawMessageMenu(void);
|
||||
|
|
|
|||
|
|
@ -1199,6 +1199,9 @@ void M_DrawGenericMenu(void)
|
|||
#define GM_STARTY 80
|
||||
#define GM_XOFFSET 17
|
||||
#define GM_YOFFSET 34
|
||||
#define GM_FLIPTIME 5
|
||||
|
||||
static tic_t gm_flipStart;
|
||||
|
||||
//
|
||||
// M_DrawKartGamemodeMenu
|
||||
|
|
@ -1251,6 +1254,13 @@ void M_DrawKartGamemodeMenu(void)
|
|||
}
|
||||
}
|
||||
|
||||
INT32 cx = x;
|
||||
|
||||
if (i == itemOn && menutransition.tics == menutransition.dest)
|
||||
{
|
||||
cx -= Easing_OutSine(M_DueFrac(gm_flipStart, GM_FLIPTIME), 0, GM_XOFFSET / 2);
|
||||
}
|
||||
|
||||
type = (currentMenu->menuitems[i].status & IT_DISPLAY);
|
||||
|
||||
switch (type)
|
||||
|
|
@ -1260,7 +1270,7 @@ void M_DrawKartGamemodeMenu(void)
|
|||
{
|
||||
UINT8 *colormap = NULL;
|
||||
|
||||
if (i == itemOn)
|
||||
if (i == itemOn && menutransition.tics == menutransition.dest)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_CACHE);
|
||||
}
|
||||
|
|
@ -1269,8 +1279,8 @@ void M_DrawKartGamemodeMenu(void)
|
|||
colormap = R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_MOSS, GTC_CACHE);
|
||||
}
|
||||
|
||||
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, W_CachePatchName("MENUPLTR", PU_CACHE), colormap);
|
||||
V_DrawGamemodeString(x + 16, y - 3,
|
||||
V_DrawFixedPatch(cx*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, W_CachePatchName("MENUPLTR", PU_CACHE), colormap);
|
||||
V_DrawGamemodeString(cx + 16, y - 3,
|
||||
(type == IT_TRANSTEXT2
|
||||
? V_TRANSLUCENT
|
||||
: 0
|
||||
|
|
@ -1286,6 +1296,11 @@ void M_DrawKartGamemodeMenu(void)
|
|||
}
|
||||
}
|
||||
|
||||
void M_FlipKartGamemodeMenu(boolean slide)
|
||||
{
|
||||
gm_flipStart = slide ? I_GetTime() : 0;
|
||||
}
|
||||
|
||||
void M_DrawHorizontalMenu(void)
|
||||
{
|
||||
INT32 x, y, i, final = currentMenu->extra2-1, showflags;
|
||||
|
|
@ -2524,7 +2539,7 @@ void M_DrawRaceDifficulty(void)
|
|||
|
||||
INT32 f = (i == itemOn) ? highlightflags : 0;
|
||||
|
||||
V_DrawString(140 + 48*menutransition.tics, y, f, currentMenu->menuitems[i].text);
|
||||
V_DrawString(140 + 48*menutransition.tics + (i == itemOn ? 1 : 0), y, f, currentMenu->menuitems[i].text);
|
||||
|
||||
if (currentMenu->menuitems[i].status & IT_CVAR)
|
||||
{
|
||||
|
|
@ -2544,6 +2559,12 @@ void M_DrawRaceDifficulty(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (i == itemOn)
|
||||
{
|
||||
V_DrawScaledPatch(140 + 48*menutransition.tics - 24, y, 0,
|
||||
W_CachePatchName("M_CURSOR", PU_CACHE));
|
||||
}
|
||||
|
||||
y += 10;
|
||||
|
||||
break;
|
||||
|
|
@ -2552,11 +2573,17 @@ void M_DrawRaceDifficulty(void)
|
|||
case IT_STRING:
|
||||
{
|
||||
|
||||
INT32 cx = x;
|
||||
UINT8 *colormap = NULL;
|
||||
|
||||
if (i == itemOn)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_CACHE);
|
||||
|
||||
if (i >= drace_boxend)
|
||||
{
|
||||
cx -= Easing_OutSine(M_DueFrac(gm_flipStart, GM_FLIPTIME), 0, GM_XOFFSET / 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2567,13 +2594,13 @@ void M_DrawRaceDifficulty(void)
|
|||
if (currentMenu->menuitems[i].status & IT_CVAR)
|
||||
{
|
||||
|
||||
INT32 fx = (x - 48*menutransition.tics);
|
||||
INT32 fx = (cx - 48*menutransition.tics);
|
||||
INT32 centx = fx + (320-fx)/2 + (menutransition.tics*48); // undo the menutransition movement to redo it here otherwise the text won't move at the same speed lole.
|
||||
|
||||
// implicitely we'll only take care of normal consvars
|
||||
consvar_t *cv = currentMenu->menuitems[i].itemaction.cvar;
|
||||
|
||||
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, W_CachePatchName("MENUSHRT", PU_CACHE), colormap);
|
||||
V_DrawFixedPatch(cx*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, W_CachePatchName("MENUSHRT", PU_CACHE), colormap);
|
||||
V_DrawCenteredGamemodeString(centx, y - 3, 0, colormap, cv->string);
|
||||
|
||||
if (i == itemOn)
|
||||
|
|
@ -2588,8 +2615,8 @@ void M_DrawRaceDifficulty(void)
|
|||
}
|
||||
else // not a cvar
|
||||
{
|
||||
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, W_CachePatchName("MENUPLTR", PU_CACHE), colormap);
|
||||
V_DrawGamemodeString(x + 16, y - 3, 0, colormap, currentMenu->menuitems[i].text);
|
||||
V_DrawFixedPatch(cx*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, W_CachePatchName("MENUPLTR", PU_CACHE), colormap);
|
||||
V_DrawGamemodeString(cx + 16, y - 3, 0, colormap, currentMenu->menuitems[i].text);
|
||||
}
|
||||
x += GM_XOFFSET;
|
||||
y += GM_YOFFSET;
|
||||
|
|
@ -4158,7 +4185,7 @@ void M_DrawGenericOptions(void)
|
|||
cursory = y;
|
||||
|
||||
if ((currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING)
|
||||
V_DrawString(x, y, 0, currentMenu->menuitems[i].text);
|
||||
V_DrawString(x + (i == itemOn ? 1 : 0), y, 0, currentMenu->menuitems[i].text);
|
||||
else
|
||||
V_DrawString(x, y, highlightflags, currentMenu->menuitems[i].text);
|
||||
|
||||
|
|
@ -4256,7 +4283,7 @@ void M_DrawGenericOptions(void)
|
|||
{
|
||||
V_DrawScaledPatch(x - 24, cursory, 0,
|
||||
W_CachePatchName("M_CURSOR", PU_CACHE));
|
||||
V_DrawString(x, cursory, highlightflags, currentMenu->menuitems[itemOn].text);
|
||||
V_DrawString(x + 1, cursory, highlightflags, currentMenu->menuitems[itemOn].text);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ boolean M_NextOpt(void)
|
|||
} while (oldItemOn != itemOn && (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_SPACE);
|
||||
|
||||
M_UpdateMenuBGImage(false);
|
||||
M_FlipKartGamemodeMenu(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -176,6 +177,7 @@ boolean M_PrevOpt(void)
|
|||
} while (oldItemOn != itemOn && (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_SPACE);
|
||||
|
||||
M_UpdateMenuBGImage(false);
|
||||
M_FlipKartGamemodeMenu(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -717,6 +719,7 @@ void M_SetupNextMenu(menu_t *menudef, boolean notransition)
|
|||
else if (gamestate == GS_MENU)
|
||||
{
|
||||
menuwipe = true;
|
||||
M_FlipKartGamemodeMenu(false);
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
F_WipeEndScreen();
|
||||
|
|
@ -1139,30 +1142,36 @@ void M_Ticker(void)
|
|||
|
||||
// If dest is non-zero, we've started transition and want to switch menus
|
||||
// If dest is zero, we're mid-transition and want to end it
|
||||
if (menutransition.tics == menutransition.dest
|
||||
&& menutransition.endmenu != NULL
|
||||
&& currentMenu != menutransition.endmenu
|
||||
)
|
||||
if (menutransition.tics == menutransition.dest)
|
||||
{
|
||||
if (menutransition.startmenu->transitionID == menutransition.endmenu->transitionID
|
||||
&& menutransition.endmenu->transitionTics)
|
||||
if (menutransition.endmenu != NULL
|
||||
&& currentMenu != menutransition.endmenu)
|
||||
{
|
||||
menutransition.tics = menutransition.endmenu->transitionTics;
|
||||
menutransition.dest = 0;
|
||||
menutransition.in = true;
|
||||
if (menutransition.startmenu->transitionID == menutransition.endmenu->transitionID
|
||||
&& menutransition.endmenu->transitionTics)
|
||||
{
|
||||
menutransition.tics = menutransition.endmenu->transitionTics;
|
||||
menutransition.dest = 0;
|
||||
menutransition.in = true;
|
||||
}
|
||||
else if (gamestate == GS_MENU)
|
||||
{
|
||||
memset(&menutransition, 0, sizeof(menutransition));
|
||||
|
||||
menuwipe = true;
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipe_menu_toblack, wipedefs[wipe_menu_toblack], false, "FADEMAP0", false, false);
|
||||
}
|
||||
|
||||
M_SetupNextMenu(menutransition.endmenu, true);
|
||||
}
|
||||
else if (gamestate == GS_MENU)
|
||||
else
|
||||
{
|
||||
memset(&menutransition, 0, sizeof(menutransition));
|
||||
|
||||
menuwipe = true;
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipe_menu_toblack, wipedefs[wipe_menu_toblack], false, "FADEMAP0", false, false);
|
||||
// Menu is done transitioning in
|
||||
M_FlipKartGamemodeMenu(true);
|
||||
}
|
||||
|
||||
M_SetupNextMenu(menutransition.endmenu, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue