author | Grigory Ustinov <grenka@altlinux.org> |
Thu, 26 Sep 2019 16:35:46 +0300 | |
changeset 15426 | 85ed38cc5f8f |
parent 15283 | 16f389fcd462 |
permissions | -rw-r--r-- |
1621 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
11046 | 3 |
* Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
1621 | 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:
9998
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
1621 | 17 |
*/ |
18 |
||
19 |
#ifndef STATSPAGE_H |
|
20 |
#define STATSPAGE_H |
|
21 |
||
1625 | 22 |
#include <QVector> |
23 |
#include <QMap> |
|
1636 | 24 |
#include <QGraphicsView> |
5205
78138ae93820
some headers cleanup and rename of stats and playrecord pages for consistency
koda
parents:
4976
diff
changeset
|
25 |
|
78138ae93820
some headers cleanup and rename of stats and playrecord pages for consistency
koda
parents:
4976
diff
changeset
|
26 |
#include "AbstractPage.h" |
1621 | 27 |
|
1636 | 28 |
class FitGraphicsView : public QGraphicsView |
29 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
30 |
Q_OBJECT |
1636 | 31 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
32 |
public: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
33 |
FitGraphicsView(QWidget* parent = 0); |
1636 | 34 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
35 |
protected: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
36 |
void resizeEvent(QResizeEvent * event); |
1636 | 37 |
}; |
1625 | 38 |
|
1621 | 39 |
class PageGameStats : public AbstractPage |
40 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
41 |
Q_OBJECT |
1621 | 42 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
43 |
public: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
44 |
PageGameStats(QWidget* parent = 0); |
1621 | 45 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
46 |
QPushButton *btnSave; |
8901
505307b9735d
implementation of a restart-game button. location and appearance is not final :P
thunderstruck
parents:
6952
diff
changeset
|
47 |
QPushButton *btnRestart; |
9039
24e1ccd9326f
place better the current replay button
Periklis Ntanasis <pntanasis@gmail.com>
parents:
8901
diff
changeset
|
48 |
QLabel *mainNote; |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
49 |
QLabel *labelGameStats; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
50 |
QLabel *labelGameWin; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
51 |
QLabel *labelGameRank; |
9175
dc3c0e44f7f3
added option to change stats graph title
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9080
diff
changeset
|
52 |
QLabel *labelGraphTitle; |
9178
c0902317c823
created a new sendstat type for changing the kills label
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9177
diff
changeset
|
53 |
QString kindOfPoints; |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
54 |
FitGraphicsView * graphic; |
1622 | 55 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
56 |
public slots: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
57 |
void GameStats(char type, const QString & info); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
58 |
void clear(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
59 |
void renderStats(); |
8901
505307b9735d
implementation of a restart-game button. location and appearance is not final :P
thunderstruck
parents:
6952
diff
changeset
|
60 |
void restartBtnVisible(bool visible); |
15283
16f389fcd462
Prevent saving of demo after /lua command was used
Wuzzy <Wuzzy2@mail.ru>
parents:
15076
diff
changeset
|
61 |
void saveDemoBtnEnabled(bool enabled); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
62 |
|
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
63 |
signals: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
64 |
void saveDemoRequested(); |
8901
505307b9735d
implementation of a restart-game button. location and appearance is not final :P
thunderstruck
parents:
6952
diff
changeset
|
65 |
void restartGameRequested(); |
2377 | 66 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
67 |
private: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
68 |
void AddStatText(const QString & msg); |
15076
dc236bcd7309
Fix stats screen group boxes sometimes having no spacing
Wuzzy <Wuzzy2@mail.ru>
parents:
14955
diff
changeset
|
69 |
void applySpacing(); |
1625 | 70 |
|
13223
d0647647a697
Make chart in stats screen support negative numbers. Fixes e.g. Mutant
Wuzzy <Wuzzy2@mail.ru>
parents:
13163
diff
changeset
|
71 |
QMap<qint32, QVector<qint32> > healthPoints; |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
72 |
unsigned int playerPosition; |
13762
f0cb47f0bfaf
Fix player rankings on round draw: Clans that die in the same turn now have the same rank
Wuzzy <Wuzzy2@mail.ru>
parents:
13223
diff
changeset
|
73 |
unsigned int scriptPlayerPosition; |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
74 |
quint32 lastColor; |
9177
d5e98b81e135
fix non changing graph title and sendstat health
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9175
diff
changeset
|
75 |
bool defaultGraphTitle; |
13163 | 76 |
QScopedPointer<QGraphicsScene> m_scene; |
6009 | 77 |
|
14955
ef3352839616
Stats screen: Automatically hide empty sections
Wuzzy <Wuzzy2@mail.ru>
parents:
13762
diff
changeset
|
78 |
QLabel* labelDetails; |
ef3352839616
Stats screen: Automatically hide empty sections
Wuzzy <Wuzzy2@mail.ru>
parents:
13762
diff
changeset
|
79 |
QGroupBox* gbDetails; |
ef3352839616
Stats screen: Automatically hide empty sections
Wuzzy <Wuzzy2@mail.ru>
parents:
13762
diff
changeset
|
80 |
QGroupBox* gbRanks; |
ef3352839616
Stats screen: Automatically hide empty sections
Wuzzy <Wuzzy2@mail.ru>
parents:
13762
diff
changeset
|
81 |
QGridLayout* pageLayout; |
ef3352839616
Stats screen: Automatically hide empty sections
Wuzzy <Wuzzy2@mail.ru>
parents:
13762
diff
changeset
|
82 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
83 |
protected: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
84 |
QLayout * bodyLayoutDefinition(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
85 |
QLayout * footerLayoutDefinition(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
86 |
void connectSignals(); |
1621 | 87 |
}; |
88 |
||
89 |
#endif // STATSPAGE_H |