hook up to frontend
authornemo
Sat, 14 Feb 2015 22:25:31 -0500
changeset 10822 def423815f24
parent 10820 e86ba0e821a6
child 10824 acbbd49f8274
hook up to frontend
QTfrontend/model/ammoSchemeModel.cpp
QTfrontend/ui/page/pagescheme.cpp
QTfrontend/ui/page/pagescheme.h
QTfrontend/ui/widget/gamecfgwidget.cpp
hedgewars/uCommandHandlers.pas
hedgewars/uGearsHandlersMess.pas
--- a/QTfrontend/model/ammoSchemeModel.cpp	Sat Feb 14 17:47:28 2015 -0500
+++ b/QTfrontend/model/ammoSchemeModel.cpp	Sat Feb 14 22:25:31 2015 -0500
@@ -58,14 +58,15 @@
                                 << QVariant(4)             // mines number   32
                                 << QVariant(0)             // mine dud pct   33
                                 << QVariant(2)             // explosives     34
-                                << QVariant(35)            // health case pct 35
-                                << QVariant(25)            // health case amt 36
-                                << QVariant(47)            // water rise amt 37
-                                << QVariant(5)             // health dec amt 38
-                                << QVariant(100)           // rope modfier   39
-                                << QVariant(100)           // get away time  40
-                                << QVariant(0)             // world edge     41
-                                << QVariant()              // scriptparam    42
+                                << QVariant(0)             // air mines      35
+                                << QVariant(35)            // health case pct 36
+                                << QVariant(25)            // health case amt 37
+                                << QVariant(47)            // water rise amt 38
+                                << QVariant(5)             // health dec amt 39
+                                << QVariant(100)           // rope modfier   40
+                                << QVariant(100)           // get away time  41
+                                << QVariant(0)             // world edge     42
+                                << QVariant()              // scriptparam    43
                                 ;
 
 AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) :
@@ -125,14 +126,15 @@
               << "minesnum"            // 32
               << "minedudpct"          // 33
               << "explosives"          // 34
-              << "healthprobability"   // 35
-              << "healthcaseamount"    // 36
-              << "waterrise"           // 37
-              << "healthdecrease"      // 38
-              << "ropepct"             // 39
-              << "getawaytime"         // 40
-              << "worldedge"           // 41
-              << "scriptparam"         // scriptparam    42
+              << "airmines"            // 35
+              << "healthprobability"   // 36
+              << "healthcaseamount"    // 37
+              << "waterrise"           // 38
+              << "healthdecrease"      // 39
+              << "ropepct"             // 40
+              << "getawaytime"         // 41
+              << "worldedge"           // 42
+              << "scriptparam"         // scriptparam    43
               ;
 
     QList<QVariant> proMode;
@@ -172,14 +174,15 @@
             << QVariant(0)             // mines number   32
             << QVariant(0)             // mine dud pct   33
             << QVariant(2)             // explosives     34
-            << QVariant(35)            // health case pct 35
-            << QVariant(25)            // health case amt 36
-            << QVariant(47)            // water rise amt 37
-            << QVariant(5)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(0)             // air mines      35
+            << QVariant(35)            // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(47)            // water rise amt 38
+            << QVariant(5)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 
     QList<QVariant> shoppa;
@@ -219,14 +222,15 @@
             << QVariant(0)             // mines number   32
             << QVariant(0)             // mine dud pct   33
             << QVariant(0)             // explosives     34
-            << QVariant(0)             // health case pct 35
-            << QVariant(25)            // health case amt 36
-            << QVariant(47)            // water rise amt 37
-            << QVariant(5)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(8)             // air mines      35
+            << QVariant(0)             // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(47)            // water rise amt 38
+            << QVariant(5)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 
     QList<QVariant> cleanslate;
@@ -266,14 +270,15 @@
             << QVariant(4)             // mines number   32
             << QVariant(0)             // mine dud pct   33
             << QVariant(2)             // explosives     34
-            << QVariant(35)            // health case pct 35
-            << QVariant(25)            // health case amt 36
-            << QVariant(47)            // water rise amt 37
-            << QVariant(5)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(0)             // air mines      35
+            << QVariant(35)            // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(47)            // water rise amt 38
+            << QVariant(5)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 
     QList<QVariant> minefield;
@@ -313,14 +318,15 @@
             << QVariant(200)           // mines number   32
             << QVariant(0)             // mine dud pct   33
             << QVariant(0)             // explosives     34
-            << QVariant(35)            // health case pct 35
-            << QVariant(25)            // health case amt 36
-            << QVariant(47)            // water rise amt 37
-            << QVariant(5)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(0)             // air mines      35
+            << QVariant(35)            // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(47)            // water rise amt 38
+            << QVariant(5)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 
     QList<QVariant> barrelmayhem;
