M_BuildConditionTitle: Support menuttl

Example for menuttl "Controls":
- For Tutorial levels, show "The Controls Tutorial"
- Otherwise, show "CONTROLS" (allcaps)
This commit is contained in:
toaster 2023-10-11 17:24:50 +01:00
parent 2cc796a042
commit 71a95b3096

View file

@ -1397,7 +1397,19 @@ static char *M_BuildConditionTitle(UINT16 map)
|| M_MapLocked(map+1))
return Z_StrDup("???");
title = ref = G_BuildMapTitle(map+1);
if (mapheaderinfo[map]->menuttl[0])
{
if (mapheaderinfo[map]->typeoflevel & TOL_TUTORIAL)
{
// Intentionally not forced uppercase
return Z_StrDup(va("the %s Tutorial", mapheaderinfo[map]->menuttl));
}
title = ref = Z_StrDup(mapheaderinfo[map]->menuttl);
}
else
{
title = ref = G_BuildMapTitle(map+1);
}
if (!title)
I_Error("M_BuildConditionTitle: out of memory");