QTfrontend/hwconsts.cpp.in
author nemo
Sun, 10 Oct 2010 12:08:16 -0400
changeset 3943 9835060e5c01
parent 3932 2fc211f60015
child 3963 6090d2a2472e
permissions -rw-r--r--
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     1
/*
1066
1f1b3686a2b0 Update copyright headers a bit
unc0rr
parents: 1021
diff changeset
     2
 * Hedgewars, a free turn based strategy game
3236
4ab3917d7d44 Update (c) lines to 2010 as unc0rr requested - they all had varying values so I just took the first year mentioned, then tacked on -2010
nemo
parents: 3074
diff changeset
     3
 * Copyright (c) 2007-2010 Andrey Korotaev <unC0Rr@gmail.com>
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     4
 *
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     8
 *
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    12
 * GNU General Public License for more details.
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    13
 *
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    17
 */
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    18
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    19
#include "hwconsts.h"
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    20
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    21
QString * cProtoVer = new QString("${HEDGEWARS_PROTO_VER}");
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    22
QString * cDataDir = new QString("${HEDGEWARS_DATADIR}");
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2370
diff changeset
    23
QString * cConfigDir = new QString("");
907
a5b0b93a39c8 Use constant generated by cmake for version string
unc0rr
parents: 654
diff changeset
    24
QString * cVersionString = new QString("${HEDGEWARS_VERSION}");
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    25
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    26
QDir * bindir = new QDir("${HEDGEWARS_BINDIR}");
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    27
QDir * cfgdir = new QDir();
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    28
QDir * datadir = new QDir();
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    29
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    30
QStringList * Themes;
1210
bfed1b89bc85 Add themes list to map selection widget
unc0rr
parents: 1088
diff changeset
    31
QStringList * mapList;
607
26a91a9f5514 Now trainings can have custom ammostore
unc0rr
parents: 579
diff changeset
    32
3932
2fc211f60015 Engine:
smaxx
parents: 3876
diff changeset
    33
bool custom_config = false;
2fc211f60015 Engine:
smaxx
parents: 3876
diff changeset
    34
bool custom_data = false;
2fc211f60015 Engine:
smaxx
parents: 3876
diff changeset
    35
3865
0b1c426b035f Frontend:
smaxx
parents: 3836
diff changeset
    36
int cMaxTeams = 6;
0b1c426b035f Frontend:
smaxx
parents: 3836
diff changeset
    37
