author | displacer |
Thu, 16 Aug 2007 12:42:22 +0000 | |
changeset 570 | f674e8e5bf28 |
parent 535 | a14eaf35cf4b |
child 579 | 94db15de0392 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
2 |
* Hedgewars, a worms-like 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" |
29 |
||
30 |
class HWGame; |
|
31 |
class HWTeam; |
|
314 | 32 |
class HWNewNet; |
184 | 33 |
class GameUIConfig; |
412 | 34 |
class HWNetUdpServer; |
184 | 35 |
|
36 |
class HWForm : public QMainWindow |
|
37 |
{ |
|
38 |
Q_OBJECT |
|
39 |
||
40 |
public: |
|
41 |
HWForm(QWidget *parent = 0); |
|
42 |
Ui_HWForm ui; |
|
43 |
||
44 |
private slots: |
|
45 |
void GoToMain(); |
|
46 |
void GoToSinglePlayer(); |
|
47 |
void GoToSetup(); |
|
48 |
void GoToMultiplayer(); |
|
49 |
void GoToDemos(); |
|
50 |
void GoToNet(); |
|
187 | 51 |
void GoToInfo(); |
289 | 52 |
void GoToPage(quint8 id); |
53 |
void GoBack(); |
|
530 | 54 |
void btnExitPressed(); |
55 |
void btnExitClicked(); |
|
535
a14eaf35cf4b
"Setup" button instead of "New team", exclude playing teams from setup
displacer
parents:
533
diff
changeset
|
56 |
void IntermediateSetup(); |
184 | 57 |
void NewTeam(); |
58 |
void EditTeam(); |
|
59 |
void TeamSave(); |
|
60 |
void TeamDiscard(); |
|
61 |
void SimpleGame(); |
|
62 |
void PlayDemo(); |
|
63 |
void NetConnect(); |
|
416 | 64 |
void NetConnectServer(); |
314 | 65 |
void NetStartServer(); |
184 | 66 |
void NetDisconnect(); |
67 |
void NetGameEnter(); |
|
68 |
void NetStartGame(); |
|
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
69 |
void AddNetTeam(const HWTeam& team); |
184 | 70 |
void StartMPGame(); |
448 | 71 |
void NetGameStateChanged(GameState gameState); |
306 | 72 |
void GameStateChanged(GameState gameState); |
73 |
void GameStats(char type, const QString & info); |
|
383 | 74 |
void ForcedDisconnect(); |
425 | 75 |
void ShowErrorMessage(const QString &); |
533 | 76 |
void GetRecord(bool isDemo, const QByteArray & record); |
184 | 77 |
|
78 |
private: |
|
314 | 79 |
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
|
80 |
void UpdateTeamsLists(const QStringList* editable_teams=0); |
341 | 81 |
void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget); |
187 | 82 |
enum PageIDs { |
83 |
ID_PAGE_SINGLEPLAYER = 0, |
|
84 |
ID_PAGE_SETUP_TEAM = 1, |
|
85 |
ID_PAGE_SETUP = 2, |
|
86 |
ID_PAGE_MULTIPLAYER = 3, |
|
87 |
ID_PAGE_DEMOS = 4, |
|
88 |
ID_PAGE_NET = 5, |
|
475 | 89 |
ID_PAGE_NETCFG = 6, |
90 |
ID_PAGE_INFO = 7, |
|
91 |
ID_PAGE_MAIN = 8, |
|
92 |
ID_PAGE_GAMESTATS = 9 |
|
187 | 93 |
}; |
184 | 94 |
HWGame * game; |
245 | 95 |
HWTeam * editedTeam; |
314 | 96 |
HWNewNet * hwnet; |
184 | 97 |
GameUIConfig * config; |
289 | 98 |
QStack<quint8> PagesStack; |
314 | 99 |
HWNetServer* pnetserver; |
412 | 100 |
HWNetUdpServer* pUdpServer; |
530 | 101 |
QTime eggTimer; |
307 | 102 |
void AddStatText(const QString & msg); |
496 | 103 |
void OnPageShown(quint8 id, quint8 lastid=0); |
184 | 104 |
}; |
105 |
||
106 |
#endif |