Fixes #635 Improved pit menu labels and #636 Pit menu labels when timed session + improved tips

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

Former-commit-id: 6d3d23c29fd7876cee275c64c835235024ff8d5b
Former-commit-id: 7c1597e9eb52ee45811d58917d2a5510ab3665b9
This commit is contained in:
pouillot 2012-03-12 22:37:06 +00:00
parent 85d664d980
commit b3b058aeee

View file

@ -118,19 +118,21 @@ RmPitMenuStart(tCarElt *car, tSituation *s, tfuiCallback callback)
GfuiLabelSetText(menuHandle, titleId, buf); GfuiLabelSetText(menuHandle, titleId, buf);
// Create labels for remaining laps and remaining fuel. // Create labels for remaining laps and remaining fuel.
int remainLapsId = GfuiMenuCreateLabelControl(menuHandle, menuXMLDescHdle, "remaininglapslabel"); int remainLapsTimeId = GfuiMenuCreateLabelControl(menuHandle, menuXMLDescHdle, "remaininglapstimelabel");
if( s->_totTime > 0 && s->_totTime > s->currentTime ) /* Timed part of the timed session */ if( s->_totTime > 0 && s->_totTime > s->currentTime ) // Timed part of the timed session
{ {
GfuiMenuCreateLabelControl(menuHandle, menuXMLDescHdle, "remainingtimelabel");
if( s->_extraLaps > 0) if( s->_extraLaps > 0)
snprintf(buf, sizeof(buf), "%s + %d laps", GfTime2Str( s->_totTime - s->currentTime, NULL, true, 0 ), s->_extraLaps); snprintf(buf, sizeof(buf), "%s + %d laps", GfTime2Str( s->_totTime - s->currentTime, NULL, true, 0 ), s->_extraLaps);
else else
snprintf(buf, sizeof(buf), "%s", GfTime2Str( s->_totTime - s->currentTime, NULL, true, 0 ) ); snprintf(buf, sizeof(buf), "%s", GfTime2Str( s->_totTime - s->currentTime, NULL, true, 0 ) );
} }
else else
{ {
GfuiMenuCreateLabelControl(menuHandle, menuXMLDescHdle, "remaininglapslabel");
snprintf(buf, sizeof(buf), "%d", car->_remainingLaps); //Laps tot drive to win the race snprintf(buf, sizeof(buf), "%d", car->_remainingLaps); //Laps tot drive to win the race
} }
GfuiLabelSetText(menuHandle, remainLapsId, buf); GfuiLabelSetText(menuHandle, remainLapsTimeId, buf);
int remainFuelId = GfuiMenuCreateLabelControl(menuHandle, menuXMLDescHdle, "remainingfuellabel"); int remainFuelId = GfuiMenuCreateLabelControl(menuHandle, menuXMLDescHdle, "remainingfuellabel");
snprintf(buf, sizeof(buf), "%.1f", car->_fuel); snprintf(buf, sizeof(buf), "%.1f", car->_fuel);