From b3b058aeee10893c0cee3d84b9645b43c060ff9c Mon Sep 17 00:00:00 2001 From: pouillot Date: Mon, 12 Mar 2012 22:37:06 +0000 Subject: [PATCH] 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 --- .../legacymenu/racescreens/racepitmenu.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/userinterface/legacymenu/racescreens/racepitmenu.cpp b/src/modules/userinterface/legacymenu/racescreens/racepitmenu.cpp index d49c26467..b259783f3 100644 --- a/src/modules/userinterface/legacymenu/racescreens/racepitmenu.cpp +++ b/src/modules/userinterface/legacymenu/racescreens/racepitmenu.cpp @@ -118,19 +118,21 @@ RmPitMenuStart(tCarElt *car, tSituation *s, tfuiCallback callback) GfuiLabelSetText(menuHandle, titleId, buf); // Create labels for remaining laps and remaining fuel. - int remainLapsId = GfuiMenuCreateLabelControl(menuHandle, menuXMLDescHdle, "remaininglapslabel"); - if( s->_totTime > 0 && s->_totTime > s->currentTime ) /* Timed part of the timed session */ + int remainLapsTimeId = GfuiMenuCreateLabelControl(menuHandle, menuXMLDescHdle, "remaininglapstimelabel"); + if( s->_totTime > 0 && s->_totTime > s->currentTime ) // Timed part of the timed session { + GfuiMenuCreateLabelControl(menuHandle, menuXMLDescHdle, "remainingtimelabel"); if( s->_extraLaps > 0) 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 ) ); } else { + GfuiMenuCreateLabelControl(menuHandle, menuXMLDescHdle, "remaininglapslabel"); 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"); snprintf(buf, sizeof(buf), "%.1f", car->_fuel);