author | unC0Rr |
Thu, 19 Dec 2024 12:43:38 +0100 | |
branch | transitional_engine |
changeset 16051 | a5eaeefa4ab3 |
parent 15638 | 1ee7790caa0f |
permissions | -rw-r--r-- |
579 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
11046 | 3 |
* Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
579 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
10083
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
579 | 17 |
*/ |
18 |
||
13486
4ef83bcb850b
Clean up cMaxHHs and cMaxTeams a bit, get rid of hardcoded numbers
Wuzzy <Wuzzy2@mail.ru>
parents:
12258
diff
changeset
|
19 |
/* |
4ef83bcb850b
Clean up cMaxHHs and cMaxTeams a bit, get rid of hardcoded numbers
Wuzzy <Wuzzy2@mail.ru>
parents:
12258
diff
changeset
|
20 |
* PLEASE NOTE: hwconsts.cpp is automatically generated from hwconsts.cpp.in. |
4ef83bcb850b
Clean up cMaxHHs and cMaxTeams a bit, get rid of hardcoded numbers
Wuzzy <Wuzzy2@mail.ru>
parents:
12258
diff
changeset
|
21 |
* Do not edit hwconsts.cpp manually, it will be overwritten when building. |
4ef83bcb850b
Clean up cMaxHHs and cMaxTeams a bit, get rid of hardcoded numbers
Wuzzy <Wuzzy2@mail.ru>
parents:
12258
diff
changeset
|
22 |
* Edit hwconsts.cpp.in to change the code. |
4ef83bcb850b
Clean up cMaxHHs and cMaxTeams a bit, get rid of hardcoded numbers
Wuzzy <Wuzzy2@mail.ru>
parents:
12258
diff
changeset
|
23 |
*/ |
4ef83bcb850b
Clean up cMaxHHs and cMaxTeams a bit, get rid of hardcoded numbers
Wuzzy <Wuzzy2@mail.ru>
parents:
12258
diff
changeset
|
24 |
|
7130 | 25 |
#include <QStandardItemModel> |
26 |
||
579 | 27 |
#include "hwconsts.h" |
8608
50cc0131b109
move weapons line away from hwconsts.h so that modifying it doesn't needlessly recompile everything, introduce a way to try documenting which weapons each number represents
koda
parents:
8605
diff
changeset
|
28 |
#include "weapons.h" |
579 | 29 |
|
8646
e31044b7fbba
on linux assume datapath is always relative to cmake_install_prefix, unless you provide an absolute path; on win32/osx hardcode engine path to default installation prefixes (it gets overridden at runtime so it works even if you move the data folder)
koda
parents:
8636
diff
changeset
|
30 |
// cDataDir gets 'Data' appended later (in main.cpp) |
e31044b7fbba
on linux assume datapath is always relative to cmake_install_prefix, unless you provide an absolute path; on win32/osx hardcode engine path to default installation prefixes (it gets overridden at runtime so it works even if you move the data folder)
koda
parents:
8636
diff
changeset
|
31 |
QString * cDataDir = new QString("${HEDGEWARS_DATADIR}"); |
579 | 32 |
QString * cProtoVer = new QString("${HEDGEWARS_PROTO_VER}"); |
8090
38d9cc60b14c
cleanup revision section, make hg launch tolerant to config errors, drop deprecated exec_prog for desktop configuration in favour of execute_process
koda
parents:
7258
diff
changeset
|
33 |
QString * cVersionString = new QString("${HEDGEWARS_VERSION}"); |
8650 | 34 |
QString * cRevisionString = new QString("${HEDGEWARS_REVISION}"); |
35 |
QString * cHashString = new QString("${HEDGEWARS_HASH}"); |
|
8613
82c649dfc7c3
split cVersionString into its three separate components (version, revision, hash) and apply the new values sensibly on the frontend (esp. title, info and feedback)
koda
parents:
8608
diff
changeset
|
36 |
|
14839
e239378a9400
Prevent entering “/”, “\” and “:” in team and scheme names.
Wuzzy <Wuzzy2@mail.ru>
parents:
14737
diff
changeset
|
37 |
// For disallowing some characters that would screw up file name |
e239378a9400
Prevent entering “/”, “\” and “:” in team and scheme names.
Wuzzy <Wuzzy2@mail.ru>
parents:
14737
diff
changeset
|
38 |
QString * cSafeFileNameRegExp = new QString("[^:/\\\\]*"); |
579 | 39 |
|
8323
ab0b618bdf13
get executable directory at runtime rather than configure time
koda
parents:
8090
diff
changeset
|
40 |
QDir * bindir = new QDir(); |
579 | 41 |
QDir * cfgdir = new QDir(); |
42 |
QDir * datadir = new QDir(); |
|
43 |
||
3932 | 44 |
bool custom_config = false; |
45 |
bool custom_data = false; |
|
46 |
||
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
47 |
int cMaxTeams = 8; |
13505 | 48 |
int cMaxHHs = HEDGEHOGS_PER_TEAM * cMaxTeams; |
10074 | 49 |
int cMinServerVersion = 3; |
14737
123aaa2bf4b5
Make dark clan colors visible in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents:
13716
diff
changeset
|
50 |
unsigned char cInvertTextColorAt = 64; |
3865 | 51 |
|
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
52 |
QString * cDefaultAmmoStore = new QString( AMMOLINE_DEFAULT_QT AMMOLINE_DEFAULT_PROB |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
53 |
AMMOLINE_DEFAULT_DELAY AMMOLINE_DEFAULT_CRATE ); |
11763
59e979b1408f
Add empty weapons scheme (instead of default) when using “New” button
Wuzzy <almikes@aol.com>
parents:
11046
diff
changeset
|
54 |
QString * cEmptyAmmoStore = new QString( AMMOLINE_EMPTY_QT AMMOLINE_EMPTY_PROB |
59e979b1408f
Add empty weapons scheme (instead of default) when using “New” button
Wuzzy <almikes@aol.com>
parents:
11046
diff
changeset
|
55 |
AMMOLINE_EMPTY_DELAY AMMOLINE_EMPTY_CRATE ); |
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
|
56 |
int cAmmoNumber = cDefaultAmmoStore->size() / 4; |
15638 | 57 |
unsigned int ammoMenuAmmos[] = HW_AMMOMENU_ARRAY; |
58 |
int cAmmoMenuRows = 6; |
|
2369
c3eb11f1ab3a
Implement probability editor for weapon schemes (engine doesn't support that yet)
unc0rr
parents:
2177
diff
changeset
|
59 |
|
1967 | 60 |
QList< QPair<QString, QString> > cDefaultAmmos = |
3971 | 61 |
QList< QPair<QString, QString> >() |
62 |
<< qMakePair(QString("Default"), *cDefaultAmmoStore) |
|
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
63 |
<< qMakePair(QString("Crazy"), QString( |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
64 |
AMMOLINE_CRAZY_QT AMMOLINE_CRAZY_PROB |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
65 |
AMMOLINE_CRAZY_DELAY AMMOLINE_CRAZY_CRATE )) |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
66 |
<< qMakePair(QString("Pro Mode"), QString( |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
67 |
AMMOLINE_PROMODE_QT AMMOLINE_PROMODE_PROB |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
68 |
AMMOLINE_PROMODE_DELAY AMMOLINE_PROMODE_CRATE )) |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
69 |
<< qMakePair(QString("Shoppa"), QString( |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
70 |
AMMOLINE_SHOPPA_QT AMMOLINE_SHOPPA_PROB |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
71 |
AMMOLINE_SHOPPA_DELAY AMMOLINE_SHOPPA_CRATE )) |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
72 |
<< qMakePair(QString("Clean Slate"), QString( |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
73 |
AMMOLINE_CLEAN_QT AMMOLINE_CLEAN_PROB |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
74 |
AMMOLINE_CLEAN_DELAY AMMOLINE_CLEAN_CRATE )) |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
75 |
<< qMakePair(QString("Minefield"), QString( |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
76 |
AMMOLINE_MINES_QT AMMOLINE_MINES_PROB |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
77 |
AMMOLINE_MINES_DELAY AMMOLINE_MINES_CRATE )) |
4231 | 78 |
<< qMakePair(QString("Thinking with Portals"), QString( |
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
79 |
AMMOLINE_PORTALS_QT AMMOLINE_PORTALS_PROB |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
80 |
AMMOLINE_PORTALS_DELAY AMMOLINE_PORTALS_CRATE )) |
8605
2865389fec96
add 'One of Everything' in the weaponsets, from nemo's idea
koda
parents:
8323
diff
changeset
|
81 |
<< qMakePair(QString("One of Everything"), QString( |
2865389fec96
add 'One of Everything' in the weaponsets, from nemo's idea
koda
parents:
8323
diff
changeset
|
82 |
AMMOLINE_ONEEVERY_QT AMMOLINE_ONEEVERY_PROB |
2865389fec96
add 'One of Everything' in the weaponsets, from nemo's idea
koda
parents:
8323
diff
changeset
|
83 |
AMMOLINE_ONEEVERY_DELAY AMMOLINE_ONEEVERY_CRATE )) |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10074
diff
changeset
|
84 |
<< qMakePair(QString("Highlander"), QString( |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10074
diff
changeset
|
85 |
AMMOLINE_HIGHLANDER_QT AMMOLINE_HIGHLANDER_PROB |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10074
diff
changeset
|
86 |
AMMOLINE_HIGHLANDER_DELAY AMMOLINE_HIGHLANDER_CRATE )) |
13716
6d57f5f61c09
BRW now allows weapon scheme customization
Wuzzy <Wuzzy2@mail.ru>
parents:
13505
diff
changeset
|
87 |
<< qMakePair(QString("Balanced Random Weapon"), QString( |
6d57f5f61c09
BRW now allows weapon scheme customization
Wuzzy <Wuzzy2@mail.ru>
parents:
13505
diff
changeset
|
88 |
AMMOLINE_BRW_QT AMMOLINE_BRW_PROB |
6d57f5f61c09
BRW now allows weapon scheme customization
Wuzzy <Wuzzy2@mail.ru>
parents:
13505
diff
changeset
|
89 |
AMMOLINE_BRW_DELAY AMMOLINE_BRW_CRATE )) |
12258
41af2274953d
Add HedgeEditor schemes as recommended on https://hedgewars.org/HedgeEditor
Wuzzy <almikes@aol.com>
parents:
11811
diff
changeset
|
90 |
<< qMakePair(QString("Construction Mode"), QString( |
10549
6b08a29cadea
Add scheme and weaponset for Construction Mode.
mikade <redgrinner@gmail.com>
parents:
10108
diff
changeset
|
91 |
AMMOLINE_CONSTRUCTION_QT AMMOLINE_CONSTRUCTION_PROB |
6b08a29cadea
Add scheme and weaponset for Construction Mode.
mikade <redgrinner@gmail.com>
parents:
10108
diff
changeset
|
92 |
AMMOLINE_CONSTRUCTION_DELAY AMMOLINE_CONSTRUCTION_CRATE )) |
12258
41af2274953d
Add HedgeEditor schemes as recommended on https://hedgewars.org/HedgeEditor
Wuzzy <almikes@aol.com>
parents:
11811
diff
changeset
|
93 |
<< qMakePair(QString("Shoppa Pro"), QString( |
10599 | 94 |
AMMOLINE_SHOPPAPRO_QT AMMOLINE_SHOPPAPRO_PROB |
95 |
AMMOLINE_SHOPPAPRO_DELAY AMMOLINE_SHOPPAPRO_CRATE )) |
|
12258
41af2274953d
Add HedgeEditor schemes as recommended on https://hedgewars.org/HedgeEditor
Wuzzy <almikes@aol.com>
parents:
11811
diff
changeset
|
96 |
<< qMakePair(QString("HedgeEditor"), QString( |
41af2274953d
Add HedgeEditor schemes as recommended on https://hedgewars.org/HedgeEditor
Wuzzy <almikes@aol.com>
parents:
11811
diff
changeset
|
97 |
AMMOLINE_HEDGEEDITOR_QT AMMOLINE_HEDGEEDITOR_PROB |
41af2274953d
Add HedgeEditor schemes as recommended on https://hedgewars.org/HedgeEditor
Wuzzy <almikes@aol.com>
parents:
11811
diff
changeset
|
98 |
AMMOLINE_HEDGEEDITOR_DELAY AMMOLINE_HEDGEEDITOR_CRATE )) |
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5049
diff
changeset
|
99 |
; |
616 | 100 |
|
14954 | 101 |
QStringList cQuickGameMaps = QStringList() |
102 |
<< "Bamboo" |
|
103 |
<< "Bath" |
|
104 |
<< "Battlefield" |
|
105 |
<< "Blox" |
|
106 |
<< "Bubbleflow" |
|
107 |
<< "Cake" |
|
108 |
<< "Castle" |
|
109 |
<< "Cheese" |
|
110 |
<< "Cogs" |
|
111 |
<< "CrazyMission" |
|
112 |
<< "EarthRise" |
|
113 |
<< "Eyes" |
|
114 |
<< "Hammock" |
|
115 |
<< "HedgeFortress" |
|
116 |
<< "Hedgelove" |
|
117 |
<< "Hedgewars" |
|
118 |
<< "Hydrant" |
|
119 |
<< "Lonely_Island" |
|
120 |
<< "Mushrooms" |
|
121 |
<< "Octorama" |
|
122 |
<< "PirateFlag" |
|
123 |
<< "Plane" |
|
124 |
<< "Sheep" |
|
125 |
<< "Trash" |
|
126 |
<< "Tree"; |
|
127 |
||
5201 | 128 |
unsigned int colors[] = HW_TEAMCOLOR_ARRAY; |
654 | 129 |
|
130 |
QString * netHost = new QString(); |
|
5201 | 131 |
quint16 netPort = NETGAME_DEFAULT_PORT; |
1415
6fbfee0e113a
Allow build without net game server: introduce -DWITH_SERVER configuration parameter
unc0rr
parents:
1263
diff
changeset
|
132 |
|
6579 | 133 |
int season = SEASON_NONE; |
134 |
int years_since_foundation = 0; |