author | sheepluva |
Tue, 09 Sep 2014 10:48:11 +0200 | |
changeset 10409 | 0972bf43e8fc |
parent 10108 | c68cf030eded |
child 10549 | 6b08a29cadea |
permissions | -rw-r--r-- |
579 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
9998 | 3 |
* Copyright (c) 2004-2014 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 |
||
7130 | 19 |
#include <QStandardItemModel> |
20 |
||
579 | 21 |
#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
|
22 |
#include "weapons.h" |
579 | 23 |
|
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
|
24 |
// 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
|
25 |
QString * cDataDir = new QString("${HEDGEWARS_DATADIR}"); |
579 | 26 |
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
|
27 |
QString * cVersionString = new QString("${HEDGEWARS_VERSION}"); |
8650 | 28 |
QString * cRevisionString = new QString("${HEDGEWARS_REVISION}"); |
29 |
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
|
30 |
|
579 | 31 |
|
8323
ab0b618bdf13
get executable directory at runtime rather than configure time
koda
parents:
8090
diff
changeset
|
32 |
QDir * bindir = new QDir(); |
579 | 33 |
QDir * cfgdir = new QDir(); |
34 |
QDir * datadir = new QDir(); |
|
35 |
||
3932 | 36 |
bool custom_config = false; |
37 |
bool custom_data = false; |
|
38 |
||
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
|
39 |
int cMaxTeams = 8; |
10074 | 40 |
int cMinServerVersion = 3; |
3865 | 41 |
|
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
|
42 |
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
|
43 |
AMMOLINE_DEFAULT_DELAY AMMOLINE_DEFAULT_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
|
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 | 46 |
QList< QPair<QString, QString> > cDefaultAmmos = |
3971 | 47 |
QList< QPair<QString, QString> >() |
48 |
<< 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
|
49 |
<< 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
|
50 |
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
|
51 |
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
|
52 |
<< 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
|
53 |
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
|
54 |
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
|
55 |
<< 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
|
56 |
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
|
57 |
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
|
58 |
<< 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
|
59 |
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
|
60 |
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
|
61 |
<< 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
|
62 |
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
|
63 |
AMMOLINE_MINES_DELAY AMMOLINE_MINES_CRATE )) |
4231 | 64 |
<< 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
|
65 |
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
|
66 |
AMMOLINE_PORTALS_DELAY AMMOLINE_PORTALS_CRATE )) |
8605
2865389fec96
add 'One of Everything' in the weaponsets, from nemo's idea
koda
parents:
8323
diff
changeset
|
67 |
<< qMakePair(QString("One of Everything"), QString( |
2865389fec96
add 'One of Everything' in the weaponsets, from nemo's idea
koda
parents:
8323
diff
changeset
|
68 |
AMMOLINE_ONEEVERY_QT AMMOLINE_ONEEVERY_PROB |
2865389fec96
add 'One of Everything' in the weaponsets, from nemo's idea
koda
parents:
8323
diff
changeset
|
69 |
AMMOLINE_ONEEVERY_DELAY AMMOLINE_ONEEVERY_CRATE )) |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10074
diff
changeset
|
70 |
<< qMakePair(QString("Highlander"), QString( |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10074
diff
changeset
|
71 |
AMMOLINE_HIGHLANDER_QT AMMOLINE_HIGHLANDER_PROB |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10074
diff
changeset
|
72 |
AMMOLINE_HIGHLANDER_DELAY AMMOLINE_HIGHLANDER_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
|
73 |
; |
616 | 74 |
|
5201 | 75 |
unsigned int colors[] = HW_TEAMCOLOR_ARRAY; |
654 | 76 |
|
77 |
QString * netHost = new QString(); |
|
5201 | 78 |
quint16 netPort = NETGAME_DEFAULT_PORT; |
1415
6fbfee0e113a
Allow build without net game server: introduce -DWITH_SERVER configuration parameter
unc0rr
parents:
1263
diff
changeset
|
79 |
|
6579 | 80 |
int season = SEASON_NONE; |
81 |
int years_since_foundation = 0; |