author | nemo |
Fri, 13 Apr 2018 14:45:09 -0400 | |
changeset 13324 | 543ab994c9bc |
parent 11046 | 47a8c19ecb60 |
child 14385 | 50c3186f05ab |
permissions | -rw-r--r-- |
5082 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
11046 | 3 |
* Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
5082 | 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 |
5082 | 17 |
*/ |
18 |
||
19 |
#include <QGridLayout> |
|
20 |
#include <QPushButton> |
|
21 |
||
5204 | 22 |
#include "pagesingleplayer.h" |
5082 | 23 |
#include "gamecfgwidget.h" |
24 |
||
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
25 |
QLayout * PageSinglePlayer::bodyLayoutDefinition() |
5082 | 26 |
{ |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
27 |
QVBoxLayout * vLayout = new QVBoxLayout(); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
28 |
|
5082 | 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); |
|
6699
83dd3447a212
exploit the new setWhatsThis feature in our desktop frontend
koda
parents:
6131
diff
changeset
|
39 |
BtnSimpleGamePage->setWhatsThis(tr("Play a quick game against the computer with random settings")); |
5082 | 40 |
topLine->addSpacing(60); |
41 |
BtnMultiplayer = addButton(":/res/Multiplayer.png", topLine, 1, true); |
|
6699
83dd3447a212
exploit the new setWhatsThis feature in our desktop frontend
koda
parents:
6131
diff
changeset
|
42 |
BtnMultiplayer->setWhatsThis(tr("Play a hotseat game against your friends, or AI teams")); |
5082 | 43 |
topLine->addStretch(); |
44 |
||
45 |
||
46 |
BtnCampaignPage = addButton(":/res/Campaign.png", middleLine, 0, true); |
|
6699
83dd3447a212
exploit the new setWhatsThis feature in our desktop frontend
koda
parents:
6131
diff
changeset
|
47 |
BtnCampaignPage->setWhatsThis(tr("Campaign Mode")); |
7201
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
6952
diff
changeset
|
48 |
BtnCampaignPage->setVisible(true); |
5082 | 49 |
|
50 |
BtnTrainPage = addButton(":/res/Trainings.png", middleLine, 1, true); |
|
6699
83dd3447a212
exploit the new setWhatsThis feature in our desktop frontend
koda
parents:
6131
diff
changeset
|
51 |
BtnTrainPage->setWhatsThis(tr("Practice your skills in a range of training missions")); |
5082 | 52 |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
53 |
return vLayout; |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
54 |
} |
6009 | 55 |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
56 |
QLayout * PageSinglePlayer::footerLayoutDefinition() |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
57 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
58 |
QHBoxLayout * bottomLine = new QHBoxLayout(); |
5082 | 59 |
bottomLine->addStretch(); |
60 |
||
61 |
BtnDemos = addButton(":/res/Record.png", bottomLine, 1, true); |
|
6699
83dd3447a212
exploit the new setWhatsThis feature in our desktop frontend
koda
parents:
6131
diff
changeset
|
62 |
BtnDemos->setWhatsThis(tr("Watch recorded demos")); |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
63 |
BtnLoad = addButton(":/res/Load.png", bottomLine, 2, true); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
64 |
BtnLoad->setStyleSheet("QPushButton{margin: 24px 0 0 0;}"); |
6699
83dd3447a212
exploit the new setWhatsThis feature in our desktop frontend
koda
parents:
6131
diff
changeset
|
65 |
BtnLoad->setWhatsThis(tr("Load a previously saved game")); |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
66 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
67 |
bottomLine->setStretch(1,0); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
68 |
bottomLine->setStretch(2,0); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
69 |
bottomLine->setAlignment(BtnDemos, Qt::AlignRight | Qt::AlignBottom); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
70 |
bottomLine->setAlignment(BtnLoad, Qt::AlignRight | Qt::AlignBottom); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
71 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
72 |
return bottomLine; |
5082 | 73 |
} |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
74 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
75 |
void PageSinglePlayer::connectSignals() |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
76 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
77 |
//TODO |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
78 |
} |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
79 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
80 |
PageSinglePlayer::PageSinglePlayer(QWidget* parent) : AbstractPage(parent) |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
81 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
82 |
initPage(); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
83 |
} |