add world edges to config
authornemo
Thu, 03 Oct 2013 14:47:33 -0400
changeset 9489 0818d14e90be
parent 9487 fbe203c1d11e
child 9491 e9f124a10804
add world edges to config
QTfrontend/hedgewars.qrc
QTfrontend/model/ammoSchemeModel.cpp
QTfrontend/res/iconEarth.png
QTfrontend/ui/page/pagescheme.cpp
QTfrontend/ui/page/pagescheme.h
QTfrontend/ui/widget/gamecfgwidget.cpp
hedgewars/uCommandHandlers.pas
hedgewars/uGearsUtils.pas
--- a/QTfrontend/hedgewars.qrc	Thu Oct 03 12:22:12 2013 -0400
+++ b/QTfrontend/hedgewars.qrc	Thu Oct 03 14:47:33 2013 -0400
@@ -113,6 +113,7 @@
         <file>res/iconMine.png</file>
         <file>res/iconDud.png</file>
         <file>res/iconRope.png</file>
+        <file>res/iconEarth.png</file>
         <file>res/dice.png</file>
         <file>res/Star.png</file>
         <file>res/inverse-corner-bl.png</file>
--- a/QTfrontend/model/ammoSchemeModel.cpp	Thu Oct 03 12:22:12 2013 -0400
+++ b/QTfrontend/model/ammoSchemeModel.cpp	Thu Oct 03 14:47:33 2013 -0400
@@ -64,6 +64,7 @@
                                 << QVariant(5)             // health dec amt 38
                                 << QVariant(100)           // rope modfier   39
                                 << QVariant(100)           // get away time  40
+                                << QVariant(0)             // world edge     41
                                 ;
 
 AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) :
@@ -128,6 +129,7 @@
               << "healthdecrease"      // 38
               << "ropepct"             // 39
               << "getawaytime"         // 40
+              << "worldedge"           // 41
               ;
 
     QList<QVariant> proMode;
@@ -173,6 +175,7 @@
             << QVariant(5)             // health dec amt 38
             << QVariant(100)           // rope modfier   39
             << QVariant(100)           // get away time  40
+            << QVariant(0)             // world edge     41
             ;
 
     QList<QVariant> shoppa;
@@ -218,6 +221,7 @@
             << QVariant(5)             // health dec amt 38
             << QVariant(100)           // rope modfier   39
             << QVariant(100)           // get away time  40
+            << QVariant(0)             // world edge     41
             ;
 
     QList<QVariant> cleanslate;
@@ -263,6 +267,7 @@
             << QVariant(5)             // health dec amt 38
             << QVariant(100)           // rope modfier   39
             << QVariant(100)           // get away time  40
+            << QVariant(0)             // world edge     41
             ;
 
     QList<QVariant> minefield;
@@ -308,6 +313,7 @@
             << QVariant(5)             // health dec amt 38
             << QVariant(100)           // rope modfier   39
             << QVariant(100)           // get away time  40
+            << QVariant(0)             // world edge     41
             ;
 
     QList<QVariant> barrelmayhem;
@@ -353,6 +359,7 @@
             << QVariant(5)             // health dec amt 38
             << QVariant(100)           // rope modfier   39
             << QVariant(100)           // get away time  40
+            << QVariant(0)             // world edge     41
             ;
 
     QList<QVariant> tunnelhogs;
@@ -398,6 +405,7 @@
             << QVariant(5)             // health dec amt 38
             << QVariant(100)           // rope modfier   39
             << QVariant(100)           // get away time  40
+            << QVariant(0)             // world edge     41
             ;
 
     QList<QVariant> forts;
@@ -443,6 +451,7 @@
             << QVariant(5)             // health dec amt 38
             << QVariant(100)           // rope modfier   39
             << QVariant(100)           // get away time  40
+            << QVariant(0)             // world edge     41
             ;
 
     QList<QVariant> timeless;
@@ -488,6 +497,7 @@
             << QVariant(0)             // health dec amt 38
             << QVariant(100)           // rope modfier   39
             << QVariant(100)           // get away time  40
+            << QVariant(0)             // world edge     41
             ;
 
     QList<QVariant> thinkingportals;
@@ -533,6 +543,7 @@
             << QVariant(5)             // health dec amt 38
             << QVariant(100)           // rope modfier   39
             << QVariant(100)           // get away time  40
+            << QVariant(0)             // world edge     41
             ;
 
     QList<QVariant> kingmode;
