QTfrontend/game.cpp
branchwebgl
changeset 9521 8054d9d775fd
parent 9197 e4e366013e9a
parent 9466 8b48c27201af
child 9950 2759212a27de
--- a/QTfrontend/game.cpp	Fri Oct 11 11:55:31 2013 +0200
+++ b/QTfrontend/game.cpp	Fri Oct 11 17:43:13 2013 +0200
@@ -17,6 +17,7 @@
  */
 
 #include <QString>
+#include <QCheckBox>
 #include <QByteArray>
 #include <QUuid>
 #include <QColor>
@@ -88,18 +89,6 @@
     SetGameState(gsStopped);
 }
 
-void HWGame::addKeyBindings(QByteArray * buf)
-{
-    for(int i = 0; i < BINDS_NUMBER; i++)
-    {
-        QString value = config->value(QString("Binds/%1").arg(cbinds[i].action), cbinds[i].strbind).toString();
-        if (value.isEmpty() || value == "default") continue;
-
-        QString bind = QString("edbind " + value + " " + cbinds[i].action);
-        HWProto::addStringToBuffer(*buf, bind);
-    }
-}
-
 void HWGame::commonConfig()
 {
     QByteArray buf;
@@ -117,8 +106,6 @@
     }
     HWProto::addStringToBuffer(buf, gt);
 
-    addKeyBindings(&buf);
-
     buf += gamecfg->getFullConfig();
 
     if (m_pTeamSelWidget)
@@ -131,7 +118,7 @@
             HWProto::addStringToBuffer(buf, QString("eammreinf %1").arg(ammostr.mid(3 * cAmmoNumber, cAmmoNumber)));
             if(gamecfg->schemeData(15).toBool() || !gamecfg->schemeData(21).toBool()) HWProto::addStringToBuffer(buf, QString("eammstore"));
             HWProto::addStringListToBuffer(buf,
-                                           team.teamGameConfig(gamecfg->getInitHealth(), config));
+                                           team.teamGameConfig(gamecfg->getInitHealth()));
             ;
         }
     }
@@ -149,8 +136,6 @@
     QByteArray teamscfg;
     ThemeModel * themeModel = DataManager::instance().themeModel();
 
-    addKeyBindings(&teamscfg);
-
     HWProto::addStringToBuffer(teamscfg, "TL");
     HWProto::addStringToBuffer(teamscfg, QString("etheme %1")
                                .arg((themeModel->rowCount() > 0) ? themeModel->index(rand() % themeModel->rowCount()).data(ThemeModel::ActualNameRole).toString() : "steel"));
@@ -164,7 +149,7 @@
     team1.setNumHedgehogs(4);
     HWNamegen::teamRandomNames(team1,true);
     HWProto::addStringListToBuffer(teamscfg,
-                                   team1.teamGameConfig(100, config));
+                                   team1.teamGameConfig(100));
 
     HWTeam team2;
     team2.setDifficulty(4);
@@ -174,7 +159,7 @@
         HWNamegen::teamRandomNames(team2,true);
     while(!team2.name().compare(team1.name()) || !team2.hedgehog(0).Hat.compare(team1.hedgehog(0).Hat));
     HWProto::addStringListToBuffer(teamscfg,
-                                   team2.teamGameConfig(100, config));
+                                   team2.teamGameConfig(100));
 
     HWProto::addStringToBuffer(teamscfg, QString("eammloadt %1").arg(cDefaultAmmoStore->mid(0, cAmmoNumber)));
     HWProto::addStringToBuffer(teamscfg, QString("eammprob %1").arg(cDefaultAmmoStore->mid(cAmmoNumber, cAmmoNumber)));
@@ -193,8 +178,6 @@
     HWProto::addStringToBuffer(traincfg, "eseed " + QUuid::createUuid().toString());
     HWProto::addStringToBuffer(traincfg, "escript " + training);
 
-    addKeyBindings(&traincfg);
-
     RawSendIPC(traincfg);
 }
 
@@ -206,8 +189,6 @@
 
     HWProto::addStringToBuffer(campaigncfg, "escript " + campaignScript);
 
-    addKeyBindings(&campaigncfg);
-
     RawSendIPC(campaigncfg);
 }
 
@@ -415,6 +396,15 @@
         arguments << nick;
     }
 
+    if (!config->Form->ui.pageOptions->CBTeamTag->isChecked())
+        arguments << "--no-teamtag";
+    if (!config->Form->ui.pageOptions->CBHogTag->isChecked())
+        arguments << "--no-hogtag";
+    if (!config->Form->ui.pageOptions->CBHealthTag->isChecked())
+        arguments << "--no-healthtag";
+    if (config->Form->ui.pageOptions->CBTagOpacity->isChecked())
+        arguments << "--translucent-tags";
+
     return arguments;
 }