QTfrontend/hwconsts.h
author alfadur
Sat, 11 Jul 2020 20:33:23 +0300
changeset 15719 08e556cad305
parent 15649 b4ec4a8a8b09
permissions -rw-r--r--
improve sentry jumping out
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
583
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
     1
/*
1066
1f1b3686a2b0 Update copyright headers a bit
unc0rr
parents: 907
diff changeset
     2
 * Hedgewars, a free turn based strategy game
11046
47a8c19ecb60 more copyright fixes
sheepluva
parents: 10108
diff changeset
     3
 * Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com>
583
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
     4
 *
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
     8
 *
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    12
 * GNU General Public License for more details.
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    13
 *
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    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: 9998
diff changeset
    16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
583
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    17
 */
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    18
13339
450e37b2b4d4 Fix incorrect check for iPhone macro in hwconsts.h
Wuzzy <Wuzzy2@mail.ru>
parents: 13304
diff changeset
    19
#if !(TARGET_OS_IPHONE)
583
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    20
#include <QString>
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    21
#include <QDir>
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    22
#include <QStringList>
1967
213d368a002f Predefine some ammo schemes
unc0rr
parents: 1415
diff changeset
    23
#include <QPair>
583
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    24
5289
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents: 5201
diff changeset
    25
583
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    26
extern QString * cProtoVer;
907
a5b0b93a39c8 Use constant generated by cmake for version string
unc0rr
parents: 883
diff changeset
    27
extern QString * cVersionString;
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
    28
extern QString * cRevisionString;
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
    29
extern QString * cHashString;
583
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    30
extern QString * cDataDir;
14839
e239378a9400 Prevent entering “/”, “\” and “:” in team and scheme names.
Wuzzy <Wuzzy2@mail.ru>
parents: 14737
diff changeset
    31
extern QString * cSafeFileNameRegExp;
583
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    32
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    33
extern QDir * bindir;
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    34
extern QDir * cfgdir;
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    35
extern QDir * datadir;
f7bc4bee2850 Oops, forgot file
unc0rr
parents:
diff changeset
    36
3932
2fc211f60015 Engine:
smaxx
parents: 3876
diff changeset
    37
extern bool custom_config;
2fc211f60015 Engine:
smaxx
parents: 3876
diff changeset
    38
extern bool custom_data;
2fc211f60015 Engine:
smaxx
parents: 3876
diff changeset
    39
3865
0b1c426b035f Frontend:
smaxx
parents: 3236
diff changeset
    40
extern int cMaxTeams;
13486
4ef83bcb850b Clean up cMaxHHs and cMaxTeams a bit, get rid of hardcoded numbers
Wuzzy <Wuzzy2@mail.ru>
parents: 13339
diff changeset
    41
extern int cMaxHHs;
4973
53411a26df7e Add server version (which is separate from protocol version) and a check in frontend for a new enough server (currently only qWarning)
unc0rr
parents: 4513
diff changeset
    42
extern int cMinServerVersion;
14737
123aaa2bf4b5 Make dark clan colors visible in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 13582
diff changeset
    43
extern unsigned char cInvertTextColorAt;
3865
0b1c426b035f Frontend:
smaxx
parents: 3236
diff changeset
    44
7130
fcab1fd02bc6 - Allow switching colors with mouse wheel
unc0rr
parents: 7007
diff changeset
    45
class QStandardItemModel;
5289
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents: 5201
diff changeset
    46
607
26a91a9f5514 Now trainings can have custom ammostore
unc0rr
parents: 583
diff changeset
    47
extern QString * cDefaultAmmoStore;
11763
59e979b1408f Add empty weapons scheme (instead of default) when using “New” button
Wuzzy <almikes@aol.com>
parents: 11046
diff changeset
    48
