# HG changeset patch # User unc0rr # Date 1239550241 0 # Node ID 213d368a002f022d833881801fda6b9d1aa58f85 # Parent 31e449e1d9dd63ccbfde81462a5f4d76a06f4792 Predefine some ammo schemes diff -r 31e449e1d9dd -r 213d368a002f QTfrontend/hwconsts.cpp.in --- a/QTfrontend/hwconsts.cpp.in Sun Apr 12 15:24:08 2009 +0000 +++ b/QTfrontend/hwconsts.cpp.in Sun Apr 12 15:30:41 2009 +0000 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2007, 2008 Andrey Korotaev + * Copyright (c) 2007-2009 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +30,13 @@ QStringList * mapList; QString * cDefaultAmmoStore = new QString("939192942219912103223511100120100000"); +QList< QPair > cDefaultAmmos = + QList< QPair >() + << qMakePair(QString("Default"), *cDefaultAmmoStore) + << qMakePair(QString("Crazy"), QString("999999999999999999999999999999999999")) + << qMakePair(QString("Pro mode"), QString("909000900000000000000900000000000000")) + << qMakePair(QString("Shoppa"), QString("000000990000000000000000000000000000")) + ; QColor * color1 = new QColor(221, 0, 0); QColor * color2 = new QColor( 67, 118, 233); diff -r 31e449e1d9dd -r 213d368a002f QTfrontend/hwconsts.h --- a/QTfrontend/hwconsts.h Sun Apr 12 15:24:08 2009 +0000 +++ b/QTfrontend/hwconsts.h Sun Apr 12 15:30:41 2009 +0000 @@ -20,6 +20,7 @@ #include #include #include +#include extern QString * cProtoVer; extern QString * cVersionString; @@ -33,6 +34,7 @@ extern QStringList * mapList; extern QString * cDefaultAmmoStore; +extern QList< QPair > cDefaultAmmos; extern QColor * color1; extern QColor * color2; diff -r 31e449e1d9dd -r 213d368a002f QTfrontend/selectWeapon.cpp --- a/QTfrontend/selectWeapon.cpp Sun Apr 12 15:24:08 2009 +0000 +++ b/QTfrontend/selectWeapon.cpp Sun Apr 12 15:30:41 2009 +0000 @@ -75,7 +75,8 @@ { wconf = new QSettings(cfgdir->absolutePath() + "/weapons.ini", QSettings::IniFormat, this); - wconf->setValue("Default", *cDefaultAmmoStore); + for(int i = 0; i < cDefaultAmmos.size(); ++i) + wconf->setValue(cDefaultAmmos[i].first, cDefaultAmmos[i].second); QStringList keys = wconf->allKeys(); for(int i = 0; i < keys.size(); i++)