# HG changeset patch # User unc0rr # Date 1198707382 0 # Node ID 494b5880989abdd895d8abb9d7822f777ba868d1 # Parent 6bf4d8dc6b06765c21ea0f1dc1a1e7eae6598b11 - Header cleanup in game.cpp - Page 'in game' to hide frontend interface during the game diff -r 6bf4d8dc6b06 -r 494b5880989a QTfrontend/game.cpp --- a/QTfrontend/game.cpp Wed Dec 26 21:08:25 2007 +0000 +++ b/QTfrontend/game.cpp Wed Dec 26 22:16:22 2007 +0000 @@ -16,14 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include -#include -#include #include #include -#include -#include -#include #include "game.h" #include "hwconsts.h" @@ -46,6 +40,7 @@ HWGame::~HWGame() { + SetGameState(gsDestroyed); } void HWGame::onClientDisconnect() diff -r 6bf4d8dc6b06 -r 494b5880989a QTfrontend/game.h --- a/QTfrontend/game.h Wed Dec 26 21:08:25 2007 +0000 +++ b/QTfrontend/game.h Wed Dec 26 22:16:22 2007 +0000 @@ -33,7 +33,8 @@ gsStarted = 1, gsInterrupted = 2, gsFinished = 3, - gsStopped = 4 + gsStopped = 4, + gsDestroyed = 5 }; diff -r 6bf4d8dc6b06 -r 494b5880989a QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Wed Dec 26 21:08:25 2007 +0000 +++ b/QTfrontend/hwform.cpp Wed Dec 26 22:16:22 2007 +0000 @@ -509,10 +509,15 @@ break; } case gsFinished: { + GoBack(); GoToPage(ID_PAGE_GAMESTATS); break; } - default: ; + default: { + quint8 id = ui.Pages->currentIndex(); +qDebug() << id; + if (id == ID_PAGE_INGAME) GoBack(); + }; } if (hwnet) @@ -557,6 +562,8 @@ connect(game, SIGNAL(GameStats(char, const QString &)), this, SLOT(GameStats(char, const QString &))); connect(game, SIGNAL(ErrorMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection); connect(game, SIGNAL(HaveRecord(bool, const QByteArray &)), this, SLOT(GetRecord(bool, const QByteArray &))); + + GoToPage(ID_PAGE_INGAME); } void HWForm::ShowErrorMessage(const QString & msg) diff -r 6bf4d8dc6b06 -r 494b5880989a QTfrontend/hwform.h --- a/QTfrontend/hwform.h Wed Dec 26 21:08:25 2007 +0000 +++ b/QTfrontend/hwform.h Wed Dec 26 22:16:22 2007 +0000 @@ -101,7 +101,8 @@ ID_PAGE_SINGLEPLAYER = 10, ID_PAGE_TRAINING = 11, ID_PAGE_SELECTWEAPON = 12, - ID_PAGE_NETSERVER = 13 + ID_PAGE_NETSERVER = 13, + ID_PAGE_INGAME = 14 }; HWGame * game; HWTeam * editedTeam; diff -r 6bf4d8dc6b06 -r 494b5880989a QTfrontend/pages.cpp --- a/QTfrontend/pages.cpp Wed Dec 26 21:08:25 2007 +0000 +++ b/QTfrontend/pages.cpp Wed Dec 26 22:16:22 2007 +0000 @@ -687,3 +687,9 @@ BtnSave = addButton("Save", pageLayout, 1, 2); } +PageInGame::PageInGame(QWidget* parent) : + AbstractPage(parent) +{ + QLabel * label = new QLabel(this); + label->setText("In game..."); +} diff -r 6bf4d8dc6b06 -r 494b5880989a QTfrontend/pages.h --- a/QTfrontend/pages.h Wed Dec 26 21:08:25 2007 +0000 +++ b/QTfrontend/pages.h Wed Dec 26 22:16:22 2007 +0000 @@ -308,4 +308,12 @@ SelWeaponWidget* pWeapons; }; +class PageInGame : public AbstractPage +{ + Q_OBJECT + +public: + PageInGame(QWidget* parent = 0); +}; + #endif // PAGES_H diff -r 6bf4d8dc6b06 -r 494b5880989a QTfrontend/ui_hwform.cpp --- a/QTfrontend/ui_hwform.cpp Wed Dec 26 21:08:25 2007 +0000 +++ b/QTfrontend/ui_hwform.cpp Wed Dec 26 22:16:22 2007 +0000 @@ -95,4 +95,7 @@ pageNetServer = new PageNetServer(); Pages->addWidget(pageNetServer); + + pageInGame = new PageInGame(); + Pages->addWidget(pageInGame); } diff -r 6bf4d8dc6b06 -r 494b5880989a QTfrontend/ui_hwform.h --- a/QTfrontend/ui_hwform.h Wed Dec 26 21:08:25 2007 +0000 +++ b/QTfrontend/ui_hwform.h Wed Dec 26 22:16:22 2007 +0000 @@ -34,6 +34,7 @@ class PageSinglePlayer; class PageTraining; class PageSelectWeapon; +class PageInGame; class QStackedLayout; class QFont; class QWidget; @@ -59,6 +60,7 @@ PageSinglePlayer *pageSinglePlayer; PageTraining *pageTraining; PageSelectWeapon *pageSelectWeapon; + PageInGame *pageInGame; QStackedLayout *Pages; QFont *font14;