Merge branch 'interp-challenges-scrolling' into 'master'

Interpolate scrolling on Challenge Board

See merge request KartKrew/Kart!1782
This commit is contained in:
AJ Martinez 2024-01-04 22:21:45 +00:00
commit fe416626a5
3 changed files with 14 additions and 0 deletions

View file

@ -1320,6 +1320,7 @@ extern struct challengesmenu_s {
tic_t ticker; // How long the menu's been open for
INT16 offset; // To make the icons move smoothly when we transition!
menu_anim_t move;
UINT16 currentunlock;
char *unlockcondition;

View file

@ -6865,6 +6865,8 @@ void M_DrawChallenges(void)
x += challengesmenu.offset;
x += Easing_OutQuad(M_DueFrac(challengesmenu.move.start, 4), challengesgridstep * challengesmenu.move.dist, 0);
if (challengegridloops)
{
if (!challengesmenu.col && challengesmenu.hilix)

View file

@ -1,6 +1,7 @@
/// \file menus/extras-challenges.c
/// \brief Challenges.
#include "../i_time.h"
#include "../k_menu.h"
#include "../m_cond.h" // Condition Sets
#include "../m_random.h" // And just some randomness for the exits.
@ -882,6 +883,11 @@ boolean M_ChallengesInputs(INT32 ch)
{
challengesmenu.focusx--;
}
else
{
challengesmenu.move.dist = 1;
challengesmenu.move.start = I_GetTime();
}
// Step the actual column right.
if (challengesmenu.col < gamedata->challengegridwidth-1)
@ -919,6 +925,11 @@ boolean M_ChallengesInputs(INT32 ch)
{
challengesmenu.focusx++;
}
else
{
challengesmenu.move.dist = -1;
challengesmenu.move.start = I_GetTime();
}
// Step the actual column left.
if (challengesmenu.col > 0)