QTfrontend/ui/page/pagegamestats.h
author Periklis Ntanasis <pntanasis@gmail.com>
Tue, 21 May 2013 21:28:42 +0300
changeset 9039 24e1ccd9326f
parent 8901 505307b9735d
child 9080 9b42757d7e71
permissions -rw-r--r--
place better the current replay button
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1621
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
     1
/*
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
     2
 * Hedgewars, a free turn based strategy game
6952
7f70f37bbf08 license header year range adjustments
sheepluva
parents: 6700
diff changeset
     3
 * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
1621
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
     4
 *
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
     8
 *
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    12
 * GNU General Public License for more details.
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    13
 *
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    17
 */
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    18
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    19
#ifndef STATSPAGE_H
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    20
#define STATSPAGE_H
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    21
1625
37aae47943ce Initial health graphic implementation
unc0rr
parents: 1622
diff changeset
    22
#include <QVector>
37aae47943ce Initial health graphic implementation
unc0rr
parents: 1622
diff changeset
    23
#include <QMap>
1636
e528696f2177 Resize health graphic when form is resized
unc0rr
parents: 1625
diff changeset
    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
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    27
1636
e528696f2177 Resize health graphic when form is resized
unc0rr
parents: 1625
diff changeset
    28
class FitGraphicsView : public QGraphicsView
e528696f2177 Resize health graphic when form is resized
unc0rr
parents: 1625
diff changeset
    29
{
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    30
        Q_OBJECT
1636
e528696f2177 Resize health graphic when form is resized
unc0rr
parents: 1625
diff changeset
    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
e528696f2177 Resize health graphic when form is resized
unc0rr
parents: 1625
diff changeset
    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
e528696f2177 Resize health graphic when form is resized
unc0rr
parents: 1625
diff changeset
    37
};
1625
37aae47943ce Initial health graphic implementation
unc0rr
parents: 1622
diff changeset
    38
1621
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    39
class PageGameStats : public AbstractPage
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    40
{
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    41
        Q_OBJECT
1621
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    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
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    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;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    52
        FitGraphicsView * graphic;
1622
8e0d62727f01 Fully separate statistics code from main form code
unc0rr
parents: 1621
diff changeset
    53
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    54
    public slots:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    55
        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
    56
        void clear();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    57
        void renderStats();
8901
505307b9735d implementation of a restart-game button. location and appearance is not final :P
thunderstruck
parents: 6952
diff changeset
    58
        void restartBtnVisible(bool visible);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    59
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    60
    signals:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    61
        void saveDemoRequested();
8901
505307b9735d implementation of a restart-game button. location and appearance is not final :P
thunderstruck
parents: 6952
diff changeset
    62
        void restartGameRequested();
2377
f3fab2b09e0c And in frontend
nemo
parents: 1636
diff changeset
    63
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    64
    private:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    65
        void AddStatText(const QString & msg);
1625
37aae47943ce Initial health graphic implementation
unc0rr
parents: 1622
diff changeset
    66
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    67
        QMap<quint32, QVector<quint32> > healthPoints;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    68
        unsigned int playerPosition;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    69
        quint32 lastColor;
6009
14f6fc9869f2 code cleanup/etc
sheepluva
parents: 5734
diff changeset
    70
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    71
    protected:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    72
        QLayout * bodyLayoutDefinition();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    73
        QLayout * footerLayoutDefinition();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    74
        void connectSignals();
1621
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    75
};
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    76
d1ded2532d3f - svn maintenance
unc0rr
parents:
diff changeset
    77
#endif // STATSPAGE_H