2369
c3eb11f1ab3a Implement probability editor for weapon schemes (engine doesn't support that yet)
unc0rr
parents: 2177
diff changeset
    38
QString * cDefaultAmmoStore = new QString(
3819
ba2926231115 Disable sine gun in all weapon sets, slap a beta on the name and incomplete in description. This is to reassure sheepluva who fears his WIP making it prominently into a release.
nemo
parents: 3729
diff changeset
    39
        "939192942219912103223511100120100000021111010101"
ba2926231115 Disable sine gun in all weapon sets, slap a beta on the name and incomplete in description. This is to reassure sheepluva who fears his WIP making it prominently into a release.
nemo
parents: 3729
diff changeset
    40
        "040504054160065554655446477657666666615551010111"
3717
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    41
        "000000000000020550000004000700400000000020000000"
3819
ba2926231115 Disable sine gun in all weapon sets, slap a beta on the name and incomplete in description. This is to reassure sheepluva who fears his WIP making it prominently into a release.
nemo
parents: 3729
diff changeset
    42
        "131111031211111112311411111111111111121111110111"
2369
c3eb11f1ab3a Implement probability editor for weapon schemes (engine doesn't support that yet)
unc0rr
parents: 2177
diff changeset
    43
		);
2860
13a53315ae18 Awesome patch from TheException - adds editing of weapon delay and crate count. Tiy might want to tweak the crate graphic, could make be smaller or less overlappy.
nemo
parents: 2473
diff changeset
    44
int cAmmoNumber = cDefaultAmmoStore->size() / 4;
2369
c3eb11f1ab3a Implement probability editor for weapon schemes (engine doesn't support that yet)
unc0rr
parents: 2177
diff changeset
    45
1967
213d368a002f Predefine some ammo schemes
unc0rr
parents: 1966
diff changeset
    46
QList< QPair<QString, QString> > cDefaultAmmos =
213d368a002f Predefine some ammo schemes
unc0rr
parents: 1966
diff changeset
    47
	QList< QPair<QString, QString> >()
213d368a002f Predefine some ammo schemes
unc0rr
parents: 1966
diff changeset
    48
	<< qMakePair(QString("Default"), *cDefaultAmmoStore)
2370
2ff8fce5e06f - Support probabilies from ammo scheme in engine
unc0rr
parents: 2369
diff changeset
    49
	<< qMakePair(QString("Crazy"),     QString(
3819
ba2926231115 Disable sine gun in all weapon sets, slap a beta on the name and incomplete in description. This is to reassure sheepluva who fears his WIP making it prominently into a release.
nemo
parents: 3729
diff changeset
    50
        "999999999999999999299999999999999929999999990999" // TODO: Remove Piano's unlimited uses!
ba2926231115 Disable sine gun in all weapon sets, slap a beta on the name and incomplete in description. This is to reassure sheepluva who fears his WIP making it prominently into a release.
nemo
parents: 3729
diff changeset
    51
        "111111011111111111111111111111111111111111110111"
3717
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    52
        "000000000000000000000000000000000000000000000000"
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    53
        "131111031211111112311411111111111111121111010111"))
2370
2ff8fce5e06f - Support probabilies from ammo scheme in engine
unc0rr
parents: 2369
diff changeset
    54
	<< qMakePair(QString("Pro mode"),  QString(
3836
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3819
diff changeset
    55
        "909000900000000000000900000000000000000000000000"
3717
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    56
        "000000000000000000000000000000000000000000000000"
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    57
        "000000000000020550000004000700400000000020000000"
3819
ba2926231115 Disable sine gun in all weapon sets, slap a beta on the name and incomplete in description. This is to reassure sheepluva who fears his WIP making it prominently into a release.
nemo
parents: 3729
diff changeset
    58
        "111111111111111111111111111111111111111110010111"))
2370
2ff8fce5e06f - Support probabilies from ammo scheme in engine
unc0rr
parents: 2369
diff changeset
    59
	<< qMakePair(QString("Shoppa"),    QString(
3717
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    60
        "000000990000000000000000000000000000000000000000"
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    61
        "444441004424440221011212122242200000000200040001"
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    62
        "000000000000000000000000000000000000000000000000"
3819
ba2926231115 Disable sine gun in all weapon sets, slap a beta on the name and incomplete in description. This is to reassure sheepluva who fears his WIP making it prominently into a release.
nemo
parents: 3729
diff changeset
    63
        "111111111111111111111111111111111111111110110111"))
2370
2ff8fce5e06f - Support probabilies from ammo scheme in engine
unc0rr
parents: 2369
diff changeset
    64
	<< qMakePair(QString("Basketball"),QString(
3717
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    65
		"000000900000090000000000000000000000000000000000"
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    66
		"000000000000000000000000000000000000000000000000"
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    67
		"000000000000000550000004000700400000000020000000"
3819
ba2926231115 Disable sine gun in all weapon sets, slap a beta on the name and incomplete in description. This is to reassure sheepluva who fears his WIP making it prominently into a release.
nemo
parents: 3729
diff changeset
    68
		"111111111111111111111111111111111111111111110111"))
2370
2ff8fce5e06f - Support probabilies from ammo scheme in engine
unc0rr
parents: 2369
diff changeset
    69
	<< qMakePair(QString("Minefield"), QString(
3717
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    70
		"000000990009000000030000000000000000000000000000"
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    71
		"000000000000000000000000000000000000000000000000"
d88719b0f0dc Engine:
smaxx
parents: 3710
diff changeset
    72
		"000000000000020550000004000700400000000020000000"
3819
ba2926231115 Disable sine gun in all weapon sets, slap a beta on the name and incomplete in description. This is to reassure sheepluva who fears his WIP making it prominently into a release.
nemo
parents: 3729
diff changeset
    73
		"111111111111111111111111111111111111111111110111"))
1967
213d368a002f Predefine some ammo schemes
unc0rr
parents: 1966
diff changeset
    74
	;
616
00928b3cf505 Use same team colors everywhere
unc0rr
parents: 608
diff changeset
    75
3876
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    76
QColor *colors[] = {
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    77
                    new QColor(221,   0,   0), // classic red
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    78
                    new QColor( 67, 118, 233), // classic blue
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    79
                    new QColor( 62, 147,  33), // classic green
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    80
                    new QColor(162,  61, 187), // classic purple
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    81
                    new QColor(255, 147,  41), // classic orange
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    82
                    new QColor(115, 115, 115), // classic gray
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    83
                    new QColor(187, 162,  61), // gold
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    84
                    new QColor( 61, 162, 187), // cyan
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    85
                    // add new colors here
3dd031a8b395 Frontend:
smaxx
parents: 3865
diff changeset
    86
                    0};
654
1019b8fa8638 Finish asking host/port dialog implementation
unc0rr
parents: 616
diff changeset
    87
1019b8fa8638 Finish asking host/port dialog implementation
unc0rr
parents: 616
diff changeset
    88
QString * netHost = new QString();
1019b8fa8638 Finish asking host/port dialog implementation
unc0rr
parents: 616
diff changeset
    89
quint16 netPort = 46631;
1415
6fbfee0e113a Allow build without net game server: introduce -DWITH_SERVER configuration parameter
unc0rr
parents: 1263
diff changeset
    90
6fbfee0e113a Allow build without net game server: introduce -DWITH_SERVER configuration parameter
unc0rr
parents: 1263
diff changeset
    91
bool haveServer = ${HAVE_NETSERVER};
3074
271cfcb2bcda Frontend:
smxx
parents: 3070
diff changeset
    92
bool isDevBuild = ${HW_DEV};