@@ -360,14 +366,15 @@
             << QVariant(0)             // mines number   32
             << QVariant(0)             // mine dud pct   33
             << QVariant(200)           // explosives     34
-            << QVariant(35)            // health case pct 35
-            << QVariant(25)            // health case amt 36
-            << QVariant(47)            // water rise amt 37
-            << QVariant(5)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(0)             // air mines      35
+            << QVariant(35)            // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(47)            // water rise amt 38
+            << QVariant(5)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 
     QList<QVariant> tunnelhogs;
@@ -407,14 +414,15 @@
             << QVariant(10)            // mines number   32
             << QVariant(10)            // mine dud pct   33
             << QVariant(10)            // explosives     34
-            << QVariant(35)            // health case pct 35
-            << QVariant(25)            // health case amt 36
-            << QVariant(47)            // water rise amt 37
-            << QVariant(5)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(4)             // air mines      35
+            << QVariant(35)            // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(47)            // water rise amt 38
+            << QVariant(5)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 
     QList<QVariant> forts;
@@ -454,14 +462,15 @@
             << QVariant(0)             // mines number   32
             << QVariant(0)             // mine dud pct   33
             << QVariant(0)             // explosives     34
-            << QVariant(35)            // health case pct 35
-            << QVariant(25)            // health case amt 36
-            << QVariant(47)            // water rise amt 37
-            << QVariant(5)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(0)             // air mines      35
+            << QVariant(35)            // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(47)            // water rise amt 38
+            << QVariant(5)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 
     QList<QVariant> timeless;
@@ -501,14 +510,15 @@
             << QVariant(5)             // mines number   32
             << QVariant(10)            // mine dud pct   33
             << QVariant(2)             // explosives     34
-            << QVariant(35)            // health case pct 35
-            << QVariant(30)            // health case amt 36
-            << QVariant(0)             // water rise amt 37
-            << QVariant(0)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(0)             // air mines      35
+            << QVariant(35)            // health case pct 36
+            << QVariant(30)            // health case amt 37
+            << QVariant(0)             // water rise amt 38
+            << QVariant(0)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 
     QList<QVariant> thinkingportals;
@@ -548,14 +558,15 @@
             << QVariant(5)             // mines number   32
             << QVariant(0)             // mine dud pct   33
             << QVariant(5)             // explosives     34
-            << QVariant(25)            // health case pct 35
-            << QVariant(25)            // health case amt 36
-            << QVariant(47)            // water rise amt 37
-            << QVariant(5)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(4)             // air mines      35
+            << QVariant(25)            // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(47)            // water rise amt 38
+            << QVariant(5)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 
     QList<QVariant> kingmode;
@@ -595,14 +606,15 @@
             << QVariant(4)             // mines number   32
             << QVariant(0)             // mine dud pct   33
             << QVariant(2)             // explosives     34
-            << QVariant(35)            // health case pct 35
-            << QVariant(25)            // health case amt 36
-            << QVariant(47)            // water rise amt 37
-            << QVariant(5)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(0)             // air mines      35
+            << QVariant(35)            // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(47)            // water rise amt 38
+            << QVariant(5)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 
 	QList<QVariant> construction;
@@ -642,14 +654,15 @@
             << QVariant(0)             // mines number   32
             << QVariant(0)             // mine dud pct   33
             << QVariant(0)             // explosives     34
-            << QVariant(35)            // health case pct 35
-            << QVariant(25)            // health case amt 36
-            << QVariant(47)            // water rise amt 37
-            << QVariant(5)             // health dec amt 38
-            << QVariant(100)           // rope modfier   39
-            << QVariant(100)           // get away time  40
-            << QVariant(0)             // world edge     41
-            << QVariant()              // scriptparam    42
+            << QVariant(0)             // air mines      35
+            << QVariant(35)            // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(47)            // water rise amt 38
+            << QVariant(5)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
             ;
 			
     schemes.append(defaultScheme);
--- a/QTfrontend/ui/page/pagescheme.cpp	Sat Feb 14 17:47:28 2015 -0500
+++ b/QTfrontend/ui/page/pagescheme.cpp	Sat Feb 14 22:25:31 2015 -0500
@@ -369,27 +369,41 @@
     glBSLayout->addWidget(SB_Explosives,13,2,1,1);
 
     l = new QLabel(gbBasicSettings);
-    l->setText(QLabel::tr("% Get Away Time"));
+    l->setText(QLabel::tr("Air Mines"));
     l->setWordWrap(true);
     glBSLayout->addWidget(l,14,0,1,1);
     l = new QLabel(gbBasicSettings);
     l->setFixedSize(32,32);
