# HG changeset patch # User unc0rr # Date 1180297075 0 # Node ID 812682c1ab62bcd9487b553570dd3d81b182cf5c # Parent 54fd6924de4e9ad099c61148a33c6d807bf02f22 Option for alternative damage tags diff -r 54fd6924de4e -r 812682c1ab62 QTfrontend/game.cpp --- 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; } diff -r 54fd6924de4e -r 812682c1ab62 QTfrontend/gameuiconfig.cpp --- 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(); diff -r 54fd6924de4e -r 812682c1ab62 QTfrontend/gameuiconfig.h --- 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: diff -r 54fd6924de4e -r 812682c1ab62 QTfrontend/pages.cpp --- 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); diff -r 54fd6924de4e -r 812682c1ab62 QTfrontend/pages.h --- 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; }; diff -r 54fd6924de4e -r 812682c1ab62 hedgewars/hwengine.dpr --- 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 diff -r 54fd6924de4e -r 812682c1ab62 hedgewars/uGears.pas --- 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; diff -r 54fd6924de4e -r 812682c1ab62 hedgewars/uMisc.pas --- 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;