Formerly "Draw Girders" by MrMfS - now "Disable Girders" to allow template prefs to still exist
--- a/QTfrontend/ammoSchemeModel.cpp Sun Feb 28 17:56:21 2010 +0000
+++ b/QTfrontend/ammoSchemeModel.cpp Mon Mar 01 00:02:55 2010 +0000
@@ -39,14 +39,15 @@
<< QVariant(false) // king 13
<< QVariant(false) // place hog 14
<< QVariant(false) // shared ammo 15
- << QVariant(100) // damage modfier 16
- << QVariant(45) // turn time 17
- << QVariant(100) // init health 18
- << QVariant(15) // sudden death 19
- << QVariant(5) // case prob 20
- << QVariant(3) // mines time 21
- << QVariant(4) // landadds 22
- << QVariant(0) // mine dud pct 23
+ << QVariant(false) //disable girders 16
+ << QVariant(100) // damage modfier 17
+ << QVariant(45) // turn time 18
+ << QVariant(100) // init health 19
+ << QVariant(15) // sudden death 20
+ << QVariant(5) // case prob 21
+ << QVariant(3) // mines time 22
+ << QVariant(4) // landadds 23
+ << QVariant(0) // mine dud pct 24
;
AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) :
@@ -79,14 +80,15 @@
<< "king" // 13
<< "placehog" // 14
<< "sharedammo" // 15
- << "damagefactor" // 16
- << "turntime" // 17
- << "health" // 18
- << "suddendeath" // 19
- << "caseprobability" // 20
- << "minestime" // 21
- << "landadds" // 22
- << "minedudpct" // 23
+ << "disablegirders" // 16
+ << "damagefactor" // 17
+ << "turntime" // 18
+ << "health" // 19
+ << "suddendeath" // 20
+ << "caseprobability" // 21
+ << "minestime" // 22
+ << "landadds" // 23
+ << "minedudpct" // 24
;
QList<QVariant> proMode;
@@ -107,14 +109,15 @@
<< QVariant(false) // king 13
<< QVariant(false) // place hog 14
<< QVariant(true) // shared ammo 15
- << QVariant(100) // damage modfier 16
- << QVariant(15) // turn time 17
- << QVariant(100) // init health 18
- << QVariant(15) // sudden death 19
- << QVariant(0) // case prob 20
- << QVariant(3) // mines time 21
- << QVariant(4) // landadds 22
- << QVariant(0) // mine dud pct 23
+ << QVariant(false) //disable girders 16
+ << QVariant(100) // damage modfier 17
+ << QVariant(15) // turn time 18
+ << QVariant(100) // init health 19
+ << QVariant(15) // sudden death 20
+ << QVariant(0) // case prob 21
+ << QVariant(3) // mines time 22
+ << QVariant(4) // landadds 23
+ << QVariant(0) // mine dud pct 24
;
QList<QVariant> shoppa;
@@ -135,14 +138,15 @@
<< QVariant(false) // king 13
<< QVariant(false) // place hog 14
<< QVariant(true) // shared ammo 15
- << QVariant(100) // damage modfier 16
- << QVariant(30) // turn time 17
- << QVariant(100) // init health 18
- << QVariant(50) // sudden death 19
- << QVariant(1) // case prob 20
- << QVariant(3) // mines time 21
- << QVariant(4) // landadds 22
- << QVariant(0) // mine dud pct 23
+ << QVariant(true) //disable girders 16
+ << QVariant(100) // damage modfier 17
+ << QVariant(30) // turn time 18
+ << QVariant(100) // init health 19
+ << QVariant(50) // sudden death 20
+ << QVariant(1) // case prob 21
+ << QVariant(3) // mines time 22
+ << QVariant(4) // landadds 23
+ << QVariant(0) // mine dud pct 24
;
QList<QVariant> basketball;
@@ -163,14 +167,15 @@
<< QVariant(false) // king 13
<< QVariant(false) // place hog 14
<< QVariant(true) // shared ammo 15
- << QVariant(100) // damage modfier 16
- << QVariant(30) // turn time 17
- << QVariant(100) // init health 18
- << QVariant(15) // sudden death 19
- << QVariant(0) // case prob 20
- << QVariant(3) // mines time 21
- << QVariant(4) // landadds 22
- << QVariant(0) // mine dud pct 23
+ << QVariant(true) //disable girders 16
+ << QVariant(100) // damage modfier 17
+ << QVariant(30) // turn time 18
+ << QVariant(100) // init health 19
+ << QVariant(15) // sudden death 20
+ << QVariant(0) // case prob 21
+ << QVariant(3) // mines time 22
+ << QVariant(4) // landadds 23
+ << QVariant(0) // mine dud pct 24
;
QList<QVariant> minefield;
@@ -191,14 +196,15 @@
<< QVariant(false) // king 13
<< QVariant(false) // place hog 14
<< QVariant(true) // shared ammo 15
- << QVariant(150) // damage modfier 16
- << QVariant(30) // turn time 17
- << QVariant(50) // init health 18
- << QVariant(15) // sudden death 19
- << QVariant(0) // case prob 20
- << QVariant(0) // mines time 21
- << QVariant(50) // landadds 22
- << QVariant(0) // mine dud pct 23
+ << QVariant(true) //disable girders 16
+ << QVariant(150) // damage modfier 17
+ << QVariant(30) // turn time 18
+ << QVariant(50) // init health 19
+ << QVariant(15) // sudden death 20
+ << QVariant(0) // case prob 21
+ << QVariant(0) // mines time 22
+ << QVariant(50) // landadds 23
+ << QVariant(0) // mine dud pct 24
;
schemes.append(defaultScheme);
--- a/QTfrontend/gamecfgwidget.cpp Sun Feb 28 17:56:21 2010 +0000
+++ b/QTfrontend/gamecfgwidget.cpp Mon Mar 01 00:02:55 2010 +0000
@@ -130,6 +130,8 @@
result |= 0x8000;
if (schemeData(15).toBool())
result |= 0x10000;
+ if (schemeData(16).toBool())
+ result |= 0x20000;
return result;
}
@@ -144,13 +146,13 @@
QStringList sl;
sl.append("eseed " + pMapContainer->getCurrentSeed());
sl.append(QString("e$gmflags %1").arg(getGameFlags()));
- sl.append(QString("e$damagepct %1").arg(schemeData(16).toInt()));
- sl.append(QString("e$turntime %1").arg(schemeData(17).toInt() * 1000));
- sl.append(QString("e$minestime %1").arg(schemeData(21).toInt() * 1000));
- sl.append(QString("e$landadds %1").arg(schemeData(22).toInt()));
- sl.append(QString("e$sd_turns %1").arg(schemeData(19).toInt()));
- sl.append(QString("e$casefreq %1").arg(schemeData(20).toInt()));
- sl.append(QString("e$minedudpct %1").arg(schemeData(23).toInt()));
+ sl.append(QString("e$damagepct %1").arg(schemeData(17).toInt()));
+ sl.append(QString("e$turntime %1").arg(schemeData(18).toInt() * 1000));
+ sl.append(QString("e$minestime %1").arg(schemeData(22).toInt() * 1000));
+ sl.append(QString("e$landadds %1").arg(schemeData(23).toInt()));
+ sl.append(QString("e$sd_turns %1").arg(schemeData(20).toInt()));
+ sl.append(QString("e$casefreq %1").arg(schemeData(21).toInt()));
+ sl.append(QString("e$minedudpct %1").arg(schemeData(24).toInt()));
sl.append(QString("e$template_filter %1").arg(pMapContainer->getTemplateFilter()));
QString currentMap = pMapContainer->getCurrentMap();
--- a/QTfrontend/hedgewars.qrc Sun Feb 28 17:56:21 2010 +0000
+++ b/QTfrontend/hedgewars.qrc Mon Mar 01 00:02:55 2010 +0000
@@ -61,6 +61,7 @@
<file>res/btnKing.png</file>
<file>res/btnPlaceHog.png</file>
<file>res/btnSharedAmmo.png</file>
+ <file>res/btnDisableGirders.png</file>
<file>res/iconBox.png</file>
<file>res/iconHealth.png</file>
<file>res/iconSuddenDeath.png</file>
--- a/QTfrontend/pages.cpp Sun Feb 28 17:56:21 2010 +0000
+++ b/QTfrontend/pages.cpp Mon Mar 01 00:02:55 2010 +0000
@@ -1107,6 +1107,11 @@
TBW_sharedammo->setToolTip(tr("Ammo is shared between all teams that share a colour."));
glGMLayout->addWidget(TBW_sharedammo,3,2,1,1);
+ TBW_disablegirders = new ToggleButtonWidget(gbGameModes, ":/res/btnDisableGirders.png");
+ TBW_disablegirders->setText(ToggleButtonWidget::tr("Disable Girders"));
+ TBW_disablegirders->setToolTip(tr("Disable girders when generating random maps."));
+ glGMLayout->addWidget(TBW_disablegirders,3,3,1,1);
+
// Right
QLabel * l;
@@ -1272,14 +1277,15 @@
mapper->addMapping(TBW_king->button(), 13);
mapper->addMapping(TBW_placehog->button(), 14);
mapper->addMapping(TBW_sharedammo->button(), 15);
- mapper->addMapping(SB_DamageModifier, 16);
- mapper->addMapping(SB_TurnTime, 17);
- mapper->addMapping(SB_InitHealth, 18);
- mapper->addMapping(SB_SuddenDeath, 19);
- mapper->addMapping(SB_CaseProb, 20);
- mapper->addMapping(SB_MinesTime, 21);
- mapper->addMapping(SB_Mines, 22);
- mapper->addMapping(SB_MineDuds, 23);
+ mapper->addMapping(TBW_disablegirders->button(), 16);
+ mapper->addMapping(SB_DamageModifier, 17);
+ mapper->addMapping(SB_TurnTime, 18);
+ mapper->addMapping(SB_InitHealth, 19);
+ mapper->addMapping(SB_SuddenDeath, 20);
+ mapper->addMapping(SB_CaseProb, 21);
+ mapper->addMapping(SB_MinesTime, 22);
+ mapper->addMapping(SB_Mines, 23);
+ mapper->addMapping(SB_MineDuds, 24);
mapper->toFirst();
}
--- a/QTfrontend/pages.h Sun Feb 28 17:56:21 2010 +0000
+++ b/QTfrontend/pages.h Mon Mar 01 00:02:55 2010 +0000
@@ -442,6 +442,7 @@
ToggleButtonWidget * TBW_king;
ToggleButtonWidget * TBW_placehog;
ToggleButtonWidget * TBW_sharedammo;
+ ToggleButtonWidget * TBW_disablegirders;
QSpinBox * SB_DamageModifier;
QSpinBox * SB_TurnTime;
Binary file QTfrontend/res/btnDisableGirders.png has changed
--- a/hedgewars/uConsts.pas Sun Feb 28 17:56:21 2010 +0000
+++ b/hedgewars/uConsts.pas Mon Mar 01 00:02:55 2010 +0000
@@ -290,23 +290,24 @@
tfIgnoreDelays = $00000008;
tfTargetRespawn = $00000010;
- gfForts = $00000001;
- gfMultiWeapon = $00000002;
- gfSolidLand = $00000004;
- gfBorder = $00000008;
- gfDivideTeams = $00000010;
- gfLowGravity = $00000020;
- gfLaserSight = $00000040;
- gfInvulnerable = $00000080;
- gfMines = $00000100;
- gfVampiric = $00000200;
- gfKarma = $00000400;
- gfArtillery = $00000800;
- gfOneClanMode = $00001000;
- gfRandomOrder = $00002000;
- gfKing = $00004000;
- gfPlaceHog = $00008000;
- gfSharedAmmo = $00010000;
+ gfForts = $00000001;
+ gfMultiWeapon = $00000002;
+ gfSolidLand = $00000004;
+ gfBorder = $00000008;
+ gfDivideTeams = $00000010;
+ gfLowGravity = $00000020;
+ gfLaserSight = $00000040;
+ gfInvulnerable = $00000080;
+ gfMines = $00000100;
+ gfVampiric = $00000200;
+ gfKarma = $00000400;
+ gfArtillery = $00000800;
+ gfOneClanMode = $00001000;
+ gfRandomOrder = $00002000;
+ gfKing = $00004000;
+ gfPlaceHog = $00008000;
+ gfSharedAmmo = $00010000;
+ gfDisableGirders = $00020000;
gstDrowning = $00000001;
gstHHDriven = $00000002;
--- a/hedgewars/uLand.pas Sun Feb 28 17:56:21 2010 +0000
+++ b/hedgewars/uLand.pas Mon Mar 01 00:02:55 2010 +0000
@@ -760,7 +760,7 @@
var x, y, w, c: Longword;
begin
hasBorder:= false;
-hasGirders:= true;
+
LoadThemeConfig;
if (GameFlags and gfForts) = 0 then
@@ -822,6 +822,8 @@
end;
end;
+if (GameFlags and gfDisableGirders) <> 0 then hasGirders:= false;
+
if ((GameFlags and gfForts) = 0) and (Pathz[ptMapCurrent] = '') then AddObjects;
UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT);