# HG changeset patch
# User nemo
# Date 1380826053 14400
# Node ID 0818d14e90be524a53ee223e3aaad2d68f27abb1
# Parent fbe203c1d11e55b1c68c2197488233ffcdb719e4
add world edges to config
diff -r fbe203c1d11e -r 0818d14e90be QTfrontend/hedgewars.qrc
--- 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 @@
res/iconMine.png
res/iconDud.png
res/iconRope.png
+ res/iconEarth.png
res/dice.png
res/Star.png
res/inverse-corner-bl.png
diff -r fbe203c1d11e -r 0818d14e90be QTfrontend/model/ammoSchemeModel.cpp
--- 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 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 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 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 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 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 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 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 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 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 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
;
diff -r fbe203c1d11e -r 0818d14e90be QTfrontend/res/iconEarth.png
Binary file QTfrontend/res/iconEarth.png has changed
diff -r fbe203c1d11e -r 0818d14e90be QTfrontend/ui/page/pagescheme.cpp
--- 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();
}
diff -r fbe203c1d11e -r 0818d14e90be QTfrontend/ui/page/pagescheme.h
--- 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;
diff -r fbe203c1d11e -r 0818d14e90be QTfrontend/ui/widget/gamecfgwidget.cpp
--- 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();
diff -r fbe203c1d11e -r 0818d14e90be hedgewars/uCommandHandlers.pas
--- 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;
diff -r fbe203c1d11e -r 0818d14e90be hedgewars/uGearsUtils.pas
--- 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