+    l->setPixmap(QPixmap(":/res/iconMine.png")); // TODO: icon
+    glBSLayout->addWidget(l,14,1,1,1);
+    SB_AirMines = new QSpinBox(gbBasicSettings);
+    SB_AirMines->setRange(0, 200);
+    SB_AirMines->setValue(0);
+    SB_AirMines->setSingleStep(5);
+    glBSLayout->addWidget(SB_AirMines,14,2,1,1);
+
+    l = new QLabel(gbBasicSettings);
+    l->setText(QLabel::tr("% Get Away Time"));
+    l->setWordWrap(true);
+    glBSLayout->addWidget(l,15,0,1,1);
+    l = new QLabel(gbBasicSettings);
+    l->setFixedSize(32,32);
     l->setPixmap(QPixmap(":/res/iconTime.png"));
-    glBSLayout->addWidget(l,14,1,1,1);
+    glBSLayout->addWidget(l,15,1,1,1);
     SB_GetAwayTime = new QSpinBox(gbBasicSettings);
     SB_GetAwayTime->setRange(0, 999);
     SB_GetAwayTime->setValue(100);
     SB_GetAwayTime->setSingleStep(25);
-    glBSLayout->addWidget(SB_GetAwayTime,14,2,1,1);
+    glBSLayout->addWidget(SB_GetAwayTime,15,2,1,1);
 
     l = new QLabel(gbBasicSettings);
     l->setText(QLabel::tr("World Edge"));
     l->setWordWrap(true);
-    glBSLayout->addWidget(l,15,0,1,1);
+    glBSLayout->addWidget(l,16,0,1,1);
     l = new QLabel(gbBasicSettings);
     l->setFixedSize(32,32);
     l->setPixmap(QPixmap(":/res/iconEarth.png"));
-    glBSLayout->addWidget(l,15,1,1,1);
+    glBSLayout->addWidget(l,16,1,1,1);
 
     CB_WorldEdge = new QComboBox(gbBasicSettings);
     CB_WorldEdge->insertItem(0, tr("None (Default)"));
@@ -397,21 +411,21 @@
     CB_WorldEdge->insertItem(2, tr("Bounce (Edges reflect)"));
     CB_WorldEdge->insertItem(3, tr("Sea (Edges connect to sea)"));
     /* CB_WorldEdge->insertItem(4, tr("Skybox")); */
-    glBSLayout->addWidget(CB_WorldEdge,15,2,1,1);
+    glBSLayout->addWidget(CB_WorldEdge,16,2,1,1);
 
 
     l = new QLabel(gbBasicSettings);
     l->setText(QLabel::tr("Script parameter"));
     l->setWordWrap(true);
-    glBSLayout->addWidget(l,16,0,1,1);
+    glBSLayout->addWidget(l,17,0,1,1);
     l = new QLabel(gbBasicSettings);
     l->setFixedSize(32,32);
     l->setPixmap(QPixmap(":/res/iconBox.png"));
-    glBSLayout->addWidget(l,16,1,1,1);
+    glBSLayout->addWidget(l,17,1,1,1);
 
     LE_ScriptParam = new QLineEdit(gbBasicSettings);
     LE_ScriptParam->setMaxLength(240);
-    glBSLayout->addWidget(LE_ScriptParam,16,2,1,1);
+    glBSLayout->addWidget(LE_ScriptParam,17,2,1,1);
 
 
     l = new QLabel(gbBasicSettings);
@@ -497,14 +511,15 @@
     mapper->addMapping(SB_Mines, 32);
     mapper->addMapping(SB_MineDuds, 33);
     mapper->addMapping(SB_Explosives, 34);
-    mapper->addMapping(SB_HealthCrates, 35);
-    mapper->addMapping(SB_CrateHealth, 36);
-    mapper->addMapping(SB_WaterRise, 37);
-    mapper->addMapping(SB_HealthDecrease, 38);
-    mapper->addMapping(SB_RopeModifier, 39);
-    mapper->addMapping(SB_GetAwayTime, 40);
-    mapper->addMapping(CB_WorldEdge, 41, "currentIndex");
-    mapper->addMapping(LE_ScriptParam, 42);
+    mapper->addMapping(SB_AirMines, 35);
+    mapper->addMapping(SB_HealthCrates, 36);
+    mapper->addMapping(SB_CrateHealth, 37);
+    mapper->addMapping(SB_WaterRise, 38);
+    mapper->addMapping(SB_HealthDecrease, 39);
+    mapper->addMapping(SB_RopeModifier, 40);
+    mapper->addMapping(SB_GetAwayTime, 41);
+    mapper->addMapping(CB_WorldEdge, 42, "currentIndex");
+    mapper->addMapping(LE_ScriptParam, 43);
 
     mapper->toFirst();
 }