@@ -578,6 +589,7 @@
             << QVariant(5)             // health dec amt 38
             << QVariant(100)           // rope modfier   39
             << QVariant(100)           // get away time  40
+            << QVariant(0)             // world edge     41
             ;
 
 
Binary file QTfrontend/res/iconEarth.png has changed
--- a/QTfrontend/ui/page/pagescheme.cpp	Thu Oct 03 12:22:12 2013 -0400
+++ b/QTfrontend/ui/page/pagescheme.cpp	Thu Oct 03 14:47:33 2013 -0400
@@ -383,6 +383,23 @@
     glBSLayout->addWidget(SB_GetAwayTime,14,2,1,1);
 
     l = new QLabel(gbBasicSettings);
+    l->setText(QLabel::tr("World Edge"));
+    l->setWordWrap(true);
+    glBSLayout->addWidget(l,15,0,1,1);
+    l = new QLabel(gbBasicSettings);
+    l->setFixedSize(32,32);
+    l->setPixmap(QPixmap(":/res/iconEarth.png"));
+    glBSLayout->addWidget(l,15,1,1,1);
+    CB_WorldEdge = new QComboBox(gbBasicSettings);
+    CB_WorldEdge->insertItem(0, tr("None (Default)"));
+    CB_WorldEdge->insertItem(1, tr("Wrap (World wraps)"));
+    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);
+
+
+    l = new QLabel(gbBasicSettings);
     l->setText(QLabel::tr("Scheme Name:"));
 
     LE_name = new QLineEdit(this);
@@ -471,6 +488,7 @@
     mapper->addMapping(SB_HealthDecrease, 38);
     mapper->addMapping(SB_RopeModifier, 39);
     mapper->addMapping(SB_GetAwayTime, 40);
+    mapper->addMapping(CB_WorldEdge, 41);
 
     mapper->toFirst();
 }
--- a/QTfrontend/ui/page/pagescheme.h	Thu Oct 03 12:22:12 2013 -0400
+++ b/QTfrontend/ui/page/pagescheme.h	Thu Oct 03 14:47:33 2013 -0400
@@ -91,6 +91,7 @@
         QSpinBox * SB_Explosives;
         QSpinBox * SB_RopeModifier;
         QSpinBox * SB_GetAwayTime;
+        QComboBox * CB_WorldEdge;
         QLineEdit * LE_name;
 
         QGroupBox * gbGameModes;
--- a/QTfrontend/ui/widget/gamecfgwidget.cpp	Thu Oct 03 12:22:12 2013 -0400
+++ b/QTfrontend/ui/widget/gamecfgwidget.cpp	Thu Oct 03 14:47:33 2013 -0400
@@ -321,6 +321,7 @@
     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$template_filter %1").arg(pMapContainer->getTemplateFilter()).toUtf8();
     bcfg << QString("e$mapgen %1").arg(mapgen).toUtf8();
 
--- a/hedgewars/uCommandHandlers.pas	Thu Oct 03 12:22:12 2013 -0400
+++ b/hedgewars/uCommandHandlers.pas	Thu Oct 03 14:47:33 2013 -0400
@@ -797,6 +797,11 @@
   CampaignVariable := s;
 end;
 
+procedure chWorldEdge(var s: shortstring);
+begin
+WorldEdge:= TWorldEdge(StrToInt(s))
+end;
+
 procedure initModule;
 begin
 //////// Begin top sorted by freq analysis not including chatmsg
@@ -882,6 +887,7 @@
     RegisterVariable('-cur_r'  , @chCurR_m       , true );
     RegisterVariable('campvar' , @chCampVar      , true );
     RegisterVariable('record'  , @chRecord       , true );
+    RegisterVariable('worldedge',@chWorldEdge    , false);
 end;
 
 procedure freeModule;
--- a/hedgewars/uGearsUtils.pas	Thu Oct 03 12:22:12 2013 -0400
+++ b/hedgewars/uGearsUtils.pas	Thu Oct 03 14:47:33 2013 -0400
@@ -1221,8 +1221,6 @@
 var tdx: hwFloat;
 begin
 WorldWrap:= false;
-// for playing around since it isn't hooked up yet
-//WorldEdge:= weBounce;
 if WorldEdge = weNone then exit(false);
 if (hwRound(Gear^.X)-Gear^.Radius < leftX) or
    (hwRound(Gear^.X)+Gear^.Radius > rightX) then