mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Menus/Cup Grid: stagger cursor movement
This commit is contained in:
parent
6ac24cf3f4
commit
1c2ed2b306
3 changed files with 27 additions and 2 deletions
|
|
@ -785,9 +785,11 @@ void M_SetupGametypeMenu(INT32 choice);
|
|||
void M_SetupRaceMenu(INT32 choice);
|
||||
|
||||
#define CUPMENU_CURSORID (cupgrid.x + (cupgrid.y * CUPMENU_COLUMNS) + (cupgrid.pageno * (CUPMENU_COLUMNS * CUPMENU_ROWS)))
|
||||
#define CUPMENU_SLIDETIME 3
|
||||
|
||||
extern struct cupgrid_s {
|
||||
SINT8 x, y;
|
||||
menu_anim_t xslide, yslide;
|
||||
size_t pageno;
|
||||
cupheader_t **builtgrid;
|
||||
size_t numpages;
|
||||
|
|
|
|||
|
|
@ -3073,8 +3073,14 @@ void M_DrawCupSelect(void)
|
|||
}
|
||||
}
|
||||
|
||||
x = 14 + (cupgrid.x*42);
|
||||
y = 20 + (cupgrid.y*44) - (30*menutransition.tics);
|
||||
{
|
||||
fixed_t tx = Easing_Linear(M_DueFrac(cupgrid.xslide.start, CUPMENU_SLIDETIME), cupgrid.xslide.dist * FRACUNIT, 0);
|
||||
fixed_t ty = Easing_Linear(M_DueFrac(cupgrid.yslide.start, CUPMENU_SLIDETIME), cupgrid.yslide.dist * FRACUNIT, 0);
|
||||
|
||||
x = 14 + (cupgrid.x*42*FRACUNIT - tx) / FRACUNIT;
|
||||
y = 20 + (cupgrid.y*44*FRACUNIT - ty) / FRACUNIT - cy;
|
||||
}
|
||||
|
||||
if (cupgrid.cache_secondrowlocked == true)
|
||||
y += 28;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/// \file menus/transient/cup-select.c
|
||||
/// \brief Cup Select
|
||||
|
||||
#include "../../i_time.h"
|
||||
#include "../../k_menu.h"
|
||||
#include "../../s_sound.h"
|
||||
#include "../../f_finale.h" // F_WipeStartScreen
|
||||
|
|
@ -197,6 +198,8 @@ void M_CupSelectHandler(INT32 choice)
|
|||
if (cupgrid.pageno >= cupgrid.numpages)
|
||||
cupgrid.pageno = 0;
|
||||
}
|
||||
cupgrid.xslide.start = I_GetTime();
|
||||
cupgrid.xslide.dist = 42;
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
M_SetMenuDelay(pid);
|
||||
}
|
||||
|
|
@ -211,6 +214,8 @@ void M_CupSelectHandler(INT32 choice)
|
|||
else
|
||||
cupgrid.pageno--;
|
||||
}
|
||||
cupgrid.xslide.start = I_GetTime();
|
||||
cupgrid.xslide.dist = -42;
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
M_SetMenuDelay(pid);
|
||||
}
|
||||
|
|
@ -221,7 +226,13 @@ void M_CupSelectHandler(INT32 choice)
|
|||
{
|
||||
cupgrid.y++;
|
||||
if (cupgrid.y >= CUPMENU_ROWS)
|
||||
{
|
||||
cupgrid.y = 0;
|
||||
cupgrid.yslide.dist = 8;
|
||||
}
|
||||
else
|
||||
cupgrid.yslide.dist = 44;
|
||||
cupgrid.yslide.start = I_GetTime();
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
M_SetMenuDelay(pid);
|
||||
}
|
||||
|
|
@ -229,7 +240,13 @@ void M_CupSelectHandler(INT32 choice)
|
|||
{
|
||||
cupgrid.y--;
|
||||
if (cupgrid.y < 0)
|
||||
{
|
||||
cupgrid.y = CUPMENU_ROWS-1;
|
||||
cupgrid.yslide.dist = -8;
|
||||
}
|
||||
else
|
||||
cupgrid.yslide.dist = -44;
|
||||
cupgrid.yslide.start = I_GetTime();
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
M_SetMenuDelay(pid);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue