author | unc0rr |
Mon, 13 Apr 2009 09:27:21 +0000 | |
changeset 1978 | 8ab9949c8775 |
parent 1950 | 09ad18a1be11 |
child 2009 | 91f461c218ab |
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; |
|
1907 | 33 |
class HWNamegen; |
314 | 34 |
class HWNewNet; |
184 | 35 |
class GameUIConfig; |
634 | 36 |
class HWNetRegisterServer; |
674 | 37 |
class QCloseEvent; |
1897 | 38 |
class AmmoSchemeModel; |
184 | 39 |
|
40 |
class HWForm : public QMainWindow |
|
41 |
{ |
|
42 |
Q_OBJECT |
|
43 |
||
44 |
public: |
|
45 |
HWForm(QWidget *parent = 0); |
|
46 |
Ui_HWForm ui; |
|
47 |
||
48 |
private slots: |
|
49 |
void GoToMain(); |
|
50 |
void GoToSinglePlayer(); |
|
51 |
void GoToSetup(); |
|
52 |
void GoToMultiplayer(); |
|
579 | 53 |
void GoToSaves(); |
184 | 54 |
void GoToDemos(); |
55 |
void GoToNet(); |
|
1950 | 56 |
void GoToNetType(); |
187 | 57 |
void GoToInfo(); |
587 | 58 |
void GoToTraining(); |
600 | 59 |
void GoToSelectWeapon(); |
694 | 60 |
void GoToSelectNewWeapon(); |
646 | 61 |
void GoToNetServer(); |
1885 | 62 |
void GoToSchemes(); |
1905 | 63 |
void GoToAdmin(); |
289 | 64 |
void GoToPage(quint8 id); |
65 |
void GoBack(); |
|
530 | 66 |
void btnExitPressed(); |
67 |
void btnExitClicked(); |
|
535
a14eaf35cf4b
"Setup" button instead of "New team", exclude playing teams from setup
displacer
parents:
533
diff
changeset
|
68 |
void IntermediateSetup(); |
184 | 69 |
void NewTeam(); |
70 |
void EditTeam(); |
|
1840 | 71 |
void RandomNames(); |
72 |
void RandomName(const int &i); |
|
184 | 73 |
void TeamSave(); |
74 |
void TeamDiscard(); |
|
75 |
void SimpleGame(); |
|
76 |
void PlayDemo(); |
|
587 | 77 |
void StartTraining(); |
184 | 78 |
void NetConnect(); |
666 | 79 |
void NetConnectServer(const QString & host, quint16 port); |
1395 | 80 |
void NetConnectOfficialServer(); |
314 | 81 |
void NetStartServer(); |
184 | 82 |
void NetDisconnect(); |
1311 | 83 |
void NetConnected(); |
184 | 84 |
void NetGameEnter(); |
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
85 |
void AddNetTeam(const HWTeam& team); |
184 | 86 |
void StartMPGame(); |
306 | 87 |
void GameStateChanged(GameState gameState); |
383 | 88 |
void ForcedDisconnect(); |
425 | 89 |
void ShowErrorMessage(const QString &); |
533 | 90 |
void GetRecord(bool isDemo, const QByteArray & record); |
660 | 91 |
void CreateNetGame(); |
695 | 92 |
void UpdateWeapons(); |
1162 | 93 |
void onFrontendFullscreen(bool value); |
1235 | 94 |
void Music(bool checked); |
1409
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
95 |
void NetGameMaster(); |
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
96 |
void NetGameSlave(); |
1418 | 97 |
void AsyncNetServerStart(); |
1600 | 98 |
void NetLeftRoom(); |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
99 |
void selectFirstNetScheme(); |
660 | 100 |
|
184 | 101 |
private: |
314 | 102 |
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
|
103 |
void UpdateTeamsLists(const QStringList* editable_teams=0); |
696 | 104 |
void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget, QString ammo); |
674 | 105 |
void closeEvent(QCloseEvent *event); |
1419 | 106 |
void CustomizePalettes(); |
107 |
||
187 | 108 |
enum PageIDs { |
788
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
109 |
ID_PAGE_SETUP_TEAM = 0, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
110 |
ID_PAGE_SETUP = 1, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
111 |
ID_PAGE_MULTIPLAYER = 2, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
112 |
ID_PAGE_DEMOS = 3, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
113 |
ID_PAGE_NET = 4, |
1354
a8dcdeb88a43
Various small insignificant improvements everywhere
unc0rr
parents:
1311
diff
changeset
|
114 |
ID_PAGE_NETGAME = 5, |
788
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
115 |
ID_PAGE_INFO = 6, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
116 |
ID_PAGE_MAIN = 7, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
117 |
ID_PAGE_GAMESTATS = 8, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
118 |
ID_PAGE_SINGLEPLAYER = 9, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
119 |
ID_PAGE_TRAINING = 10, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
120 |
ID_PAGE_SELECTWEAPON = 11, |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
697
diff
changeset
|
121 |
ID_PAGE_NETSERVER = 12, |
1311 | 122 |
ID_PAGE_INGAME = 13, |
1800 | 123 |
ID_PAGE_ROOMSLIST = 14, |
1884 | 124 |
ID_PAGE_CONNECTING = 15, |
1905 | 125 |
ID_PAGE_SCHEME = 16, |
1950 | 126 |
ID_PAGE_ADMIN = 17, |
127 |
ID_PAGE_NETTYPE = 18 |
|
187 | 128 |
}; |
184 | 129 |
HWGame * game; |
1904 | 130 |
HWNetServer* pnetserver; |
131 |
HWNetRegisterServer* pRegisterServer; |
|
245 | 132 |
HWTeam * editedTeam; |
314 | 133 |
HWNewNet * hwnet; |
184 | 134 |
GameUIConfig * config; |
1907 | 135 |
HWNamegen * namegen; |
1897 | 136 |
AmmoSchemeModel * ammoSchemeModel; |
289 | 137 |
QStack<quint8> PagesStack; |
530 | 138 |
QTime eggTimer; |
1225
f882a92ef872
Play music in menu also, with fading effects when run game
unc0rr
parents:
1223
diff
changeset
|
139 |
SDLInteraction sdli; |
496 | 140 |
void OnPageShown(quint8 id, quint8 lastid=0); |
184 | 141 |
}; |
142 |
||
143 |
#endif |