QTfrontend/ui/widget/gamecfgwidget.h
author unc0rr
Wed, 29 May 2013 15:12:06 -0400
changeset 9080 9b42757d7e71
parent 8424 225ede46e3dc
child 9998 736015b847e3
permissions -rw-r--r--
bump copyright year for Andrey entries
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     1
/*
1066
1f1b3686a2b0 Update copyright headers a bit
unc0rr
parents: 703
diff changeset
     2
 * Hedgewars, a free turn based strategy game
9080
9b42757d7e71 bump copyright year for Andrey entries
unc0rr
parents: 8424
diff changeset
     3
 * Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com>
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     4
 *
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     8
 *
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    12
 * GNU General Public License for more details.
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    13
 *
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    14
 * You should have received a copy of the GNU General Public License
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    15
 * along with this program; if not, write to the Free Software
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    17
 */
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    18
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    19
#ifndef GAMECONFIGWIDGET_H
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    20
#define GAMECONFIGWIDGET_H
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    21
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    22
#include <QWidget>
318
46a43b02bbb3 Game config commands are generated by GameCFGWidget
unc0rr
parents: 312
diff changeset
    23
#include <QStringList>
1217
d6d91eec00f2 Remake gamecfgwidget
unc0rr
parents: 1066
diff changeset
    24
#include <QGroupBox>
1783
169ebeefd7ab Custom spinbox for bonus boxes factor
unc0rr
parents: 1782
diff changeset
    25
#include <QSpinBox>
4936
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4560
diff changeset
    26
#include <QRegExp>
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    27
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    28
#include "mapContainer.h"
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    29
311
b8905423f19f - Limit list of teams in game with 200 px
unc0rr
parents: 249
diff changeset
    30
class QCheckBox;
b8905423f19f - Limit list of teams in game with 200 px
unc0rr
parents: 249
diff changeset
    31
class QVBoxLayout;
b8905423f19f - Limit list of teams in game with 200 px
unc0rr
parents: 249
diff changeset
    32
class QLabel;
1887
d68939b3f7f0 - Share model between test table and widgets
unc0rr
parents: 1885
diff changeset
    33
class QTableView;
8424
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    34
class QTabWidget;
311
b8905423f19f - Limit list of teams in game with 200 px
unc0rr
parents: 249
diff changeset
    35
1217
d6d91eec00f2 Remake gamecfgwidget
unc0rr
parents: 1066
diff changeset
    36
class GameCFGWidget : public QGroupBox
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    37
{
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    38
        Q_OBJECT
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    39
8377
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 6960
diff changeset
    40
        Q_PROPERTY(bool master READ isMaster WRITE setMaster)
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 6960
diff changeset
    41
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    42
    public:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    43
        GameCFGWidget(QWidget* parent);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    44
        quint32 getGameFlags() const;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    45
        quint32 getInitHealth() const;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    46
        QByteArray getFullConfig() const;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    47
        QComboBox * Scripts;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    48
        QComboBox * GameSchemes;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    49
        QComboBox * WeaponsName;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    50
        HWMapContainer* pMapContainer;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    51
        QTableView * tv;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    52
        QVariant schemeData(int column) const;
8377
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 6960
diff changeset
    53
        bool isMaster();
696
d6f32ed6edc8 working multiplayer weapons combo
displacer
parents: 486
diff changeset
    54
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    55
    public slots:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    56
        void setParam(const QString & param, const QStringList & value);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    57
        void fullNetConfig();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    58
        void resendSchemeData();
8377
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 6960
diff changeset
    59
        void setMaster(bool master);
8424
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    60
        void setTabbed(bool tabbed);
325
17c860483407 New signals and slot for GameCFGWidget
unc0rr
parents: 320
diff changeset
    61
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    62
    signals:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    63
        void paramChanged(const QString & param, const QStringList & value);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    64
        void goToSchemes(int);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    65
        void goToWeapons(int);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    66
        void goToDrawMap();
1531
f404233b6d9b - Less crossclass dependancies
unc0rr
parents: 1530
diff changeset
    67
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    68
    private slots:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    69
        void ammoChanged(int index);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    70
        void mapChanged(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    71
        void templateFilterChanged(int);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    72
        void seedChanged(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    73
        void themeChanged(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    74
        void schemeChanged(int);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    75
        void scriptChanged(int);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    76
        void jumpToSchemes();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    77
        void jumpToWeapons();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    78
        void mapgenChanged(MapGenerator m);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    79
        void maze_sizeChanged(int s);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    80
        void onDrawnMapChanged(const QByteArray & data);
6960
822f8269e13f map, theme & style selection won't be lost on data updata now (except the selected map/theme/style is deleted ofc). enabling F5 key to reload data :>
sheepluva
parents: 6952
diff changeset
    81
        void updateModelViews();
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    82
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    83
    private:
8424
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    84
        QVBoxLayout mainLayout;
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    85
        QCheckBox * bindEntries;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    86
        QString curNetAmmoName;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    87
        QString curNetAmmo;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    88
        QRegExp seedRegexp;
6960
822f8269e13f map, theme & style selection won't be lost on data updata now (except the selected map/theme/style is deleted ofc). enabling F5 key to reload data :>
sheepluva
parents: 6952
diff changeset
    89
        QString m_curScript;
8377
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 6960
diff changeset
    90
        bool m_master;
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 6960
diff changeset
    91
        QList<QWidget *> m_childWidgets;
8424
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    92
        QGridLayout * GBoxOptionsLayout;
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    93
        QWidget * OptionsInnerContainer;
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    94
        QWidget * StackContainer;
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    95
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    96
        QWidget * mapContainerFree;
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    97
        QWidget * mapContainerTabbed;
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    98
        QWidget * optionsContainerFree;
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
    99
        QWidget * optionsContainerTabbed;
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
   100
        bool tabbed;
225ede46e3dc On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents: 8377
diff changeset
   101
        QTabWidget * tabs;
1873
815a3ff1fe4b Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents: 1802
diff changeset
   102
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   103
        void setNetAmmo(const QString& name, const QString& ammo);
1890
de5cfe3beb22 Scheme options work now
unc0rr
parents: 1887
diff changeset
   104
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   105
};
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   106
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   107
#endif // GAMECONFIGWIDGET_H