Fix race number in the menu during a championship or career.

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@2637 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 557daed176780c83e8c123ee0db4b9e3ea743cef
Former-commit-id: 8021fb8df026ba552d0b2fa186a4ac99388eba37
This commit is contained in:
martkelder 2010-08-09 15:08:35 +00:00
parent 509327eb1e
commit b8add54f95

View file

@ -377,6 +377,15 @@ ReNewTrackMenu(void)
int titleId = CreateLabelControl(newTrackMenuHdle, menuXMLDescHdle, "titlelabel");
GfuiLabelSetText(newTrackMenuHdle, titleId, str);
// Calculate which race of the series this is
raceNumber = 1;
for (xx = 1; xx < (int)GfParmGetNum(results, RE_SECT_CURRENT, RE_ATTR_CUR_TRACK, NULL, 1); ++xx)
{
sprintf(buf, "%s/%d", RM_SECT_TRACKS, xx);
if (!strcmp( GfParmGetStr(ReInfo->params, buf, RM_ATTR_NAME, "free"), "free") == 0)
++raceNumber;
}
// Create variable subtitle label from race params.
sprintf(buf, "Race Day #%d/%d on %s",
raceNumber,