author | unc0rr |
Wed, 14 Feb 2007 20:05:20 +0000 | |
changeset 442 | 57ed1444606e |
parent 425 | a7e1dabc8fb7 |
child 448 | e968e19a464c |
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(); |
425 | 76 |
void ShowErrorMessage(const QString &); |
184 | 77 |
|
78 |
private: |
|
314 | 79 |
void _NetConnect(const QString & hostName, quint16 port, const QString & nick); |
245 | 80 |
void UpdateTeamsLists(); |
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, |
|
89 |
ID_PAGE_NETCHAT = 6, |
|
90 |
ID_PAGE_NETCFG = 7, |
|
91 |
ID_PAGE_INFO = 8, |
|
306 | 92 |
ID_PAGE_MAIN = 9, |
93 |
ID_PAGE_GAMESTATS = 10 |
|
187 | 94 |
}; |
184 | 95 |
HWGame * game; |
245 | 96 |
HWTeam * editedTeam; |
314 | 97 |
HWNewNet * hwnet; |
184 | 98 |
GameUIConfig * config; |
289 | 99 |
QStack<quint8> PagesStack; |
314 | 100 |
HWNetServer* pnetserver; |
412 | 101 |
HWNetUdpServer* pUdpServer; |
307 | 102 |
void AddStatText(const QString & msg); |
311 | 103 |
void OnPageShown(quint8 id); |
184 | 104 |
}; |
105 |
||
106 |
#endif |