author | unc0rr |
Fri, 24 Oct 2008 17:30:30 +0000 | |
changeset 1409 | d1cbe4a57ebf |
parent 1404 | 2b6b6809c2e4 |
child 1418 | 69df8f2a7cba |
permissions | -rw-r--r-- |
184 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy 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" |
1225
f882a92ef872
Play music in menu also, with fading effects when run game
unc0rr
parents:
1223
diff
changeset
|
29 |
#include "SDLs.h" |
184 | 30 |
|
31 |
class HWGame; |
|
32 |
class HWTeam; |
|
314 | 33 |
class HWNewNet; |
184 | 34 |
class GameUIConfig; |
634 | 35 |
class HWNetRegisterServer; |
674 | 36 |
class QCloseEvent; |
184 | 37 |
|
38 |
class HWForm : public QMainWindow |
|
39 |
{ |
|
40 |
Q_OBJECT |
|
41 |
||
42 |
public: |
|
43 |
HWForm(QWidget *parent = 0); |
|
44 |
Ui_HWForm ui; |
|
45 |
||
46 |
private slots: |
|
47 |
void GoToMain(); |
|
48 |
void GoToSinglePlayer(); |
|
49 |
void GoToSetup(); |
|
50 |
void GoToMultiplayer(); |
|
579 | 51 |
void GoToSaves(); |
184 | 52 |
void GoToDemos(); |
53 |
void GoToNet(); |
|
187 | 54 |
void GoToInfo(); |
587 | 55 |
void GoToTraining(); |
600 | 56 |
void GoToSelectWeapon(); |
694 | 57 |
void GoToSelectNewWeapon(); |
646 | 58 |
void GoToNetServer(); |
289 | 59 |
void GoToPage(quint8 id); |
60 |
void GoBack(); |
|
530 | 61 |
void btnExitPressed(); |
62 |
void btnExitClicked(); |
|
535
a14eaf35cf4b
"Setup" button instead of "New team", exclude playing teams from setup
displacer
parents:
533
diff
changeset
|
63 |
void IntermediateSetup(); |
184 | 64 |
void NewTeam(); |
65 |
void EditTeam(); |
|
66 |
void TeamSave(); |
|
67 |
void TeamDiscard(); |
|
68 |
void SimpleGame(); |
|
69 |
void PlayDemo(); |
|
587 | 70 |
void StartTraining(); |
184 | 71 |
void NetConnect(); |
666 | 72 |
void NetConnectServer(const QString & host, quint16 port); |
1395 | 73 |
void NetConnectOfficialServer(); |
314 | 74 |
void NetStartServer(); |
184 | 75 |
void NetDisconnect(); |
1311 | 76 |
void NetConnected(); |
184 | 77 |
void NetGameEnter(); |
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
78 |
void AddNetTeam(const HWTeam& team); |
184 | 79 |
void StartMPGame(); |
306 | 80 |
void GameStateChanged(GameState gameState); |
81 |
void GameStats(char type, const QString & info); |
|
383 | 82 |
void ForcedDisconnect(); |
425 | 83 |
void ShowErrorMessage(const QString &); |
533 | 84 |
void GetRecord(bool isDemo, const QByteArray & record); |
660 | 85 |
void CreateNetGame(); |
695 | 86 |
void UpdateWeapons(); |
697 | 87 |
void NetWeaponNameChanged(const QString& name); |
1162 | 88 |
void onFrontendFullscreen(bool value); |
1235 | 89 |
void Music(bool checked); |
1409
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
90 |
void NetGameMaster(); |
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
91 |
void NetGameSlave(); |
660 | 92 |
|
184 | 93 |
private: |
314 | 94 |
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
|
95 |
void UpdateTeamsLists(const QStringList* editable_teams=0); |
696 | 96 |
void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget, QString ammo); |
674 | 97 |
void closeEvent(QCloseEvent *event); |
187 | 98 |
enum PageIDs { |
788
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
99 |
ID_PAGE_SETUP_TEAM = 0, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
100 |
ID_PAGE_SETUP = 1, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
101 |
ID_PAGE_MULTIPLAYER = 2, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
102 |
ID_PAGE_DEMOS = 3, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
103 |
ID_PAGE_NET = 4, |
1354
a8dcdeb88a43
Various small insignificant improvements everywhere
unc0rr
parents:
1311
diff
changeset
|
104 |
ID_PAGE_NETGAME = 5, |
788
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
105 |
ID_PAGE_INFO = 6, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
106 |
ID_PAGE_MAIN = 7, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
107 |
ID_PAGE_GAMESTATS = 8, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
108 |
ID_PAGE_SINGLEPLAYER = 9, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
109 |
ID_PAGE_TRAINING = 10, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
110 |
ID_PAGE_SELECTWEAPON = 11, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
111 |
ID_PAGE_NETSERVER = 12, |
1311 | 112 |
ID_PAGE_INGAME = 13, |
113 |
ID_PAGE_ROOMSLIST = 14 |
|
187 | 114 |
}; |
184 | 115 |
HWGame * game; |
245 | 116 |
HWTeam * editedTeam; |
314 | 117 |
HWNewNet * hwnet; |
184 | 118 |
GameUIConfig * config; |
289 | 119 |
QStack<quint8> PagesStack; |
314 | 120 |
HWNetServer* pnetserver; |
634 | 121 |
HWNetRegisterServer* pRegisterServer; |
530 | 122 |
QTime eggTimer; |
1225
f882a92ef872
Play music in menu also, with fading effects when run game
unc0rr
parents:
1223
diff
changeset
|
123 |
SDLInteraction sdli; |
307 | 124 |
void AddStatText(const QString & msg); |
496 | 125 |
void OnPageShown(quint8 id, quint8 lastid=0); |
184 | 126 |
}; |
127 |
||
128 |
#endif |