184
|
1 |
/*
|
|
2 |
* Hedgewars, a worms-like game
|
|
3 |
* Copyright (c) 2006 Andrey Korotaev <unC0Rr@gmail.com>
|
|
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
|
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
17 |
*/
|
|
18 |
|
|
19 |
#include <QResizeEvent>
|
218
|
20 |
#include <QGroupBox>
|
|
21 |
#include <QHBoxLayout>
|
184
|
22 |
#include "gamecfgwidget.h"
|
|
23 |
|
218
|
24 |
GameCFGWidget::GameCFGWidget(QWidget* parent) :
|
184
|
25 |
QWidget(parent), mainLayout(this)
|
|
26 |
{
|
218
|
27 |
QGroupBox *GBoxMap = new QGroupBox(this);
|
|
28 |
GBoxMap->setTitle(QGroupBox::tr("Landscape"));
|
|
29 |
GBoxMap->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
|
30 |
mainLayout.addWidget(GBoxMap);
|
|
31 |
|
|
32 |
QHBoxLayout *GBoxMapLayout = new QHBoxLayout(GBoxMap);
|
|
33 |
pMapContainer = new HWMapContainer(GBoxMap);
|
|
34 |
GBoxMapLayout->addWidget(new QWidget);
|
|
35 |
GBoxMapLayout->addWidget(pMapContainer);
|
|
36 |
GBoxMapLayout->addWidget(new QWidget);
|
|
37 |
|
|
38 |
QGroupBox *GBoxOptions = new QGroupBox(this);
|
|
39 |
GBoxOptions->setTitle(QGroupBox::tr("Game scheme"));
|
|
40 |
GBoxOptions->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
|
41 |
mainLayout.addWidget(GBoxOptions);
|
|
42 |
|
|
43 |
QVBoxLayout *GBoxOptionsLayout = new QVBoxLayout(GBoxOptions);
|
|
44 |
CB_mode_Forts = new QCheckBox(GBoxOptions);
|
184
|
45 |
CB_mode_Forts->setText(QCheckBox::tr("Forts mode"));
|
218
|
46 |
GBoxOptionsLayout->addWidget(CB_mode_Forts);
|
|
47 |
|
|
48 |
mainLayout.addWidget(new QWidget, 100);
|
184
|
49 |
}
|
|
50 |
|
|
51 |
quint32 GameCFGWidget::getGameFlags()
|
|
52 |
{
|
|
53 |
quint32 result = 0;
|
|
54 |
if (CB_mode_Forts->isChecked())
|
|
55 |
result |= 1;
|
|
56 |
return result;
|
|
57 |
}
|
|
58 |
|
|
59 |
QString GameCFGWidget::getCurrentSeed() const
|
|
60 |
{
|
|
61 |
return pMapContainer->getCurrentSeed();
|
|
62 |
}
|