author | displacer |
Wed, 07 Feb 2007 23:01:32 +0000 | |
changeset 414 | 52e6be3a0985 |
parent 412 | 2ddcc3e3e644 |
child 416 | 595d8663254d |
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(); |
|
314 | 63 |
void NetStartServer(); |
184 | 64 |
void NetDisconnect(); |
65 |
void NetJoin(); |
|
66 |
void NetCreate(); |
|
67 |
void AddGame(const QString & chan); |
|
68 |
void NetGameEnter(); |
|
69 |
void NetStartGame(); |
|
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
70 |
void AddNetTeam(const HWTeam& team); |
184 | 71 |
void StartMPGame(); |
306 | 72 |
void GameStateChanged(GameState gameState); |
73 |
void GameStats(char type, const QString & info); |
|
383 | 74 |
void ForcedDisconnect(); |
184 | 75 |
|
76 |
private: |
|
314 | 77 |
void _NetConnect(const QString & hostName, quint16 port, const QString & nick); |
245 | 78 |
void UpdateTeamsLists(); |
341 | 79 |
void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget); |
187 | 80 |
enum PageIDs { |
81 |
ID_PAGE_SINGLEPLAYER = 0, |
|
82 |
ID_PAGE_SETUP_TEAM = 1, |
|
83 |
ID_PAGE_SETUP = 2, |
|
84 |
ID_PAGE_MULTIPLAYER = 3, |
|
85 |
ID_PAGE_DEMOS = 4, |
|
86 |
ID_PAGE_NET = 5, |
|
87 |
ID_PAGE_NETCHAT = 6, |
|
88 |
ID_PAGE_NETCFG = 7, |
|
89 |
ID_PAGE_INFO = 8, |
|
306 | 90 |
ID_PAGE_MAIN = 9, |
91 |
ID_PAGE_GAMESTATS = 10 |
|
187 | 92 |
}; |
184 | 93 |
HWGame * game; |
245 | 94 |
HWTeam * editedTeam; |
314 | 95 |
HWNewNet * hwnet; |
184 | 96 |
GameUIConfig * config; |
289 | 97 |
QStack<quint8> PagesStack; |
314 | 98 |
HWNetServer* pnetserver; |
412 | 99 |
HWNetUdpServer* pUdpServer; |
307 | 100 |
void AddStatText(const QString & msg); |
311 | 101 |
void OnPageShown(quint8 id); |
184 | 102 |
}; |
103 |
||
104 |
#endif |