diff --git a/src/k_menu.h b/src/k_menu.h index 9260acb92..94a50b438 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -715,6 +715,7 @@ struct setup_player_t { SINT8 gridx, gridy; UINT8 profilen; + menu_anim_t profilen_slide; INT16 skin; SINT8 clonenum; SINT8 rotate; diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 290d367d8..32b56d9eb 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -1930,12 +1930,20 @@ static void M_DrawCharSelectPreview(UINT8 num) if (p->mdepth == CSSTEP_PROFILE) { 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 i = 0; UINT8 j; + V_SetClipRect(0, (y+25)*FRACUNIT, BASEVIDWIDTH*FRACUNIT, (5*12)*FRACUNIT, 0); + + for (i = 0; i < maxp; i++) { profile_t *pr = PR_GetProfile(i); @@ -1961,13 +1969,13 @@ static void M_DrawCharSelectPreview(UINT8 num) notSelectable |= V_TRANSLUCENT; } - if (dist > 2) + if (dist > 3) { py += 12; continue; } - if (dist == 2) + if (dist > 1) { V_DrawCenteredFileString(px+26, py, notSelectable, pr->version ? pr->profilename : "NEW"); V_DrawScaledPatch(px, py, V_TRANSLUCENT, W_CachePatchName("FILEBACK", PU_CACHE)); @@ -1984,6 +1992,7 @@ static void M_DrawCharSelectPreview(UINT8 num) py += 12; } + V_ClearClipRect(); } // "Changes?" else if (p->mdepth == CSSTEP_ASKCHANGES) diff --git a/src/menus/play-char-select.c b/src/menus/play-char-select.c index 58fbf3a56..bca665395 100644 --- a/src/menus/play-char-select.c +++ b/src/menus/play-char-select.c @@ -1,6 +1,7 @@ /// \file menus/play-char-select.c /// \brief Character Select +#include "../i_time.h" #include "../k_menu.h" #include "../r_skins.h" #include "../s_sound.h" @@ -278,6 +279,9 @@ void M_CharacterSelectInit(void) setup_player[i].followercategory = -1; 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 // do the same if we're midgame, but make sure to consider splitscreen properly. 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) { + UINT8 oldn = p->profilen; p->profilen++; if (p->profilen > maxp) p->profilen = 0; + p->profilen_slide.dist = p->profilen - oldn; + p->profilen_slide.start = I_GetTime(); S_StartSound(NULL, sfx_s3k5b); M_SetMenuDelay(num); } else if (menucmd[num].dpad_ud < 0) { + UINT8 oldn = p->profilen; if (p->profilen == 0) p->profilen = maxp; else p->profilen--; + p->profilen_slide.dist = p->profilen - oldn; + p->profilen_slide.start = I_GetTime(); S_StartSound(NULL, sfx_s3k5b); M_SetMenuDelay(num); @@ -616,11 +626,14 @@ static boolean M_HandleCSelectProfile(setup_player_t *p, UINT8 num) } else if (M_MenuExtraPressed(num)) { + UINT8 oldn = p->profilen; UINT8 yourprofile = min(cv_lastprofile[realnum].value, PR_GetNumProfiles()); if (p->profilen == yourprofile) p->profilen = PROFILE_GUEST; else p->profilen = yourprofile; + p->profilen_slide.dist = p->profilen - oldn; + p->profilen_slide.start = I_GetTime(); S_StartSound(NULL, sfx_s3k7b); //sfx_s3kc3s M_SetMenuDelay(num); }