|
1 /* |
|
2 * Hedgewars, a free turn based strategy game |
|
3 * Copyright (c) 2006-2011 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 <QGridLayout> |
|
20 #include <QPushButton> |
|
21 |
|
22 #include "pagesingleplayer.h" |
|
23 #include "gamecfgwidget.h" |
|
24 |
|
25 QLayout * PageSinglePlayer::bodyLayoutDefinition() |
|
26 { |
|
27 QVBoxLayout * vLayout = new QVBoxLayout(); |
|
28 |
|
29 QHBoxLayout * topLine = new QHBoxLayout(); |
|
30 QHBoxLayout * middleLine = new QHBoxLayout(); |
|
31 vLayout->addStretch(); |
|
32 vLayout->addLayout(topLine); |
|
33 vLayout->addSpacing(30); |
|
34 vLayout->addLayout(middleLine); |
|
35 vLayout->addStretch(); |
|
36 |
|
37 topLine->addStretch(); |
|
38 BtnSimpleGamePage = addButton(":/res/SimpleGame.png", topLine, 0, true); |
|
39 BtnSimpleGamePage->setToolTip(tr("Simple Game (a quick game against the computer, settings are chosen for you)")); |
|
40 topLine->addSpacing(60); |
|
41 BtnMultiplayer = addButton(":/res/Multiplayer.png", topLine, 1, true); |
|
42 BtnMultiplayer->setToolTip(tr("Multiplayer (play a hotseat game against your friends, or AI teams)")); |
|
43 topLine->addStretch(); |
|
44 |
|
45 |
|
46 BtnCampaignPage = addButton(":/res/Campaign.png", middleLine, 0, true); |
|
47 BtnCampaignPage->setToolTip(tr("Campaign Mode (...). IN DEVELOPMENT")); |
|
48 BtnCampaignPage->setVisible(false); |
|
49 |
|
50 BtnTrainPage = addButton(":/res/Trainings.png", middleLine, 1, true); |
|
51 BtnTrainPage->setToolTip(tr("Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT")); |
|
52 |
|
53 return vLayout; |
|
54 } |
|
55 |
|
56 QLayout * PageSinglePlayer::footerLayoutDefinition() |
|
57 { |
|
58 QHBoxLayout * bottomLine = new QHBoxLayout(); |
|
59 bottomLine->addStretch(); |
|
60 |
|
61 BtnDemos = addButton(":/res/Record.png", bottomLine, 1, true); |
|
62 BtnDemos->setToolTip(tr("Demos (Watch recorded demos)")); |
|
63 BtnLoad = addButton(":/res/Load.png", bottomLine, 2, true); |
|
64 BtnLoad->setStyleSheet("QPushButton{margin: 24px 0 0 0;}"); |
|
65 BtnLoad->setToolTip(tr("Load (Load a previously saved game)")); |
|
66 |
|
67 bottomLine->setStretch(1,0); |
|
68 bottomLine->setStretch(2,0); |
|
69 bottomLine->setAlignment(BtnDemos, Qt::AlignRight | Qt::AlignBottom); |
|
70 bottomLine->setAlignment(BtnLoad, Qt::AlignRight | Qt::AlignBottom); |
|
71 |
|
72 return bottomLine; |
|
73 } |
|
74 |
|
75 void PageSinglePlayer::connectSignals() |
|
76 { |
|
77 //TODO |
|
78 } |
|
79 |
|
80 PageSinglePlayer::PageSinglePlayer(QWidget* parent) : AbstractPage(parent) |
|
81 { |
|
82 initPage(); |
|
83 } |