# HG changeset patch # User Periklis Ntanasis # Date 1370729938 -10800 # Node ID d5e98b81e13528f28429017690868d5936651738 # Parent c21c88dca14cb22a741a68c5503392b6438888cc fix non changing graph title and sendstat health diff -r c21c88dca14c -r d5e98b81e135 QTfrontend/ui/page/pagegamestats.cpp --- a/QTfrontend/ui/page/pagegamestats.cpp Sat Jun 08 23:54:44 2013 +0300 +++ b/QTfrontend/ui/page/pagegamestats.cpp Sun Jun 09 01:18:58 2013 +0300 @@ -40,6 +40,7 @@ QLayout * PageGameStats::bodyLayoutDefinition() { + defaultGraphTitle = true; QGridLayout * pageLayout = new QGridLayout(); pageLayout->setSpacing(20); pageLayout->setColumnStretch(0, 1); @@ -159,12 +160,16 @@ { graphic->show(); labelGraphTitle-> show(); + if(defaultGraphTitle) { + labelGraphTitle->setText("

" + PageGameStats::tr("Health graph") + "

"); + } else { + defaultGraphTitle = true; + } // if not health data sent if(healthPoints.size() == 0) { labelGraphTitle->hide(); graphic->hide(); } else { - labelGraphTitle->setText("

" + PageGameStats::tr("Health graph") + "

"); QGraphicsScene * scene = new QGraphicsScene(); QMap >::const_iterator i = healthPoints.constBegin(); @@ -232,6 +237,7 @@ case 'g' : { // TODO: change default picture or add change pic capability + defaultGraphTitle = false; labelGraphTitle->setText("

" + info + "

"); break; } diff -r c21c88dca14c -r d5e98b81e135 QTfrontend/ui/page/pagegamestats.h --- a/QTfrontend/ui/page/pagegamestats.h Sat Jun 08 23:54:44 2013 +0300 +++ b/QTfrontend/ui/page/pagegamestats.h Sun Jun 09 01:18:58 2013 +0300 @@ -68,6 +68,7 @@ QMap > healthPoints; unsigned int playerPosition; quint32 lastColor; + bool defaultGraphTitle; protected: QLayout * bodyLayoutDefinition(); diff -r c21c88dca14c -r d5e98b81e135 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Sat Jun 08 23:54:44 2013 +0300 +++ b/hedgewars/uScript.pas Sun Jun 09 01:18:58 2013 +0300 @@ -1294,7 +1294,7 @@ //TODO print better error messages statInfo := TStatInfoType(GetEnumValue(TypeInfo(TStatInfoType),lua_tostring(L, 1))); if (lua_gettop(L) <> 2) and ((statInfo <> siPlayerKills) - or (statInfo <> siClanHealth)) then + and (statInfo <> siClanHealth)) then begin LuaError('Lua: Wrong number of parameters passed to SendStat!'); end