Option for alternative damage tags
authorunc0rr
Sun, 27 May 2007 20:17:55 +0000
changeset 529 812682c1ab62
parent 528 54fd6924de4e
child 530 f0b962214436
Option for alternative damage tags
QTfrontend/game.cpp
QTfrontend/gameuiconfig.cpp
QTfrontend/gameuiconfig.h
QTfrontend/pages.cpp
QTfrontend/pages.h
hedgewars/hwengine.dpr
hedgewars/uGears.pas
hedgewars/uMisc.pas
--- a/QTfrontend/game.cpp	Sun May 27 17:55:55 2007 +0000
+++ b/QTfrontend/game.cpp	Sun May 27 20:17:55 2007 +0000
@@ -216,6 +216,7 @@
 	arguments << QString::number(config->timerInterval());
 	arguments << datadir->absolutePath();
 	arguments << (config->isShowFPSEnabled() ? "1" : "0");
+	arguments << (config->isAltDamageEnabled() ? "1" : "0");
 	return arguments;
 }
 
--- a/QTfrontend/gameuiconfig.cpp	Sun May 27 17:55:55 2007 +0000
+++ b/QTfrontend/gameuiconfig.cpp	Sun May 27 20:17:55 2007 +0000
@@ -38,8 +38,11 @@
 
 	Form->ui.pageNet->editNetNick->setText(value("net/nick", QLineEdit::tr("unnamed")).toString());
 	Form->ui.pageNet->editIP->setText(value("net/ip", "").toString());
+
 	Form->ui.pageOptions->CBShowFPS->setChecked(value("fps/show", false).toBool());
 	Form->ui.pageOptions->fpsedit->setValue(value("fps/interval", 27).toUInt());
+
+	Form->ui.pageOptions->CBAltDamage->setChecked(value("misc/altdamage", true).toBool());
 }
 
 QStringList GameUIConfig::GetTeamsList()
@@ -65,6 +68,8 @@
 
 	setValue("fps/show", isShowFPSEnabled());
 	setValue("fps/interval", Form->ui.pageOptions->fpsedit->value());
+
+	setValue("misc/altdamage", isAltDamageEnabled());
 }
 
 int GameUIConfig::vid_Resolution()
@@ -87,6 +92,11 @@
 	return Form->ui.pageOptions->CBShowFPS->isChecked();
 }
 
+bool GameUIConfig::isAltDamageEnabled()
+{
+	return Form->ui.pageOptions->CBAltDamage->isChecked();;
+}
+
 quint8 GameUIConfig::timerInterval()
 {
 	return 35 - Form->ui.pageOptions->fpsedit->value();
--- a/QTfrontend/gameuiconfig.h	Sun May 27 17:55:55 2007 +0000
+++ b/QTfrontend/gameuiconfig.h	Sun May 27 20:17:55 2007 +0000
@@ -36,6 +36,7 @@
 	bool vid_Fullscreen();
 	bool isSoundEnabled();
 	bool isShowFPSEnabled();
+	bool isAltDamageEnabled();
 	quint8 timerInterval();
 
 private slots:
--- a/QTfrontend/pages.cpp	Sun May 27 17:55:55 2007 +0000
+++ b/QTfrontend/pages.cpp	Sun May 27 20:17:55 2007 +0000
@@ -397,6 +397,10 @@
 	CBShowFPS->setText(QCheckBox::tr("Show FPS"));
 	GBAlayout->addWidget(CBShowFPS);
 
+	CBAltDamage = new QCheckBox(AGGroupBox);
+	CBAltDamage->setText(QCheckBox::tr("Alternative damage show"));
+	GBAlayout->addWidget(CBAltDamage);
+
 	fpsedit = new FPSEdit(AGGroupBox);
 	GBAfpslayout->addWidget(fpsedit);
 
--- a/QTfrontend/pages.h	Sun May 27 17:55:55 2007 +0000
+++ b/QTfrontend/pages.h	Sun May 27 20:17:55 2007 +0000
@@ -151,6 +151,7 @@
 	QCheckBox *CBEnableSound;
 	QCheckBox *CBFullscreen;
 	QCheckBox *CBShowFPS;
+	QCheckBox *CBAltDamage;
 	FPSEdit *fpsedit;
 	QPushButton *BtnSaveOptions;
 };
--- a/hedgewars/hwengine.dpr	Sun May 27 17:55:55 2007 +0000
+++ b/hedgewars/hwengine.dpr	Sun May 27 20:17:55 2007 +0000
@@ -177,7 +177,7 @@
 {$ENDIF}
 
 case ParamCount of
-12: begin
+13: begin
      val(ParamStr(2), cScreenWidth);
      val(ParamStr(3), cScreenHeight);
      cBitsStr:= ParamStr(4);
@@ -190,6 +190,7 @@
      val(ParamStr(10), cTimerInterval);
      PathPrefix:= ParamStr(11);
      cShowFPS:= ParamStr(12) = '1';
+     cAltDamage:= ParamStr(13) = '1';
      for p:= Succ(Low(TPathType)) to High(TPathType) do
          if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p];
      AddClouds
--- a/hedgewars/uGears.pas	Sun May 27 17:55:55 2007 +0000
+++ b/hedgewars/uGears.pas	Sun May 27 20:17:55 2007 +0000
@@ -357,7 +357,8 @@
 
 procedure AddDamageTag(X, Y, Damage: LongWord; Gear: PGear);
 begin
-AddGear(X, Y, gtSmallDamage, Damage, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog;
+if cAltDamage then
+   AddGear(X, Y, gtSmallDamage, Damage, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog;
 end;
 
 procedure ProcessGears;
--- a/hedgewars/uMisc.pas	Sun May 27 17:55:55 2007 +0000
+++ b/hedgewars/uMisc.pas	Sun May 27 20:17:55 2007 +0000
@@ -48,6 +48,7 @@
     cGearScrEdgesDist: LongInt = 240;
     cCursorEdgesDist : LongInt = 40;
     cTeamHealthWidth : LongInt = 128;
+    cAltDamage       : boolean = true;
 
     GameTicks     : LongWord = 0;