--- a/QTfrontend/ui/page/pagescheme.h	Sat Feb 14 17:47:28 2015 -0500
+++ b/QTfrontend/ui/page/pagescheme.h	Sat Feb 14 22:25:31 2015 -0500
@@ -87,6 +87,7 @@
         QSpinBox * SB_CrateHealth;
         QSpinBox * SB_MinesTime;
         QSpinBox * SB_Mines;
+        QSpinBox * SB_AirMines;
         QSpinBox * SB_MineDuds;
         QSpinBox * SB_Explosives;
         QSpinBox * SB_RopeModifier;
--- a/QTfrontend/ui/widget/gamecfgwidget.cpp	Sat Feb 14 17:47:28 2015 -0500
+++ b/QTfrontend/ui/widget/gamecfgwidget.cpp	Sat Feb 14 22:25:31 2015 -0500
@@ -316,18 +316,19 @@
     bcfg << QString("e$minesnum %1").arg(schemeData(32).toInt()).toUtf8();
     bcfg << QString("e$minedudpct %1").arg(schemeData(33).toInt()).toUtf8();
     bcfg << QString("e$explosives %1").arg(schemeData(34).toInt()).toUtf8();
-    bcfg << QString("e$healthprob %1").arg(schemeData(35).toInt()).toUtf8();
-    bcfg << QString("e$hcaseamount %1").arg(schemeData(36).toInt()).toUtf8();
-    bcfg << QString("e$waterrise %1").arg(schemeData(37).toInt()).toUtf8();
-    bcfg << QString("e$healthdec %1").arg(schemeData(38).toInt()).toUtf8();
-    bcfg << QString("e$ropepct %1").arg(schemeData(39).toInt()).toUtf8();
-    bcfg << QString("e$getawaytime %1").arg(schemeData(40).toInt()).toUtf8();
-    bcfg << QString("e$worldedge %1").arg(schemeData(41).toInt()).toUtf8();
+    bcfg << QString("e$airmines %1").arg(schemeData(35).toInt()).toUtf8();
+    bcfg << QString("e$healthprob %1").arg(schemeData(36).toInt()).toUtf8();
+    bcfg << QString("e$hcaseamount %1").arg(schemeData(37).toInt()).toUtf8();
+    bcfg << QString("e$waterrise %1").arg(schemeData(38).toInt()).toUtf8();
+    bcfg << QString("e$healthdec %1").arg(schemeData(39).toInt()).toUtf8();
+    bcfg << QString("e$ropepct %1").arg(schemeData(40).toInt()).toUtf8();
+    bcfg << QString("e$getawaytime %1").arg(schemeData(41).toInt()).toUtf8();
+    bcfg << QString("e$worldedge %1").arg(schemeData(42).toInt()).toUtf8();
     bcfg << QString("e$template_filter %1").arg(pMapContainer->getTemplateFilter()).toUtf8();
     bcfg << QString("e$feature_size %1").arg(pMapContainer->getFeatureSize()).toUtf8();
     bcfg << QString("e$mapgen %1").arg(mapgen).toUtf8();
-    if(!schemeData(42).isNull())
-        bcfg << QString("e$scriptparam %1").arg(schemeData(42).toString()).toUtf8();
+    if(!schemeData(43).isNull())
+        bcfg << QString("e$scriptparam %1").arg(schemeData(43).toString()).toUtf8();
 
 
     switch (mapgen)
--- a/hedgewars/uCommandHandlers.pas	Sat Feb 14 17:47:28 2015 -0500
+++ b/hedgewars/uCommandHandlers.pas	Sat Feb 14 22:25:31 2015 -0500
@@ -842,6 +842,7 @@
     RegisterVariable('getawaytime' , @chGetAwayTime , false);
     RegisterVariable('minedudpct',@chMineDudPercent, false);
     RegisterVariable('minesnum', @chLandMines     , false);
+    RegisterVariable('airmines', @chAirMines      , false);
     RegisterVariable('explosives',@chExplosives    , false);
     RegisterVariable('gmflags' , @chGameFlags      , false);
     RegisterVariable('turntime', @chHedgehogTurnTime, false);
--- a/hedgewars/uGearsHandlersMess.pas	Sat Feb 14 17:47:28 2015 -0500
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Feb 14 22:25:31 2015 -0500
@@ -1839,7 +1839,7 @@
         trackSpeed:= _0;
         trackSpeed.QWordValue:= Gear^.Power;
         if (Gear^.X < targ^.X) and (Gear^.dX < _0_1)  then
-             Gear^.dX:= Gear^.dX+trackSpeed
+             Gear^.dX:= Gear^.dX+trackSpeed // please leave as an add.  I like the effect
         else if (Gear^.X > targ^.X) and (Gear^.dX > -_0_1) then
             Gear^.dX:= Gear^.dX-trackSpeed;
         if (Gear^.Y < targ^.Y) and (Gear^.dY < _0_1)  then