Cup Select preview: Draw Spray Can (+ Ancient Shrine) list in Match Race

Expansion of previously implemented UI for Time Attack, but for showing gotten cans/shrines only.

Also:
- Halved flicker rate for SPB attack medals
- Made invalid cups not display Lost & Found's associated medals OR cans/shrines
This commit is contained in:
toaster 2025-02-20 22:32:22 +00:00
parent beacbca72a
commit 89afe780df

View file

@ -3277,7 +3277,7 @@ void M_DrawCupSelect(void)
M_DrawCupTitle(120 - ty, &templevelsearch); M_DrawCupTitle(120 - ty, &templevelsearch);
if (templevelsearch.timeattack) if (templevelsearch.grandprix == false && templevelsearch.cup != NULL)
{ {
if (templevelsearch.cup != &dummy_lostandfound) if (templevelsearch.cup != &dummy_lostandfound)
{ {
@ -3291,24 +3291,35 @@ void M_DrawCupSelect(void)
// be violated by the long tail of modding. To those // be violated by the long tail of modding. To those
// finding this eventually: I'M SORRY ~toast 221024 // finding this eventually: I'M SORRY ~toast 221024
emblem_t *medal_array[CUPCACHE_MAX]; struct work_array_t {
emblem_t *medal;
UINT16 col;
UINT8 mapvisited;
} work_array[CUPCACHE_MAX];
boolean incj = false;
boolean showalternate = (skullAnimCounter & 4);
i = j = 0; i = j = 0;
INT16 map = M_GetFirstLevelInList(&i, &templevelsearch); INT16 map = M_GetFirstLevelInList(&i, &templevelsearch);
emblem_t *emblem = NULL; emblem_t *emblem = NULL;
boolean incj;
while (map < nummapheaders && j < CUPCACHE_MAX) while (map < nummapheaders && j < CUPCACHE_MAX)
{ {
if (map < basenummapheaders) if (map < basenummapheaders)
{ {
emblem = M_GetLevelEmblems(map+1); emblem = NULL;
medal_array[j] = NULL;
incj = false; incj = false;
work_array[j].medal = NULL;
work_array[j].col = UINT16_MAX;
work_array[j].mapvisited = 0;
if (templevelsearch.timeattack)
{
emblem = M_GetLevelEmblems(map+1);
while (emblem) while (emblem)
{ {
if (emblem->type == ET_TIME) if (emblem->type == ET_TIME)
@ -3317,14 +3328,14 @@ void M_DrawCupSelect(void)
if (gamedata->collected[emblem-emblemlocations]) if (gamedata->collected[emblem-emblemlocations])
{ {
if (!medal_array[j] if (!work_array[j].medal
|| ( || (
(medal_array[j]->type == ET_TIME) (work_array[j].medal->type == ET_TIME)
&& (medal_array[j]->tag < emblem->tag) && (work_array[j].medal->tag < emblem->tag)
) )
) )
{ {
medal_array[j] = emblem; work_array[j].medal = emblem;
} }
} }
} }
@ -3334,14 +3345,30 @@ void M_DrawCupSelect(void)
incj = true; incj = true;
if ((gamedata->collected[emblem-emblemlocations]) if ((gamedata->collected[emblem-emblemlocations])
&& (skullAnimCounter & 2)) && showalternate)
{ {
medal_array[j] = emblem; work_array[j].medal = emblem;
} }
} }
emblem = M_GetLevelEmblems(-1); emblem = M_GetLevelEmblems(-1);
} }
}
else
{
if (mapheaderinfo[map]->cache_spraycan < gamedata->numspraycans)
{
work_array[j].col = gamedata->spraycans[mapheaderinfo[map]->cache_spraycan].col;
incj = true;
}
if ((mapheaderinfo[map]->records.mapvisited & MV_MYSTICMELODY)
&& (incj == false || showalternate))
{
work_array[j].mapvisited |= MV_MYSTICMELODY;
incj = true;
}
}
if (incj) if (incj)
j++; j++;
@ -3365,10 +3392,19 @@ void M_DrawCupSelect(void)
for (i = 0; i < j; i++) for (i = 0; i < j; i++)
{ {
if (medal_array[i]) if (work_array[i].medal)
{ {
V_DrawMappedPatch(x, y, 0, W_CachePatchName(M_GetEmblemPatch(medal_array[i], false), PU_CACHE), V_DrawMappedPatch(x, y, 0, W_CachePatchName(M_GetEmblemPatch(work_array[i].medal, false), PU_CACHE),
R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(medal_array[i]), GTC_MENUCACHE)); R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(work_array[i].medal), GTC_MENUCACHE));
}
else if (work_array[i].mapvisited & MV_MYSTICMELODY)
{
V_DrawScaledPatch(x, y, 0, W_CachePatchName("GOTMEL", PU_CACHE));
}
else if (work_array[i].col < numskincolors)
{
V_DrawMappedPatch(x, y, 0, W_CachePatchName("GOTCAN", PU_CACHE),
R_GetTranslationColormap(TC_DEFAULT, work_array[i].col, GTC_MENUCACHE));
} }
else else
{ {