author | unc0rr |
Wed, 21 Feb 2007 19:18:05 +0000 | |
changeset 470 | 86ca84d5da74 |
parent 461 | 105af110b0e6 |
child 471 | e1eb64ba5e9c |
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(); |
448 | 73 |
void NetGameStateChanged(GameState gameState); |
306 | 74 |
void GameStateChanged(GameState gameState); |
75 |
void GameStats(char type, const QString & info); |
|
383 | 76 |
void ForcedDisconnect(); |
425 | 77 |
void ShowErrorMessage(const QString &); |
184 | 78 |
|
79 |
private: |
|
314 | 80 |
void _NetConnect(const QString & hostName, quint16 port, const QString & nick); |
245 | 81 |
void UpdateTeamsLists(); |
341 | 82 |
void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget); |
187 | 83 |
enum PageIDs { |
84 |
ID_PAGE_SINGLEPLAYER = 0, |
|
85 |
ID_PAGE_SETUP_TEAM = 1, |
|
86 |
ID_PAGE_SETUP = 2, |
|
87 |
ID_PAGE_MULTIPLAYER = 3, |
|
88 |
ID_PAGE_DEMOS = 4, |
|
89 |
ID_PAGE_NET = 5, |
|
90 |
ID_PAGE_NETCHAT = 6, |
|
91 |
ID_PAGE_NETCFG = 7, |
|
92 |
ID_PAGE_INFO = 8, |
|
306 | 93 |
ID_PAGE_MAIN = 9, |
94 |
ID_PAGE_GAMESTATS = 10 |
|
187 | 95 |
}; |
184 | 96 |
HWGame * game; |
245 | 97 |
HWTeam * editedTeam; |
314 | 98 |
HWNewNet * hwnet; |
184 | 99 |
GameUIConfig * config; |
289 | 100 |
QStack<quint8> PagesStack; |
314 | 101 |
HWNetServer* pnetserver; |
412 | 102 |
HWNetUdpServer* pUdpServer; |
307 | 103 |
void AddStatText(const QString & msg); |
311 | 104 |
void OnPageShown(quint8 id); |
184 | 105 |
}; |
106 |
||
107 |
#endif |