author | unc0rr |
Sun, 09 Dec 2007 11:25:59 +0000 | |
changeset 633 | 9050a949db21 |
parent 600 | f6e5f4e122db |
child 634 | b9db5ff5cfdb |
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> |
530 | 24 |
#include <QTime> |
184 | 25 |
|
314 | 26 |
#include "netserver.h" |
306 | 27 |
#include "game.h" |
184 | 28 |
#include "ui_hwform.h" |
29 |
||
30 |
class HWGame; |
|
31 |
class HWTeam; |
|
314 | 32 |
class HWNewNet; |
184 | 33 |
class GameUIConfig; |
412 | 34 |
class HWNetUdpServer; |
184 | 35 |
|
36 |
class HWForm : public QMainWindow |
|
37 |
{ |
|
38 |
Q_OBJECT |
|
39 |
||
40 |
public: |
|
41 |
HWForm(QWidget *parent = 0); |
|
42 |
Ui_HWForm ui; |
|
43 |
||
44 |
private slots: |
|
45 |
void GoToMain(); |
|
46 |
void GoToSinglePlayer(); |
|
47 |
void GoToSetup(); |
|
48 |
void GoToMultiplayer(); |
|
579 | 49 |
void GoToSaves(); |
184 | 50 |
void GoToDemos(); |
51 |
void GoToNet(); |
|
187 | 52 |
void GoToInfo(); |
586 | 53 |
void GoToSimpleGame(); |
587 | 54 |
void GoToTraining(); |
600 | 55 |
void GoToSelectWeapon(); |
289 | 56 |
void GoToPage(quint8 id); |
57 |
void GoBack(); |
|
530 | 58 |
void btnExitPressed(); |
59 |
void btnExitClicked(); |
|
535
a14eaf35cf4b
"Setup" button instead of "New team", exclude playing teams from setup
displacer
parents:
533
diff
changeset
|
60 |
void IntermediateSetup(); |
184 | 61 |
void NewTeam(); |
62 |
void EditTeam(); |
|
63 |
void TeamSave(); |
|
64 |
void TeamDiscard(); |
|
65 |
void SimpleGame(); |
|
66 |
void PlayDemo(); |
|
587 | 67 |
void StartTraining(); |
184 | 68 |
void NetConnect(); |
416 | 69 |
void NetConnectServer(); |
314 | 70 |
void NetStartServer(); |
184 | 71 |
void NetDisconnect(); |
72 |
void NetGameEnter(); |
|
73 |
void NetStartGame(); |
|
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
74 |
void AddNetTeam(const HWTeam& team); |
184 | 75 |
void StartMPGame(); |
448 | 76 |
void NetGameStateChanged(GameState gameState); |
306 | 77 |
void GameStateChanged(GameState gameState); |
78 |
void GameStats(char type, const QString & info); |
|
383 | 79 |
void ForcedDisconnect(); |
425 | 80 |
void ShowErrorMessage(const QString &); |
533 | 81 |
void GetRecord(bool isDemo, const QByteArray & record); |
184 | 82 |
|
83 |
private: |
|
314 | 84 |
void _NetConnect(const QString & hostName, quint16 port, const QString & nick); |
535
a14eaf35cf4b
"Setup" button instead of "New team", exclude playing teams from setup
displacer
parents:
533
diff
changeset
|
85 |
void UpdateTeamsLists(const QStringList* editable_teams=0); |
341 | 86 |
void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget); |
187 | 87 |
enum PageIDs { |
586 | 88 |
ID_PAGE_SIMPLEGAME = 0, |
89 |
ID_PAGE_SETUP_TEAM = 1, |
|
90 |
ID_PAGE_SETUP = 2, |
|
91 |
ID_PAGE_MULTIPLAYER = 3, |
|
92 |
ID_PAGE_DEMOS = 4, |
|
93 |
ID_PAGE_NET = 5, |
|
94 |
ID_PAGE_NETCFG = 6, |
|
95 |
ID_PAGE_INFO = 7, |
|
96 |
ID_PAGE_MAIN = 8, |
|
97 |
ID_PAGE_GAMESTATS = 9, |
|
587 | 98 |
ID_PAGE_SINGLEPLAYER = 10, |
600 | 99 |
ID_PAGE_TRAINING = 11, |
100 |
ID_PAGE_SELECTWEAPON = 12 |
|
187 | 101 |
}; |
184 | 102 |
HWGame * game; |
245 | 103 |
HWTeam * editedTeam; |
314 | 104 |
HWNewNet * hwnet; |
184 | 105 |
GameUIConfig * config; |
289 | 106 |
QStack<quint8> PagesStack; |
314 | 107 |
HWNetServer* pnetserver; |
412 | 108 |
HWNetUdpServer* pUdpServer; |
530 | 109 |
QTime eggTimer; |
307 | 110 |
void AddStatText(const QString & msg); |
496 | 111 |
void OnPageShown(quint8 id, quint8 lastid=0); |
184 | 112 |
}; |
113 |
||
114 |
#endif |