author | displacer |
Thu, 15 Mar 2007 02:20:31 +0000 | |
changeset 496 | 00465a8ef129 |
parent 486 | 7ea71cd3acd5 |
child 530 | f0b962214436 |
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> |
184 | 24 |
|
314 | 25 |
#include "netserver.h" |
306 | 26 |
#include "game.h" |
184 | 27 |
#include "ui_hwform.h" |
28 |
||
29 |
class HWGame; |
|
30 |
class HWTeam; |
|
314 | 31 |
class HWNewNet; |
184 | 32 |
class GameUIConfig; |
412 | 33 |
class HWNetUdpServer; |
184 | 34 |
|
35 |
class HWForm : public QMainWindow |
|
36 |
{ |
|
37 |
Q_OBJECT |
|
38 |
||
39 |
public: |
|
40 |
HWForm(QWidget *parent = 0); |
|
41 |
Ui_HWForm ui; |
|
42 |
||
43 |
private slots: |
|
44 |
void GoToMain(); |
|
45 |
void GoToSinglePlayer(); |
|
46 |
void GoToSetup(); |
|
47 |
void GoToMultiplayer(); |
|
48 |
void GoToDemos(); |
|
49 |
void GoToNet(); |
|
187 | 50 |
void GoToInfo(); |
289 | 51 |
void GoToPage(quint8 id); |
52 |
void GoBack(); |
|
184 | 53 |
void NewTeam(); |
54 |
void EditTeam(); |
|
55 |
void TeamSave(); |
|
56 |
void TeamDiscard(); |
|
57 |
void SimpleGame(); |
|
58 |
void PlayDemo(); |
|
59 |
void NetConnect(); |
|
416 | 60 |
void NetConnectServer(); |
314 | 61 |
void NetStartServer(); |
184 | 62 |
void NetDisconnect(); |
63 |
void NetGameEnter(); |
|
64 |
void NetStartGame(); |
|
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
65 |
void AddNetTeam(const HWTeam& team); |
184 | 66 |
void StartMPGame(); |
448 | 67 |
void NetGameStateChanged(GameState gameState); |
306 | 68 |
void GameStateChanged(GameState gameState); |
69 |
void GameStats(char type, const QString & info); |
|
383 | 70 |
void ForcedDisconnect(); |
425 | 71 |
void ShowErrorMessage(const QString &); |
184 | 72 |
|
73 |
private: |
|
314 | 74 |
void _NetConnect(const QString & hostName, quint16 port, const QString & nick); |
245 | 75 |
void UpdateTeamsLists(); |
341 | 76 |
void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget); |
187 | 77 |
enum PageIDs { |
78 |
ID_PAGE_SINGLEPLAYER = 0, |
|
79 |
ID_PAGE_SETUP_TEAM = 1, |
|
80 |
ID_PAGE_SETUP = 2, |
|
81 |
ID_PAGE_MULTIPLAYER = 3, |
|
82 |
ID_PAGE_DEMOS = 4, |
|
83 |
ID_PAGE_NET = 5, |
|
475 | 84 |
ID_PAGE_NETCFG = 6, |
85 |
ID_PAGE_INFO = 7, |
|
86 |
ID_PAGE_MAIN = 8, |
|
87 |
ID_PAGE_GAMESTATS = 9 |
|
187 | 88 |
}; |
184 | 89 |
HWGame * game; |
245 | 90 |
HWTeam * editedTeam; |
314 | 91 |
HWNewNet * hwnet; |
184 | 92 |
GameUIConfig * config; |
289 | 93 |
QStack<quint8> PagesStack; |
314 | 94 |
HWNetServer* pnetserver; |
412 | 95 |
HWNetUdpServer* pUdpServer; |
307 | 96 |
void AddStatText(const QString & msg); |
496 | 97 |
void OnPageShown(quint8 id, quint8 lastid=0); |
184 | 98 |
}; |
99 |
||
100 |
#endif |