author | unc0rr |
Wed, 18 Mar 2009 21:43:22 +0000 | |
changeset 1902 | aeadb10c2d77 |
parent 1899 | 5763f46d7486 |
child 1904 | 20348675b015 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
486 | 3 |
* Copyright (c) 2005-2007 Andrey Korotaev <unC0Rr@gmail.com> |
184 | 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 |
#ifndef HWFORM_H |
|
20 |
#define HWFORM_H |
|
21 |
||
471 | 22 |
#include <QMainWindow> |
289 | 23 |
#include <QStack> |
530 | 24 |
#include <QTime> |
184 | 25 |
|
314 | 26 |
#include "netserver.h" |
306 | 27 |
#include "game.h" |
184 | 28 |
#include "ui_hwform.h" |
1225
f882a92ef872
Play music in menu also, with fading effects when run game
unc0rr
parents:
1223
diff
changeset
|
29 |
#include "SDLs.h" |
184 | 30 |
|
31 |
class HWGame; |
|
32 |
class HWTeam; |
|
314 | 33 |
class HWNewNet; |
184 | 34 |
class GameUIConfig; |
634 | 35 |
class HWNetRegisterServer; |
674 | 36 |
class QCloseEvent; |
1897 | 37 |
class AmmoSchemeModel; |
184 | 38 |
|
39 |
class HWForm : public QMainWindow |
|
40 |
{ |
|
41 |
Q_OBJECT |
|
42 |
||
43 |
public: |
|
44 |
HWForm(QWidget *parent = 0); |
|
45 |
Ui_HWForm ui; |
|
46 |
||
47 |
private slots: |
|
48 |
void GoToMain(); |
|
49 |
void GoToSinglePlayer(); |
|
50 |
void GoToSetup(); |
|
51 |
void GoToMultiplayer(); |
|
579 | 52 |
void GoToSaves(); |
184 | 53 |
void GoToDemos(); |
54 |
void GoToNet(); |
|
187 | 55 |
void GoToInfo(); |
587 | 56 |
void GoToTraining(); |
600 | 57 |
void GoToSelectWeapon(); |
694 | 58 |
void GoToSelectNewWeapon(); |
646 | 59 |
void GoToNetServer(); |
1885 | 60 |
void GoToSchemes(); |
289 | 61 |
void GoToPage(quint8 id); |
62 |
void GoBack(); |
|
530 | 63 |
void btnExitPressed(); |
64 |
void btnExitClicked(); |
|
535
a14eaf35cf4b
"Setup" button instead of "New team", exclude playing teams from setup
displacer
parents:
533
diff
changeset
|
65 |
void IntermediateSetup(); |
184 | 66 |
void NewTeam(); |
67 |
void EditTeam(); |
|
1840 | 68 |
void RandomNames(); |
69 |
void RandomName(const int &i); |
|
184 | 70 |
void TeamSave(); |
71 |
void TeamDiscard(); |
|
72 |
void SimpleGame(); |
|
73 |
void PlayDemo(); |
|
587 | 74 |
void StartTraining(); |
184 | 75 |
void NetConnect(); |
666 | 76 |
void NetConnectServer(const QString & host, quint16 port); |
1395 | 77 |
void NetConnectOfficialServer(); |
314 | 78 |
void NetStartServer(); |
184 | 79 |
void NetDisconnect(); |
1311 | 80 |
void NetConnected(); |
184 | 81 |
void NetGameEnter(); |
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
82 |
void AddNetTeam(const HWTeam& team); |
184 | 83 |
void StartMPGame(); |
306 | 84 |
void GameStateChanged(GameState gameState); |
383 | 85 |
void ForcedDisconnect(); |
425 | 86 |
void ShowErrorMessage(const QString &); |
533 | 87 |
void GetRecord(bool isDemo, const QByteArray & record); |
660 | 88 |
void CreateNetGame(); |
695 | 89 |
void UpdateWeapons(); |
1162 | 90 |
void onFrontendFullscreen(bool value); |
1235 | 91 |
void Music(bool checked); |
1409
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
92 |
void NetGameMaster(); |
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
93 |
void NetGameSlave(); |
1418 | 94 |
void AsyncNetServerStart(); |
1600 | 95 |
void NetLeftRoom(); |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
96 |
void selectFirstNetScheme(); |
660 | 97 |
|
184 | 98 |
private: |
314 | 99 |
void _NetConnect(const QString & hostName, quint16 port, const QString & nick); |
535
a14eaf35cf4b
"Setup" button instead of "New team", exclude playing teams from setup
displacer
parents:
533
diff
changeset
|
100 |
void UpdateTeamsLists(const QStringList* editable_teams=0); |
696 | 101 |
void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget, QString ammo); |
674 | 102 |
void closeEvent(QCloseEvent *event); |
1419 | 103 |
void CustomizePalettes(); |
104 |
||
187 | 105 |
enum PageIDs { |
788
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
106 |
ID_PAGE_SETUP_TEAM = 0, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
107 |
ID_PAGE_SETUP = 1, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
108 |
ID_PAGE_MULTIPLAYER = 2, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
109 |
ID_PAGE_DEMOS = 3, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
110 |
ID_PAGE_NET = 4, |
1354
a8dcdeb88a43
Various small insignificant improvements everywhere
unc0rr
parents:
1311
diff
changeset
|
111 |
ID_PAGE_NETGAME = 5, |
788
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
112 |
ID_PAGE_INFO = 6, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
113 |
ID_PAGE_MAIN = 7, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
114 |
ID_PAGE_GAMESTATS = 8, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
115 |
ID_PAGE_SINGLEPLAYER = 9, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
116 |
ID_PAGE_TRAINING = 10, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
117 |
ID_PAGE_SELECTWEAPON = 11, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
118 |
ID_PAGE_NETSERVER = 12, |
1311 | 119 |
ID_PAGE_INGAME = 13, |
1800 | 120 |
ID_PAGE_ROOMSLIST = 14, |
1884 | 121 |
ID_PAGE_CONNECTING = 15, |
122 |
ID_PAGE_SCHEME = 16 |
|
187 | 123 |
}; |
184 | 124 |
HWGame * game; |
245 | 125 |
HWTeam * editedTeam; |
314 | 126 |
HWNewNet * hwnet; |
184 | 127 |
GameUIConfig * config; |
1897 | 128 |
AmmoSchemeModel * ammoSchemeModel; |
289 | 129 |
QStack<quint8> PagesStack; |
314 | 130 |
HWNetServer* pnetserver; |
634 | 131 |
HWNetRegisterServer* pRegisterServer; |
530 | 132 |
QTime eggTimer; |
1225
f882a92ef872
Play music in menu also, with fading effects when run game
unc0rr
parents:
1223
diff
changeset
|
133 |
SDLInteraction sdli; |
496 | 134 |
void OnPageShown(quint8 id, quint8 lastid=0); |
184 | 135 |
}; |
136 |
||
137 |
#endif |