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;
|
|
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();
|
|
49 |
void GoToDemos();
|
|
50 |
void GoToNet();
|
|
51 |
void GoToNetChat();
|
187
|
52 |
void GoToInfo();
|
289
|
53 |
void GoToPage(quint8 id);
|
|
54 |
void GoBack();
|
184
|
55 |
void NewTeam();
|
|
56 |
void EditTeam();
|
|
57 |
void TeamSave();
|
|
58 |
void TeamDiscard();
|
|
59 |
void SimpleGame();
|
|
60 |
void PlayDemo();
|
|
61 |
void NetConnect();
|
314
|
62 |
void NetStartServer();
|
184
|
63 |
void NetDisconnect();
|
|
64 |
void NetJoin();
|
|
65 |
void NetCreate();
|
|
66 |
void AddGame(const QString & chan);
|
322
|
67 |
void NetAddTeam(HWTeam team);
|
184
|
68 |
void NetGameEnter();
|
|
69 |
void NetStartGame();
|
|
70 |
void ChangeInNetTeams(const QStringList & teams);
|
|
71 |
void StartMPGame();
|
306
|
72 |
void GameStateChanged(GameState gameState);
|
|
73 |
void GameStats(char type, const QString & info);
|
184
|
74 |
|
|
75 |
private:
|
314
|
76 |
void _NetConnect(const QString & hostName, quint16 port, const QString & nick);
|
245
|
77 |
void UpdateTeamsLists();
|
314
|
78 |
void CreateGame(GameCFGWidget * gamecfg);
|
187
|
79 |
enum PageIDs {
|
|
80 |
ID_PAGE_SINGLEPLAYER = 0,
|
|
81 |
ID_PAGE_SETUP_TEAM = 1,
|
|
82 |
ID_PAGE_SETUP = 2,
|
|
83 |
ID_PAGE_MULTIPLAYER = 3,
|
|
84 |
ID_PAGE_DEMOS = 4,
|
|
85 |
ID_PAGE_NET = 5,
|
|
86 |
ID_PAGE_NETCHAT = 6,
|
|
87 |
ID_PAGE_NETCFG = 7,
|
|
88 |
ID_PAGE_INFO = 8,
|
306
|
89 |
ID_PAGE_MAIN = 9,
|
|
90 |
ID_PAGE_GAMESTATS = 10
|
187
|
91 |
};
|
184
|
92 |
HWGame * game;
|
245
|
93 |
HWTeam * editedTeam;
|
314
|
94 |
HWNewNet * hwnet;
|
184
|
95 |
GameUIConfig * config;
|
289
|
96 |
QStack<quint8> PagesStack;
|
314
|
97 |
HWNetServer* pnetserver;
|
307
|
98 |
void AddStatText(const QString & msg);
|
311
|
99 |
void OnPageShown(quint8 id);
|
184
|
100 |
};
|
|
101 |
|
|
102 |
#endif
|