extern QString * cEmptyAmmoStore;
2369
c3eb11f1ab3a Implement probability editor for weapon schemes (engine doesn't support that yet)
unc0rr
parents: 1967
diff changeset
    49
extern int cAmmoNumber;
1967
213d368a002f Predefine some ammo schemes
unc0rr
parents: 1415
diff changeset
    50
extern QList< QPair<QString, QString> > cDefaultAmmos;
14954
f59b7f5cf6e8 Quick games are more random
Wuzzy <Wuzzy2@mail.ru>
parents: 14839
diff changeset
    51
extern QStringList cQuickGameMaps;
616
00928b3cf505 Use same team colors everywhere
unc0rr
parents: 607
diff changeset
    52
7258
722e8a0d89dc - Move colorsModel to appropriate place
unc0rr
parents: 7130
diff changeset
    53
extern unsigned int colors[];
15638
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
    54
extern unsigned int ammoMenuAmmos[];
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
    55
extern int cAmmoMenuRows;
654
1019b8fa8638 Finish asking host/port dialog implementation
unc0rr
parents: 616
diff changeset
    56
1019b8fa8638 Finish asking host/port dialog implementation
unc0rr
parents: 616
diff changeset
    57
extern QString * netHost;
1019b8fa8638 Finish asking host/port dialog implementation
unc0rr
parents: 616
diff changeset
    58
extern quint16 netPort;
1415
6fbfee0e113a Allow build without net game server: introduce -DWITH_SERVER configuration parameter
unc0rr
parents: 1210
diff changeset
    59
6579
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    60
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    61
//Current season, SEASON_NONE by default
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    62
extern int season;
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    63
//On the day of hedgewars birthday (Oct 31st) this variable is assigned
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    64
//with number of years past 2004 (foundation of hedgewars)
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    65
//Could be used to implement a text/graphic like "This is the xxth birthday of hedgewars" or similar
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    66
extern int years_since_foundation;
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    67
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: 4976
diff changeset
    68
#endif
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: 4976
diff changeset
    69
6015
daffc14a518a cleaning up a little bit more, especially team class. we were leaking teams into heap memory on quick game starts btw
sheepluva
parents: 5771
diff changeset
    70
6579
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    71
//Different seasons; assigned to season (int)
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    72
#define SEASON_NONE 0
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    73
#define SEASON_CHRISTMAS 2
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    74
#define SEASON_HWBDAY 4
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6472
diff changeset
    75
#define SEASON_EASTER 8
13304
5ac2bdefa173 add title manipulation
nemo
parents: 12268
diff changeset
    76
#define SEASON_APRIL1 16
5201
7b9aa7aac336 * moved colours and default port from .cpp.in to .h
koda
parents: 5200
diff changeset
    77
8803
b3f37e7f9ff4 define NETGAME_DEFAULT_SERVER
koda
parents: 8636
diff changeset
    78
#define NETGAME_DEFAULT_SERVER "netserver.hedgewars.org"
5201
7b9aa7aac336 * moved colours and default port from .cpp.in to .h
koda
parents: 5200
diff changeset
    79
#define NETGAME_DEFAULT_PORT 46631
8607
59a6df839710 add icegun everywhere (default, crazy, 1oe) with a qt prob delay crate of 2
koda
parents: 8605
diff changeset
    80
#define HEDGEHOGS_PER_TEAM 8
5201
7b9aa7aac336 * moved colours and default port from .cpp.in to .h
koda
parents: 5200
diff changeset
    81
13500
d9f9e66543d7 Fix frontend showing 2 errors on engine fatal error (exit code 52)
Wuzzy <Wuzzy2@mail.ru>
parents: 13486
diff changeset
    82
//Selected engine exit codes, see hedgewars/uConsts.pas
d9f9e66543d7 Fix frontend showing 2 errors on engine fatal error (exit code 52)
Wuzzy <Wuzzy2@mail.ru>
parents: 13486
diff changeset
    83
#define HWENGINE_EXITCODE_OK 0
d9f9e66543d7 Fix frontend showing 2 errors on engine fatal error (exit code 52)
Wuzzy <Wuzzy2@mail.ru>
parents: 13486
diff changeset
    84
#define HWENGINE_EXITCODE_FATAL 52
5201
7b9aa7aac336 * moved colours and default port from .cpp.in to .h
koda
parents: 5200
diff changeset
    85
13582
517b26009073 Lua: Allow to use negative value for AddTeam to select a default clan color
Wuzzy <Wuzzy2@mail.ru>
parents: 13578
diff changeset
    86
// Default clan colors
517b26009073 Lua: Allow to use negative value for AddTeam to select a default clan color
Wuzzy <Wuzzy2@mail.ru>
parents: 13578
diff changeset
    87
// NOTE: Always keep this in sync with hedgewars/uVariables.pas (ClanColorArray)
517b26009073 Lua: Allow to use negative value for AddTeam to select a default clan color
Wuzzy <Wuzzy2@mail.ru>
parents: 13578
diff changeset
    88
12268
2eedf9e0cd6d Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents: 11811
diff changeset
    89
// see https://en.wikipedia.org/wiki/List_of_colors
5443
83cb9dd54469 set of 9 colours proposed by bugq - attempting to avoid colours that are hard to distinguish
nemo
parents: 5289
diff changeset
    90
/*define HW_TEAMCOLOR_ARRAY  {0xff007fff, /. azure          ./ \
83cb9dd54469 set of 9 colours proposed by bugq - attempting to avoid colours that are hard to distinguish
nemo
parents: 5289
diff changeset
    91
                              0xffdd0000, /. classic red    ./ \
83cb9dd54469 set of 9 colours proposed by bugq - attempting to avoid colours that are hard to distinguish
nemo
parents: 5289
diff changeset
    92
                              0xff3e9321, /. classic green  ./ \
83cb9dd54469 set of 9 colours proposed by bugq - attempting to avoid colours that are hard to distinguish
nemo
parents: 5289
diff changeset
    93
                              0xffa23dbb, /. classic purple ./ \
83cb9dd54469 set of 9 colours proposed by bugq - attempting to avoid colours that are hard to distinguish
nemo
parents: 5289
diff changeset
    94
                              0xffffb347, /. pastel orange  ./ \
83cb9dd54469 set of 9 colours proposed by bugq - attempting to avoid colours that are hard to distinguish
nemo
parents: 5289
diff changeset
    95
                              0xffcfcfc4, /. pastel gray    ./ \
83cb9dd54469 set of 9 colours proposed by bugq - attempting to avoid colours that are hard to distinguish
nemo
parents: 5289
diff changeset
    96
                              0xffbff000, /. lime           ./ \
83cb9dd54469 set of 9 colours proposed by bugq - attempting to avoid colours that are hard to distinguish
nemo
parents: 5289
diff changeset
    97
                              0xffffef00, /. yellow         ./ \
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6579
diff changeset
    98
                              // add new colors here
5443
83cb9dd54469 set of 9 colours proposed by bugq - attempting to avoid colours that are hard to distinguish
nemo
parents: 5289
diff changeset
    99
                              0 }*/
6309
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   100
/*
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   101
#define HW_TEAMCOLOR_ARRAY  { 0xffd12b42, /. red    ./ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   102
                              0xff4980c1, /. blue   ./ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   103
                              0xff6ab530, /. green  ./ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   104
                              0xffbc64c4, /. purple ./ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   105
                              0xffe76d14, /. orange ./ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   106
                              0xff3fb6e6, /. cyan   ./ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   107
                              0xffe3e90c, /. yellow ./ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   108
                              0xff61d4ac, /. mint   ./ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   109
                              0xfff1c3e1, /. pink   ./ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   110
                              // add new colors here
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   111
                              0 }*/
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   112
/* another set. this one is a merge of mikade/bugq colours w/ a bit of channel feedback */
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   113
#define HW_TEAMCOLOR_ARRAY  { 0xffff0204, /* red    */ \
5443
83cb9dd54469 set of 9 colours proposed by bugq - attempting to avoid colours that are hard to distinguish
nemo
parents: 5289
diff changeset
   114
                              0xff4980c1, /* blue   */ \
6309
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   115
                              0xff1de6ba, /* teal   */ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   116
                              0xffb541ef, /* purple */ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   117
                              0xffe55bb0, /* pink   */ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   118
                              0xff20bf00, /* green  */ \
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   119
                              0xfffe8b0e, /* orange */ \
13578
145ee99575d4 Change default clan color for brown for improved contrast
Wuzzy <Wuzzy2@mail.ru>
parents: 13500
diff changeset
   120
                              0xff8f5902, /* brown  */ \
6309
82e846e5d502 Another set of colours. These are an attempt to fuse ideas from mikade and bugq, based on channel feedback/voting.
nemo
parents: 6015
diff changeset
   121
                              0xffffff01, /* yellow */ \
5201
7b9aa7aac336 * moved colours and default port from .cpp.in to .h
koda
parents: 5200
diff changeset
   122
                              /* add new colors here */ \
7b9aa7aac336 * moved colours and default port from .cpp.in to .h
koda
parents: 5200
diff changeset
   123
                              0 }
15638
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   124
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   125
/* The ammo types, sorted in the same way as in the ammo menu */
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   126
#define HW_AMMOMENU_ARRAY {\
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   127
  3,  4, 22, 29, 51, 55,\
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   128
  1,  2, 26, 27, 40, 44,\
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   129
  5, 10, 38, 45, 54, 59,\
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   130
 12, 13, 14, 23, 25, 48,\
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   131
  9, 11, 24, 30, 31, 47,\
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   132
 16, 17, 28, 43, 50, 57,\
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   133
  6, 18, 19, 46, 53, 56,\
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   134
  8, 15, 20, 39, 41, 42,\
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   135
 34, 36, 37, 49, 52, 58,\
15649
b4ec4a8a8b09 add sentries to ammo config
alfadur
parents: 15638
diff changeset
   136
  7, 21, 32, 33, 35, 60\
15638
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   137
}
1ee7790caa0f Frontend: Sort ammos like in-game
Wuzzy <Wuzzy2@mail.ru>
parents: 14954
diff changeset
   138