mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Menus/Character Select: interpolate Profile selection
This commit is contained in:
parent
7d35c0db4b
commit
30e94d81fe
3 changed files with 26 additions and 3 deletions
|
|
@ -715,6 +715,7 @@ struct setup_player_t
|
||||||
{
|
{
|
||||||
SINT8 gridx, gridy;
|
SINT8 gridx, gridy;
|
||||||
UINT8 profilen;
|
UINT8 profilen;
|
||||||
|
menu_anim_t profilen_slide;
|
||||||
INT16 skin;
|
INT16 skin;
|
||||||
SINT8 clonenum;
|
SINT8 clonenum;
|
||||||
SINT8 rotate;
|
SINT8 rotate;
|
||||||
|
|
|
||||||
|
|
@ -1930,12 +1930,20 @@ static void M_DrawCharSelectPreview(UINT8 num)
|
||||||
if (p->mdepth == CSSTEP_PROFILE)
|
if (p->mdepth == CSSTEP_PROFILE)
|
||||||
{
|
{
|
||||||
INT16 px = x+12;
|
INT16 px = x+12;
|
||||||
INT16 py = y+48 - p->profilen*12;
|
INT16 py = y+48 - p->profilen*12 +
|
||||||
|
Easing_OutSine(
|
||||||
|
M_DueFrac(p->profilen_slide.start, 5),
|
||||||
|
p->profilen_slide.dist*12,
|
||||||
|
0
|
||||||
|
);
|
||||||
UINT8 maxp = PR_GetNumProfiles();
|
UINT8 maxp = PR_GetNumProfiles();
|
||||||
|
|
||||||
UINT8 i = 0;
|
UINT8 i = 0;
|
||||||
UINT8 j;
|
UINT8 j;
|
||||||
|
|
||||||
|
V_SetClipRect(0, (y+25)*FRACUNIT, BASEVIDWIDTH*FRACUNIT, (5*12)*FRACUNIT, 0);
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < maxp; i++)
|
for (i = 0; i < maxp; i++)
|
||||||
{
|
{
|
||||||
profile_t *pr = PR_GetProfile(i);
|
profile_t *pr = PR_GetProfile(i);
|
||||||
|
|
@ -1961,13 +1969,13 @@ static void M_DrawCharSelectPreview(UINT8 num)
|
||||||
notSelectable |= V_TRANSLUCENT;
|
notSelectable |= V_TRANSLUCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dist > 2)
|
if (dist > 3)
|
||||||
{
|
{
|
||||||
py += 12;
|
py += 12;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dist == 2)
|
if (dist > 1)
|
||||||
{
|
{
|
||||||
V_DrawCenteredFileString(px+26, py, notSelectable, pr->version ? pr->profilename : "NEW");
|
V_DrawCenteredFileString(px+26, py, notSelectable, pr->version ? pr->profilename : "NEW");
|
||||||
V_DrawScaledPatch(px, py, V_TRANSLUCENT, W_CachePatchName("FILEBACK", PU_CACHE));
|
V_DrawScaledPatch(px, py, V_TRANSLUCENT, W_CachePatchName("FILEBACK", PU_CACHE));
|
||||||
|
|
@ -1984,6 +1992,7 @@ static void M_DrawCharSelectPreview(UINT8 num)
|
||||||
py += 12;
|
py += 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
V_ClearClipRect();
|
||||||
}
|
}
|
||||||
// "Changes?"
|
// "Changes?"
|
||||||
else if (p->mdepth == CSSTEP_ASKCHANGES)
|
else if (p->mdepth == CSSTEP_ASKCHANGES)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
/// \file menus/play-char-select.c
|
/// \file menus/play-char-select.c
|
||||||
/// \brief Character Select
|
/// \brief Character Select
|
||||||
|
|
||||||
|
#include "../i_time.h"
|
||||||
#include "../k_menu.h"
|
#include "../k_menu.h"
|
||||||
#include "../r_skins.h"
|
#include "../r_skins.h"
|
||||||
#include "../s_sound.h"
|
#include "../s_sound.h"
|
||||||
|
|
@ -278,6 +279,9 @@ void M_CharacterSelectInit(void)
|
||||||
setup_player[i].followercategory = -1;
|
setup_player[i].followercategory = -1;
|
||||||
setup_player[i].followercolor = SKINCOLOR_NONE;
|
setup_player[i].followercolor = SKINCOLOR_NONE;
|
||||||
|
|
||||||
|
setup_player[i].profilen_slide.start = 0;
|
||||||
|
setup_player[i].profilen_slide.dist = 0;
|
||||||
|
|
||||||
// If we're on prpfile select, skip straight to CSSTEP_CHARS
|
// If we're on prpfile select, skip straight to CSSTEP_CHARS
|
||||||
// do the same if we're midgame, but make sure to consider splitscreen properly.
|
// do the same if we're midgame, but make sure to consider splitscreen properly.
|
||||||
if (optionsmenu.profile && i == 0)
|
if (optionsmenu.profile && i == 0)
|
||||||
|
|
@ -525,19 +529,25 @@ static boolean M_HandleCSelectProfile(setup_player_t *p, UINT8 num)
|
||||||
|
|
||||||
if (menucmd[num].dpad_ud > 0)
|
if (menucmd[num].dpad_ud > 0)
|
||||||
{
|
{
|
||||||
|
UINT8 oldn = p->profilen;
|
||||||
p->profilen++;
|
p->profilen++;
|
||||||
if (p->profilen > maxp)
|
if (p->profilen > maxp)
|
||||||
p->profilen = 0;
|
p->profilen = 0;
|
||||||
|
p->profilen_slide.dist = p->profilen - oldn;
|
||||||
|
p->profilen_slide.start = I_GetTime();
|
||||||
|
|
||||||
S_StartSound(NULL, sfx_s3k5b);
|
S_StartSound(NULL, sfx_s3k5b);
|
||||||
M_SetMenuDelay(num);
|
M_SetMenuDelay(num);
|
||||||
}
|
}
|
||||||
else if (menucmd[num].dpad_ud < 0)
|
else if (menucmd[num].dpad_ud < 0)
|
||||||
{
|
{
|
||||||
|
UINT8 oldn = p->profilen;
|
||||||
if (p->profilen == 0)
|
if (p->profilen == 0)
|
||||||
p->profilen = maxp;
|
p->profilen = maxp;
|
||||||
else
|
else
|
||||||
p->profilen--;
|
p->profilen--;
|
||||||
|
p->profilen_slide.dist = p->profilen - oldn;
|
||||||
|
p->profilen_slide.start = I_GetTime();
|
||||||
|
|
||||||
S_StartSound(NULL, sfx_s3k5b);
|
S_StartSound(NULL, sfx_s3k5b);
|
||||||
M_SetMenuDelay(num);
|
M_SetMenuDelay(num);
|
||||||
|
|
@ -616,11 +626,14 @@ static boolean M_HandleCSelectProfile(setup_player_t *p, UINT8 num)
|
||||||
}
|
}
|
||||||
else if (M_MenuExtraPressed(num))
|
else if (M_MenuExtraPressed(num))
|
||||||
{
|
{
|
||||||
|
UINT8 oldn = p->profilen;
|
||||||
UINT8 yourprofile = min(cv_lastprofile[realnum].value, PR_GetNumProfiles());
|
UINT8 yourprofile = min(cv_lastprofile[realnum].value, PR_GetNumProfiles());
|
||||||
if (p->profilen == yourprofile)
|
if (p->profilen == yourprofile)
|
||||||
p->profilen = PROFILE_GUEST;
|
p->profilen = PROFILE_GUEST;
|
||||||
else
|
else
|
||||||
p->profilen = yourprofile;
|
p->profilen = yourprofile;
|
||||||
|
p->profilen_slide.dist = p->profilen - oldn;
|
||||||
|
p->profilen_slide.start = I_GetTime();
|
||||||
S_StartSound(NULL, sfx_s3k7b); //sfx_s3kc3s
|
S_StartSound(NULL, sfx_s3k7b); //sfx_s3kc3s
|
||||||
M_SetMenuDelay(num);
|
M_SetMenuDelay(num);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue