author | displacer |
Thu, 08 Feb 2007 19:03:23 +0000 | |
changeset 416 | 595d8663254d |
parent 412 | 2ddcc3e3e644 |
child 425 | a7e1dabc8fb7 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
2 |
* Hedgewars, a worms-like game |
|
3 |
* Copyright (c) 2005, 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 |
#ifndef HWFORM_H |
|
20 |
#define HWFORM_H |
|
21 |
||
22 |
#include <QLabel> |
|
23 |
#include <QLineEdit> |
|
24 |
#include <QDir> |
|
289 | 25 |
#include <QStack> |
184 | 26 |
|
314 | 27 |
#include "netserver.h" |
306 | 28 |
#include "game.h" |
184 | 29 |
#include "ui_hwform.h" |
30 |
||
31 |
class HWGame; |
|
32 |
class HWTeam; |
|
314 | 33 |
class HWNewNet; |
184 | 34 |
class GameUIConfig; |
412 | 35 |
class HWNetUdpServer; |
184 | 36 |
|
37 |
class HWForm : public QMainWindow |
|
38 |
{ |
|
39 |
Q_OBJECT |
|
40 |
||
41 |
public: |
|
42 |
HWForm(QWidget *parent = 0); |
|
43 |
Ui_HWForm ui; |
|
44 |
||
45 |
private slots: |
|
46 |
void GoToMain(); |
|
47 |
void GoToSinglePlayer(); |
|
48 |
void GoToSetup(); |
|
49 |
void GoToMultiplayer(); |
|
50 |
void GoToDemos(); |
|
51 |
void GoToNet(); |
|
52 |
void GoToNetChat(); |
|
187 | 53 |
void GoToInfo(); |
289 | 54 |
void GoToPage(quint8 id); |
55 |
void GoBack(); |
|
184 | 56 |
void NewTeam(); |
57 |
void EditTeam(); |
|
58 |
void TeamSave(); |
|
59 |
void TeamDiscard(); |
|
60 |
void SimpleGame(); |
|
61 |
void PlayDemo(); |
|
62 |
void NetConnect(); |
|
416 | 63 |
void NetConnectServer(); |
314 | 64 |
void NetStartServer(); |
184 | 65 |
void NetDisconnect(); |
66 |
void NetJoin(); |
|
67 |
void NetCreate(); |
|
68 |
void AddGame(const QString & chan); |
|
69 |
void NetGameEnter(); |
|
70 |
void NetStartGame(); |
|
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
71 |
void AddNetTeam(const HWTeam& team); |
184 | 72 |
void StartMPGame(); |
306 | 73 |
void GameStateChanged(GameState gameState); |
74 |
void GameStats(char type, const QString & info); |
|
383 | 75 |
void ForcedDisconnect(); |
184 | 76 |
|
77 |
private: |
|
314 | 78 |
void _NetConnect(const QString & hostName, quint16 port, const QString & nick); |
245 | 79 |
void UpdateTeamsLists(); |
341 | 80 |
void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget); |
187 | 81 |
enum PageIDs { |
82 |
ID_PAGE_SINGLEPLAYER = 0, |
|
83 |
ID_PAGE_SETUP_TEAM = 1, |
|
84 |
ID_PAGE_SETUP = 2, |
|
85 |
ID_PAGE_MULTIPLAYER = 3, |
|
86 |
ID_PAGE_DEMOS = 4, |
|
87 |
ID_PAGE_NET = 5, |
|
88 |
ID_PAGE_NETCHAT = 6, |
|
89 |
ID_PAGE_NETCFG = 7, |
|
90 |
ID_PAGE_INFO = 8, |
|
306 | 91 |
ID_PAGE_MAIN = 9, |
92 |
ID_PAGE_GAMESTATS = 10 |
|
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; |
307 | 101 |
void AddStatText(const QString & msg); |
311 | 102 |
void OnPageShown(quint8 id); |
184 | 103 |
}; |
104 |
||
105 |
#endif |