# HG changeset patch # User unc0rr # Date 1153780654 0 # Node ID 0f6669da2fcb8f0d3aa2f0696531dfe9ba74fe0a # Parent 207c85fbef512e7d2b1f410c71e1f88a52564a19 Start rewrite ui diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Mon Jul 24 14:03:51 2006 +0000 +++ b/QTfrontend/CMakeLists.txt Mon Jul 24 22:37:34 2006 +0000 @@ -13,7 +13,9 @@ teamselect.cpp teamselhelper.cpp frameTeam.cpp - vertScrollArea.cpp) + vertScrollArea.cpp + gameconfig.cpp + ui_hwform.cpp) if (WIN32) set(hwfr_src ${hwfr_src} res/hedgewars.rc) @@ -26,17 +28,14 @@ teamselect.h teamselhelper.h frameTeam.h - vertScrollArea.h) + vertScrollArea.h + gameconfig.h + ui_hwform.h) -set(hwfr_uis - hwform.ui) set(hwfr_rez hedgewars.qrc) -qt4_wrap_ui(hwfr_uis_h - ${hwfr_uis}) - qt4_add_resources(hwfr_rez_src ${hwfr_rez}) diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/game.cpp --- a/QTfrontend/game.cpp Mon Jul 24 14:03:51 2006 +0000 +++ b/QTfrontend/game.cpp Mon Jul 24 22:37:34 2006 +0000 @@ -40,15 +40,13 @@ #include #include "game.h" #include "hwconsts.h" +#include "gameconfig.h" -HWGame::HWGame(int Resolution, bool Fullscreen) +HWGame::HWGame(GameConfig * config) { - vid_Resolution = Resolution; - vid_Fullscreen = Fullscreen; + this->config = config; TeamCount = 0; seed = ""; - cfgdir.setPath(cfgdir.homePath()); - cfgdir.cd(".hedgewars"); } void HWGame::NewConnection() @@ -92,11 +90,14 @@ SENDIPC("eaddteam"); SendTeamConfig(0); SENDIPC("ecolor 65535"); - SENDIPC("eadd hh0 0"); - SENDIPC("eadd hh1 0"); - SENDIPC("eadd hh2 0"); - SENDIPC("eadd hh3 0"); - SENDIPC("eadd hh4 0"); + SENDIPC("eadd hh0 1"); + SENDIPC("eadd hh1 1"); + SENDIPC("eadd hh2 1"); + SENDIPC("eadd hh3 1"); + SENDIPC("eadd hh4 1"); + SENDIPC("eadd hh5 1"); + SENDIPC("eadd hh6 1"); + SENDIPC("eadd hh7 1"); SENDIPC("eaddteam"); SendTeamConfig(1); SENDIPC("ecolor 16776960"); @@ -105,6 +106,20 @@ SENDIPC("eadd hh2 1"); SENDIPC("eadd hh3 1"); SENDIPC("eadd hh4 1"); + SENDIPC("eadd hh5 1"); + SENDIPC("eadd hh6 1"); + SENDIPC("eadd hh7 1"); + SENDIPC("eaddteam"); + SendTeamConfig(1); + SENDIPC("ecolor 255"); + SENDIPC("eadd hh0 1"); + SENDIPC("eadd hh1 1"); + SENDIPC("eadd hh2 1"); + SENDIPC("eadd hh3 1"); + SENDIPC("eadd hh4 1"); + SENDIPC("eadd hh5 1"); + SENDIPC("eadd hh6 1"); + SENDIPC("eadd hh7 1"); } void HWGame::ParseMessage(const QByteArray & msg) @@ -233,12 +248,12 @@ QProcess * process; QStringList arguments; process = new QProcess; - arguments << resolutions[0][vid_Resolution]; - arguments << resolutions[1][vid_Resolution]; + arguments << resolutions[0][config->vid_Resolution()]; + arguments << resolutions[1][config->vid_Resolution()]; arguments << "16"; arguments << "46631"; - arguments << (vid_Fullscreen ? "1" : "0"); - arguments << "1"; + arguments << (config->vid_Fullscreen() ? "1" : "0"); + arguments << (config->isSoundEnabled() ? "1" : "0"); arguments << tr("en.txt"); process->start("./hwengine", arguments); } @@ -347,7 +362,7 @@ void HWGame::LocalCFG(const QString & teamname) { - QFile teamcfg(cfgdir.absolutePath() + "/" + teamname + ".cfg"); + QFile teamcfg(config->cfgdir.absolutePath() + "/" + teamname + ".cfg"); if (!teamcfg.open(QIODevice::ReadOnly)) { return ; diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/game.h --- a/QTfrontend/game.h Mon Jul 24 14:03:51 2006 +0000 +++ b/QTfrontend/game.h Mon Jul 24 22:37:34 2006 +0000 @@ -47,11 +47,13 @@ #define MAXMSGCHARS 255 #define SENDIPC(a) SendIPC(a, sizeof(a) - 1) +class GameConfig; + class HWGame : public QObject { Q_OBJECT public: - HWGame(int Resolution, bool Fullscreen); + HWGame(GameConfig * config); void AddTeam(const QString & team); void PlayDemo(const QString & demofilename); void StartLocal(); @@ -80,10 +82,8 @@ RNDStr seedgen; QByteArray * demo; QByteArray toSendBuf; - int vid_Resolution; - bool vid_Fullscreen; + GameConfig * config; GameType gameType; - QDir cfgdir; void Start(); void SendConfig(); diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/gameconfig.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/gameconfig.cpp Mon Jul 24 22:37:34 2006 +0000 @@ -0,0 +1,128 @@ +/* + * Hedgewars, a worms-like game + * Copyright (c) 2006 Andrey Korotaev + * + * Distributed under the terms of the BSD-modified licence: + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * with the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include "gameconfig.h" + +GameConfig::GameConfig(HWForm * FormWidgets) + : QObject() +{ + Form = FormWidgets; + + cfgdir.setPath(cfgdir.homePath()); + if (!cfgdir.exists(".hedgewars")) + { + if (!cfgdir.mkdir(".hedgewars")) + { + QMessageBox::critical(0, + tr("Error"), + tr("Cannot create directory %1").arg("/.hedgewars"), + tr("Quit")); + return ; + } + } + cfgdir.cd(".hedgewars"); + + QFile settings(cfgdir.absolutePath() + "/options"); + if (settings.open(QIODevice::ReadOnly)) + { + QTextStream stream(&settings); + stream.setCodec("UTF-8"); + QString str; + + while (!stream.atEnd()) + { + str = stream.readLine(); + if (str.startsWith(";")) continue; + if (str.startsWith("resolution ")) + { + Form->ui.CBResolution->setCurrentIndex(str.mid(11).toLong()); + } else + if (str.startsWith("fullscreen ")) + { + Form->ui.CBFullscreen->setChecked(str.mid(11).toLong()); + } else + if (str.startsWith("sound ")) + { + Form->ui.CBEnableSound->setChecked(str.mid(6).toLong()); + } else + if (str.startsWith("nick ")) + { + Form->ui.editNetNick->setText(str.mid(5)); + } + } + settings.close(); + } +} + +QStringList GameConfig::GetTeamsList() +{ + return cfgdir.entryList(QStringList("*.cfg")); +} + +void GameConfig::SaveOptions() +{ + QFile settings(cfgdir.absolutePath() + "/options"); + if (!settings.open(QIODevice::WriteOnly)) + { + QMessageBox::critical(0, + tr("Error"), + tr("Cannot save options to file %1").arg(settings.fileName()), + tr("Quit")); + return ; + } + QTextStream stream(&settings); + stream.setCodec("UTF-8"); + stream << "; Generated by Hedgewars, do not modify" << endl; + stream << "resolution " << Form->ui.CBResolution->currentIndex() << endl; + stream << "fullscreen " << Form->ui.CBFullscreen->isChecked() << endl; + stream << "sound " << Form->ui.CBEnableSound->isChecked() << endl; + stream << "nick " << Form->ui.editNetNick->text() << endl; + settings.close(); +} + +int GameConfig::vid_Resolution() +{ + return Form->ui.CBResolution->currentIndex(); +} + +bool GameConfig::vid_Fullscreen() +{ + return Form->ui.CBFullscreen->isChecked(); +} + +bool GameConfig::isSoundEnabled() +{ + return Form->ui.CBEnableSound->isChecked(); +} diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/gameconfig.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/gameconfig.h Mon Jul 24 22:37:34 2006 +0000 @@ -0,0 +1,63 @@ +/* + * Hedgewars, a worms-like game + * Copyright (c) 2006 Andrey Korotaev + * + * Distributed under the terms of the BSD-modified licence: + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * with the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef GAMECONFIG_H +#define GAMECONFIG_H + +#include +#include +#include +#include "hwform.h" + +class GameConfig : public QObject +{ + Q_OBJECT + +public: + GameConfig(HWForm * FormWidgets); + QStringList GetTeamsList(); + QDir cfgdir; + int vid_Resolution(); + bool vid_Fullscreen(); + bool isSoundEnabled(); + +private slots: + +public slots: + void SaveOptions(); + +private: + HWForm * Form; +}; + +#endif diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/hedgewars.pro --- a/QTfrontend/hedgewars.pro Mon Jul 24 14:03:51 2006 +0000 +++ b/QTfrontend/hedgewars.pro Mon Jul 24 22:37:34 2006 +0000 @@ -21,10 +21,10 @@ teamselect.h \ teamselhelper.h \ frameTeam.h \ - vertScrollArea.h + vertScrollArea.h \ + gameconfig.h \ + ui_hwform.h -FORMS += hwform.ui - SOURCES += game.cpp \ main.cpp \ hwform.cpp \ @@ -35,7 +35,9 @@ teamselect.cpp \ teamselhelper.cpp \ frameTeam.cpp \ - vertScrollArea.cpp + vertScrollArea.cpp \ + gameconfig.cpp \ + ui_hwform.cpp TRANSLATIONS += translations/hedgewars_ru.ts diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Mon Jul 24 14:03:51 2006 +0000 +++ b/QTfrontend/hwform.cpp Mon Jul 24 22:37:34 2006 +0000 @@ -44,6 +44,7 @@ #include "hwform.h" #include "sdlkeys.h" #include "hwconsts.h" +#include "gameconfig.h" HWForm::HWForm(QWidget *parent) : QMainWindow(parent) @@ -99,65 +100,26 @@ ui.CBGrave->addItem((*it).replace(QRegExp("^(.*).png"), "\\1")); } - cfgdir.setPath(cfgdir.homePath()); - if (!cfgdir.exists(".hedgewars")) - { - if (!cfgdir.mkdir(".hedgewars")) - { - QMessageBox::critical(this, - tr("Error"), - tr("Cannot create directory %1").arg("/.hedgewars"), - tr("Quit")); - return ; - } - } - cfgdir.cd(".hedgewars"); + config = new GameConfig(this); + + QStringList teamslist = config->GetTeamsList(); - list = cfgdir.entryList(QStringList("*.cfg")); - - if(list.empty()) { + if(teamslist.empty()) { HWTeam defaultTeam("DefaultTeam"); - defaultTeam.SetCfgDir(cfgdir.absolutePath()); + defaultTeam.SetCfgDir(config->cfgdir.absolutePath()); defaultTeam.SaveToFile(); - list.push_back("DefaultTeam"); + teamslist.push_back("DefaultTeam"); } pts=new TeamSelWidget(ui.Pages->widget(ID_PAGE_SINGLEPLAYER)); - for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + for (QStringList::Iterator it = teamslist.begin(); it != teamslist.end(); ++it ) { QString tmpTeamStr=(*it).replace(QRegExp("^(.*).cfg$"), "\\1"); pts->addTeam(tmpTeamStr); ui.CBTeamName->addItem(tmpTeamStr); } - QFile settings(cfgdir.absolutePath() + "/options"); - if (settings.open(QIODevice::ReadOnly)) - { - QTextStream stream(&settings); - stream.setCodec("UTF-8"); - QString str; - - while (!stream.atEnd()) - { - str = stream.readLine(); - if (str.startsWith(";")) continue; - if (str.startsWith("resolution ")) - { - ui.CBResolution->setCurrentIndex(str.mid(11).toLong()); - } else - if (str.startsWith("fullscreen ")) - { - ui.CBFullscreen->setChecked(str.mid(11).toLong()); - } else - if (str.startsWith("nick ")) - { - ui.editNetNick->setText(str.mid(5)); - } - } - settings.close(); - } - connect(ui.BtnSPBack, SIGNAL(clicked()), this, SLOT(GoToMain())); connect(ui.BtnDemosBack, SIGNAL(clicked()), this, SLOT(GoToMain())); connect(ui.BtnSetupBack, SIGNAL(clicked()), this, SLOT(GoToMain())); @@ -174,7 +136,7 @@ connect(ui.BtnTeamSave, SIGNAL(clicked()), this, SLOT(TeamSave())); connect(ui.BtnTeamDiscard, SIGNAL(clicked()), this, SLOT(TeamDiscard())); connect(ui.BtnSimpleGame, SIGNAL(clicked()), this, SLOT(SimpleGame())); - connect(ui.BtnSaveOptions, SIGNAL(clicked()), this, SLOT(SaveOptions())); + connect(ui.BtnSaveOptions, SIGNAL(clicked()), config, SLOT(SaveOptions())); connect(ui.BtnPlayDemo, SIGNAL(clicked()), this, SLOT(PlayDemo())); connect(ui.BtnNetConnect, SIGNAL(clicked()), this, SLOT(NetConnect())); connect(ui.BtnNetChatDisconnect, SIGNAL(clicked()), this, SLOT(NetDisconnect())); @@ -234,7 +196,7 @@ void HWForm::NewTeam() { tmpTeam = new HWTeam("unnamed"); - tmpTeam->SetCfgDir(cfgdir.absolutePath()); + tmpTeam->SetCfgDir(config->cfgdir.absolutePath()); tmpTeam->SetToPage(this); ui.Pages->setCurrentIndex(ID_PAGE_SETUP_TEAM); } @@ -242,7 +204,7 @@ void HWForm::EditTeam() { tmpTeam = new HWTeam(ui.CBTeamName->currentText()); - tmpTeam->SetCfgDir(cfgdir.absolutePath()); + tmpTeam->SetCfgDir(config->cfgdir.absolutePath()); tmpTeam->LoadFromFile(); tmpTeam->SetToPage(this); ui.Pages->setCurrentIndex(ID_PAGE_SETUP_TEAM); @@ -263,7 +225,7 @@ void HWForm::SimpleGame() { - game = new HWGame(ui.CBResolution->currentIndex(), ui.CBFullscreen->isChecked()); + game = new HWGame(config); game->AddTeam("DefaultTeam"); game->AddTeam("DefaultTeam"); game->StartLocal(); @@ -281,26 +243,6 @@ ui.FortPreview->setPixmap(pix); } -void HWForm::SaveOptions() -{ - QFile settings(cfgdir.absolutePath() + "/options"); - if (!settings.open(QIODevice::WriteOnly)) - { - QMessageBox::critical(this, - tr("Error"), - tr("Cannot save options to file %1").arg(settings.fileName()), - tr("Quit")); - return ; - } - QTextStream stream(&settings); - stream.setCodec("UTF-8"); - stream << "; Generated by Hedgewars, do not modify" << endl; - stream << "resolution " << ui.CBResolution->currentIndex() << endl; - stream << "fullscreen " << ui.CBFullscreen->isChecked() << endl; - stream << "nick " << ui.editNetNick->text() << endl; - settings.close(); -} - void HWForm::PlayDemo() { QListWidgetItem * curritem = ui.DemosList->currentItem(); @@ -312,13 +254,13 @@ tr("OK")); return ; } - game = new HWGame(ui.CBResolution->currentIndex(), ui.CBFullscreen->isChecked()); + game = new HWGame(config); game->PlayDemo(QString(DATA_PATH) + "/Demos/" + curritem->text() + ".hwd_1"); } void HWForm::NetConnect() { - hwnet = new HWNet(ui.CBResolution->currentIndex(), ui.CBFullscreen->isChecked()); + hwnet = new HWNet(config); connect(hwnet, SIGNAL(Connected()), this, SLOT(GoToNetChat())); connect(hwnet, SIGNAL(AddGame(const QString &)), this, SLOT(AddGame(const QString &))); connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter())); @@ -355,7 +297,7 @@ void HWForm::NetAddTeam() { HWTeam team("DefaultTeam"); - team.SetCfgDir(cfgdir.absolutePath()); + team.SetCfgDir(config->cfgdir.absolutePath()); team.LoadFromFile(); hwnet->AddTeam(team); } diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/hwform.h --- a/QTfrontend/hwform.h Mon Jul 24 14:03:51 2006 +0000 +++ b/QTfrontend/hwform.h Mon Jul 24 22:37:34 2006 +0000 @@ -45,6 +45,8 @@ #include "netclient.h" #include "teamselect.h" +class GameConfig; + class HWForm : public QMainWindow { Q_OBJECT @@ -69,7 +71,6 @@ void TeamSave(); void TeamDiscard(); void SimpleGame(); - void SaveOptions(); void PlayDemo(); void NetConnect(); void NetDisconnect(); @@ -88,9 +89,9 @@ private: QLabel * LBind[BINDS_NUMBER]; HWGame * game; - QDir cfgdir; HWTeam * tmpTeam; HWNet * hwnet; + GameConfig * config; TeamSelWidget* pts; }; diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/netclient.cpp --- a/QTfrontend/netclient.cpp Mon Jul 24 14:03:51 2006 +0000 +++ b/QTfrontend/netclient.cpp Mon Jul 24 22:37:34 2006 +0000 @@ -35,11 +35,10 @@ #include "netclient.h" #include "game.h" -HWNet::HWNet(int Resolution, bool Fullscreen) +HWNet::HWNet(GameConfig * config) : QObject() { - gameResolution = Resolution; - gameFullscreen = Fullscreen; + this->config = config; state = nsDisconnected; IRCmsg_cmd_text = new QRegExp("^[A-Z]+ :.+$"); IRCmsg_number_param = new QRegExp("^:\\S+ [0-9]{3} .+$"); @@ -493,7 +492,7 @@ void HWNet::RunGame(const QString & seed) { - HWGame * game = new HWGame(gameResolution, gameFullscreen); + HWGame * game = new HWGame(config); connect(game, SIGNAL(SendNet(const QByteArray &)), this, SLOT(SendNet(const QByteArray &))); connect(this, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &))); connect(this, SIGNAL(LocalCFG(const QString &)), game, SLOT(LocalCFG(const QString &))); diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/netclient.h --- a/QTfrontend/netclient.h Mon Jul 24 14:03:51 2006 +0000 +++ b/QTfrontend/netclient.h Mon Jul 24 22:37:34 2006 +0000 @@ -50,12 +50,14 @@ QStringList hhs; }; +class GameConfig; + class HWNet : public QObject { Q_OBJECT public: - HWNet(int Resolution, bool Fullscreen); + HWNet(GameConfig * config); void Connect(const QString & hostName, quint16 port, const QString & nick); void Disconnect(); void JoinGame(const QString & game); @@ -99,13 +101,12 @@ quint32 opCount; netTeam teams[5]; quint8 teamsCount; - int gameResolution; - bool gameFullscreen; RNDStr seedgen; int playerscnt; int configasks; QByteArray NetBuffer; QTimer * TimerFlusher; + GameConfig * config; void RawSendNet(const QString & buf); void RawSendNet(const QByteArray & buf); diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/teamselect.cpp --- a/QTfrontend/teamselect.cpp Mon Jul 24 14:03:51 2006 +0000 +++ b/QTfrontend/teamselect.cpp Mon Jul 24 22:37:34 2006 +0000 @@ -1,69 +1,69 @@ -#include -#include -#include -#include - -#include - -#include -#include "teamselect.h" -#include "teamselhelper.h" -#include "frameTeam.h" - -void TeamSelWidget::addTeam(tmprop team) -{ - frameDontPlaying->addTeam(team); - curDontPlayingTeams.push_back(team); - QObject::connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(tmprop)), - this, SLOT(changeTeamStatus(tmprop))); -} - -void TeamSelWidget::removeTeam(tmprop team) -{ - //curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team)); -} - -void TeamSelWidget::changeTeamStatus(tmprop team) -{ - list::iterator itDontPlay=std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team); - list::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); - - if(itDontPlay==curDontPlayingTeams.end()) { - // playing team => dont playing - curDontPlayingTeams.push_back(*itPlay); - curPlayingTeams.erase(itPlay); - } else { - // dont playing team => playing - curPlayingTeams.push_back(*itDontPlay); - curDontPlayingTeams.erase(itDontPlay); - } - - FrameTeams* pRemoveTeams; - FrameTeams* pAddTeams; - if(itDontPlay==curDontPlayingTeams.end()) { - pRemoveTeams=framePlaying; - pAddTeams=frameDontPlaying; - } else { - pRemoveTeams=frameDontPlaying; - pAddTeams=framePlaying; - } - - pAddTeams->addTeam(team); - pRemoveTeams->removeTeam(team); -} - -void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color) -{ - VertScrArea* area=new VertScrArea(color); - area->setWidget(pfteams); - mainLayout.addWidget(area, 50); -} - -TeamSelWidget::TeamSelWidget(QWidget* parent) : - QWidget(parent), mainLayout(this) -{ - framePlaying=new FrameTeams(); - frameDontPlaying=new FrameTeams(); - addScrArea(framePlaying, QColor("DarkTurquoise")); - addScrArea(frameDontPlaying, QColor("LightGoldenrodYellow")); -} +#include +#include +#include +#include + +#include + +#include +#include "teamselect.h" +#include "teamselhelper.h" +#include "frameTeam.h" + +void TeamSelWidget::addTeam(tmprop team) +{ + frameDontPlaying->addTeam(team); + curDontPlayingTeams.push_back(team); + QObject::connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(tmprop)), + this, SLOT(changeTeamStatus(tmprop))); +} + +void TeamSelWidget::removeTeam(tmprop team) +{ + //curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team)); +} + +void TeamSelWidget::changeTeamStatus(tmprop team) +{ + list::iterator itDontPlay=std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team); + list::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); + + if(itDontPlay==curDontPlayingTeams.end()) { + // playing team => dont playing + curDontPlayingTeams.push_back(*itPlay); + curPlayingTeams.erase(itPlay); + } else { + // dont playing team => playing + curPlayingTeams.push_back(*itDontPlay); + curDontPlayingTeams.erase(itDontPlay); + } + + FrameTeams* pRemoveTeams; + FrameTeams* pAddTeams; + if(itDontPlay==curDontPlayingTeams.end()) { + pRemoveTeams=framePlaying; + pAddTeams=frameDontPlaying; + } else { + pRemoveTeams=frameDontPlaying; + pAddTeams=framePlaying; + } + + pAddTeams->addTeam(team); + pRemoveTeams->removeTeam(team); +} + +void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color) +{ + VertScrArea* area=new VertScrArea(color); + area->setWidget(pfteams); + mainLayout.addWidget(area, 30); +} + +TeamSelWidget::TeamSelWidget(QWidget* parent) : + QWidget(parent), mainLayout(this) +{ + framePlaying=new FrameTeams(); + frameDontPlaying=new FrameTeams(); + addScrArea(framePlaying, QColor("DarkTurquoise")); + addScrArea(frameDontPlaying, QColor("LightGoldenrodYellow")); +} diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/teamselhelper.cpp --- a/QTfrontend/teamselhelper.cpp Mon Jul 24 14:03:51 2006 +0000 +++ b/QTfrontend/teamselhelper.cpp Mon Jul 24 22:37:34 2006 +0000 @@ -11,6 +11,7 @@ TeamShowWidget::TeamShowWidget(tmprop team, QWidget * parent) : QWidget(parent), mainLayout(this), m_team(team) { + this->setMaximumHeight(30); QLabel* pixlbl=new QLabel(); pixlbl->setPixmap(QPixmap("./Data/Graphics/thinking.png")); mainLayout.addWidget(pixlbl); @@ -19,6 +20,8 @@ mainLayout.addWidget(lbl); QPushButton* butt=new QPushButton("o"); + butt->setGeometry(0, 0, 25, 25); + butt->setMaximumWidth(25); mainLayout.addWidget(butt); QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam())); diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/ui_hwform.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/ui_hwform.cpp Mon Jul 24 22:37:34 2006 +0000 @@ -0,0 +1,344 @@ +#include "ui_hwform.h" +#include +#include + +void Ui_HWForm::setupUi(QMainWindow *HWForm) +{ + SetupFonts(); + + HWForm->setObjectName(QString::fromUtf8("HWForm")); + HWForm->resize(QSize(640, 450).expandedTo(HWForm->minimumSizeHint())); + HWForm->setMinimumSize(QSize(620, 430)); + + centralWidget = new QWidget(HWForm); + centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + + SetupPages(centralWidget); + + HWForm->setCentralWidget(centralWidget); + retranslateUi(HWForm); + QObject::connect(BtnExit, SIGNAL(clicked()), HWForm, SLOT(close())); + + Pages->setCurrentIndex(0); + CBFort->setCurrentIndex(-1); + CBGrave->setCurrentIndex(-1); + BindsBox->setCurrentIndex(0); + + + QMetaObject::connectSlotsByName(HWForm); +} + +void Ui_HWForm::SetupFonts() +{ + font14 = new QFont(); + font14->setFamily(QString::fromUtf8("MS Shell Dlg")); + font14->setPointSize(14); + font14->setBold(false); + font14->setItalic(false); + font14->setUnderline(false); + font14->setWeight(50); + font14->setStrikeOut(false); +} + +void Ui_HWForm::SetupPages(QWidget *Parent) +{ + Pages = new QStackedLayout(Parent); + + pageLG = new QWidget(); + SetupPageLocalGame(pageLG); + Pages->addWidget(pageLG); + + pageET = new QWidget(); + SetupPageEditTeam(pageET); + Pages->addWidget(pageET); + + pageOpt = new QWidget(); + SetupPageOptions(pageOpt); + Pages->addWidget(pageOpt); + + pageMP = new QWidget(); + SetupPageMultiplayer(pageMP); + Pages->addWidget(pageMP); + + pagePDemo = new QWidget(); + SetupPagePlayDemo(pagePDemo); + Pages->addWidget(pagePDemo); + + pageNet = new QWidget(); + SetupPageNet(pageNet); + Pages->addWidget(pageNet); + + pageNetChat = new QWidget(); + SetupPageNetChat(pageNetChat); + Pages->addWidget(pageNetChat); + + pageNetGame = new QWidget(); + SetupPageNetGame(pageNetGame); + Pages->addWidget(pageNetGame); + + pageMain = new QWidget(); + SetupPageMain(pageMain); + Pages->addWidget(pageMain); +} + +void Ui_HWForm::SetupPageLocalGame(QWidget *Parent) +{ + BtnSimpleGame = new QPushButton(Parent); + BtnSimpleGame->setGeometry(QRect(330, 380, 161, 41)); + BtnSimpleGame->setFont(*font14); + BtnSimpleGame->setCheckable(false); + BtnSimpleGame->setChecked(false); + BtnSPBack = new QPushButton(Parent); + BtnSPBack->setGeometry(QRect(120, 380, 161, 41)); + BtnSPBack->setFont(*font14); + BtnSPBack->setCheckable(false); + BtnSPBack->setChecked(false); + +} + +void Ui_HWForm::SetupPageEditTeam(QWidget *Parent) +{ + GBoxHedgehogs = new QGroupBox(Parent); + GBoxHedgehogs->setGeometry(QRect(20, 70, 161, 261)); + GBoxTeam = new QGroupBox(Parent); + GBoxTeam->setGeometry(QRect(20, 10, 161, 51)); + GBoxFort = new QGroupBox(Parent); + GBoxFort->setGeometry(QRect(420, 110, 181, 221)); + CBFort = new QComboBox(GBoxFort); + CBFort->setGeometry(QRect(10, 20, 161, 21)); + CBFort->setMaxCount(65535); + FortPreview = new QLabel(GBoxFort); + FortPreview->setGeometry(QRect(10, 50, 161, 161)); + FortPreview->setPixmap(QPixmap()); + FortPreview->setScaledContents(true); + GBoxGrave = new QGroupBox(Parent); + GBoxGrave->setGeometry(QRect(420, 10, 181, 91)); + CBGrave = new QComboBox(GBoxGrave); + CBGrave->setGeometry(QRect(10, 20, 161, 21)); + CBGrave->setMaxCount(65535); + GravePreview = new QLabel(GBoxGrave); + GravePreview->setGeometry(QRect(80, 50, 32, 32)); + GravePreview->setScaledContents(true); + GBoxBinds = new QGroupBox(Parent); + GBoxBinds->setGeometry(QRect(200, 10, 201, 431)); + BindsBox = new QToolBox(GBoxBinds); + BindsBox->setGeometry(QRect(10, 20, 181, 401)); + BindsBox->setLineWidth(0); + page_A = new QWidget(); + page_A->setGeometry(QRect(0, 0, 96, 26)); + BindsBox->addItem(page_A, QApplication::translate("HWForm", "Actions", 0, QApplication::UnicodeUTF8)); + page_W = new QWidget(); + page_W->setObjectName(QString::fromUtf8("page_W")); + BindsBox->addItem(page_W, QApplication::translate("HWForm", "Weapons", 0, QApplication::UnicodeUTF8)); + page_WP = new QWidget(); + page_WP->setObjectName(QString::fromUtf8("page_WP")); + BindsBox->addItem(page_WP, QApplication::translate("HWForm", "Weapon properties", 0, QApplication::UnicodeUTF8)); + page_O = new QWidget(); + page_O->setObjectName(QString::fromUtf8("page_O")); + page_O->setGeometry(QRect(0, 0, 96, 26)); + BindsBox->addItem(page_O, QApplication::translate("HWForm", "Other", 0, QApplication::UnicodeUTF8)); + BtnTeamDiscard = new QPushButton(pageET); + BtnTeamDiscard->setGeometry(QRect(440, 380, 161, 41)); + BtnTeamDiscard->setFont(*font14); + BtnTeamDiscard->setCheckable(false); + BtnTeamDiscard->setChecked(false); + BtnTeamSave = new QPushButton(Parent); + BtnTeamSave->setGeometry(QRect(20, 380, 161, 41)); + BtnTeamSave->setFont(*font14); + BtnTeamSave->setCheckable(false); + BtnTeamSave->setChecked(false); +} + +void Ui_HWForm::SetupPageOptions(QWidget *Parent) +{ + groupBox = new QGroupBox(Parent); + groupBox->setGeometry(QRect(20, 10, 591, 71)); + BtnNewTeam = new QPushButton(groupBox); + BtnNewTeam->setGeometry(QRect(10, 20, 160, 40)); + BtnNewTeam->setFont(*font14); + BtnEditTeam = new QPushButton(groupBox); + BtnEditTeam->setGeometry(QRect(400, 20, 160, 40)); + BtnEditTeam->setFont(*font14); + CBTeamName = new QComboBox(groupBox); + CBTeamName->setGeometry(QRect(200, 30, 171, 22)); + CBResolution = new QComboBox(Parent); + CBResolution->setGeometry(QRect(20, 120, 151, 22)); + CBEnableSound = new QCheckBox(Parent); + CBEnableSound->setGeometry(QRect(20, 180, 101, 18)); + CBFullscreen = new QCheckBox(Parent); + CBFullscreen->setGeometry(QRect(20, 160, 101, 18)); + label = new QLabel(Parent); + label->setGeometry(QRect(10, 233, 47, 13)); + editNetNick = new QLineEdit(Parent); + editNetNick->setGeometry(QRect(60, 230, 113, 20)); + editNetNick->setMaxLength(30); + BtnSaveOptions = new QPushButton(Parent); + BtnSaveOptions->setGeometry(QRect(20, 380, 161, 41)); + BtnSaveOptions->setFont(*font14); + BtnSaveOptions->setCheckable(false); + BtnSaveOptions->setChecked(false); + BtnSetupBack = new QPushButton(Parent); + BtnSetupBack->setGeometry(QRect(440, 380, 161, 41)); + BtnSetupBack->setFont(*font14); + BtnSetupBack->setCheckable(false); + BtnSetupBack->setChecked(false); +} + +void Ui_HWForm::SetupPageMultiplayer(QWidget *Parent) +{ + BtnMPBack = new QPushButton(Parent); + BtnMPBack->setGeometry(QRect(240, 340, 161, 41)); + BtnMPBack->setFont(*font14); + BtnMPBack->setCheckable(false); + BtnMPBack->setChecked(false); + listWidget = new QListWidget(Parent); + listWidget->setGeometry(QRect(160, 50, 221, 211)); + listWidget->setModelColumn(0); +} + +void Ui_HWForm::SetupPagePlayDemo(QWidget *Parent) +{ + BtnPlayDemo = new QPushButton(Parent); + BtnPlayDemo->setGeometry(QRect(240, 330, 161, 41)); + BtnPlayDemo->setFont(*font14); + BtnPlayDemo->setCheckable(false); + BtnPlayDemo->setChecked(false); + DemosList = new QListWidget(Parent); + DemosList->setGeometry(QRect(170, 10, 311, 311)); + BtnDemosBack = new QPushButton(Parent); + BtnDemosBack->setGeometry(QRect(240, 380, 161, 41)); + BtnDemosBack->setFont(*font14); + BtnDemosBack->setCheckable(false); + BtnDemosBack->setChecked(false); +} + +void Ui_HWForm::SetupPageNet(QWidget *Parent) +{ + BtnNetConnect = new QPushButton(Parent); + BtnNetConnect->setGeometry(QRect(250, 140, 161, 41)); + BtnNetConnect->setFont(*font14); + BtnNetConnect->setCheckable(false); + BtnNetConnect->setChecked(false); + BtnNetBack = new QPushButton(Parent); + BtnNetBack->setGeometry(QRect(250, 390, 161, 41)); + BtnNetBack->setFont(*font14); + BtnNetBack->setCheckable(false); + BtnNetBack->setChecked(false); +} + +void Ui_HWForm::SetupPageNetChat(QWidget *Parent) +{ + BtnNetChatDisconnect = new QPushButton(Parent); + BtnNetChatDisconnect->setGeometry(QRect(460, 390, 161, 41)); + BtnNetChatDisconnect->setFont(*font14); + BtnNetChatDisconnect->setCheckable(false); + BtnNetChatDisconnect->setChecked(false); + ChannelsList = new QListWidget(Parent); + ChannelsList->setGeometry(QRect(20, 10, 201, 331)); + BtnNetChatJoin = new QPushButton(Parent); + BtnNetChatJoin->setGeometry(QRect(460, 290, 161, 41)); + BtnNetChatJoin->setFont(*font14); + BtnNetChatJoin->setCheckable(false); + BtnNetChatJoin->setChecked(false); + BtnNetChatCreate = new QPushButton(Parent); + BtnNetChatCreate->setGeometry(QRect(460, 340, 161, 41)); + BtnNetChatCreate->setFont(*font14); + BtnNetChatCreate->setCheckable(false); + BtnNetChatCreate->setChecked(false); +} + +void Ui_HWForm::SetupPageNetGame(QWidget *Parent) +{ + BtnNetCFGBack = new QPushButton(Parent); + BtnNetCFGBack->setGeometry(QRect(260, 390, 161, 41)); + BtnNetCFGBack->setFont(*font14); + BtnNetCFGBack->setCheckable(false); + BtnNetCFGBack->setChecked(false); + BtnNetCFGAddTeam = new QPushButton(Parent); + BtnNetCFGAddTeam->setGeometry(QRect(260, 290, 161, 41)); + BtnNetCFGAddTeam->setFont(*font14); + BtnNetCFGAddTeam->setCheckable(false); + BtnNetCFGAddTeam->setChecked(false); + BtnNetCFGGo = new QPushButton(Parent); + BtnNetCFGGo->setGeometry(QRect(260, 340, 161, 41)); + BtnNetCFGGo->setFont(*font14); + BtnNetCFGGo->setCheckable(false); + BtnNetCFGGo->setChecked(false); + listNetTeams = new QListWidget(Parent); + listNetTeams->setGeometry(QRect(270, 30, 120, 80)); +} + +void Ui_HWForm::SetupPageMain(QWidget *Parent) +{ + QGridLayout * PageMainLayout = new QGridLayout(Parent); + PageMainLayout->setMargin(15); + BtnSinglePlayer = new QPushButton(Parent); + BtnSinglePlayer->setFont(*font14); + PageMainLayout->addWidget(BtnSinglePlayer, 0, 0); + BtnMultiplayer = new QPushButton(Parent); + BtnMultiplayer->setFont(*font14); + PageMainLayout->addWidget(BtnMultiplayer, 0, 1); + BtnNet = new QPushButton(Parent); + BtnNet->setFont(*font14); + PageMainLayout->addWidget(BtnNet, 1, 0); + BtnSetup = new QPushButton(Parent); + BtnSetup->setFont(*font14); + PageMainLayout->addWidget(BtnSetup, 1, 1); + BtnDemos = new QPushButton(Parent); + BtnDemos->setFont(*font14); + PageMainLayout->addWidget(BtnDemos, 2, 0); + BtnExit = new QPushButton(Parent); + BtnExit->setFont(*font14); + PageMainLayout->addWidget(BtnExit, 2, 1); +} + +void Ui_HWForm::retranslateUi(QMainWindow *HWForm) +{ + HWForm->setWindowTitle(QApplication::translate("HWForm", "-= by unC0Rr =-", 0, QApplication::UnicodeUTF8)); + BtnSimpleGame->setText(QApplication::translate("HWForm", "Simple Game", 0, QApplication::UnicodeUTF8)); + BtnSPBack->setText(QApplication::translate("HWForm", "Back", 0, QApplication::UnicodeUTF8)); + GBoxHedgehogs->setTitle(QApplication::translate("HWForm", "Team Members", 0, QApplication::UnicodeUTF8)); + GBoxTeam->setTitle(QApplication::translate("HWForm", "Team", 0, QApplication::UnicodeUTF8)); + GBoxFort->setTitle(QApplication::translate("HWForm", "Fort", 0, QApplication::UnicodeUTF8)); + FortPreview->setText(QApplication::translate("HWForm", "", 0, QApplication::UnicodeUTF8)); + GBoxGrave->setTitle(QApplication::translate("HWForm", "Grave", 0, QApplication::UnicodeUTF8)); + GravePreview->setText(QApplication::translate("HWForm", "", 0, QApplication::UnicodeUTF8)); + GBoxBinds->setTitle(QApplication::translate("HWForm", "Key binds", 0, QApplication::UnicodeUTF8)); + BindsBox->setItemText(BindsBox->indexOf(page_A), QApplication::translate("HWForm", "Actions", 0, QApplication::UnicodeUTF8)); + BindsBox->setItemText(BindsBox->indexOf(page_W), QApplication::translate("HWForm", "Weapons", 0, QApplication::UnicodeUTF8)); + BindsBox->setItemText(BindsBox->indexOf(page_WP), QApplication::translate("HWForm", "Weapon properties", 0, QApplication::UnicodeUTF8)); + BindsBox->setItemText(BindsBox->indexOf(page_O), QApplication::translate("HWForm", "Other", 0, QApplication::UnicodeUTF8)); + BtnTeamDiscard->setText(QApplication::translate("HWForm", "Discard", 0, QApplication::UnicodeUTF8)); + BtnTeamSave->setText(QApplication::translate("HWForm", "Save", 0, QApplication::UnicodeUTF8)); + groupBox->setTitle(QApplication::translate("HWForm", "Teams", 0, QApplication::UnicodeUTF8)); + BtnNewTeam->setText(QApplication::translate("HWForm", "New team", 0, QApplication::UnicodeUTF8)); + BtnEditTeam->setText(QApplication::translate("HWForm", "Edit team", 0, QApplication::UnicodeUTF8)); + CBResolution->addItem(QApplication::translate("HWForm", "640x480", 0, QApplication::UnicodeUTF8)); + CBResolution->addItem(QApplication::translate("HWForm", "800x600", 0, QApplication::UnicodeUTF8)); + CBResolution->addItem(QApplication::translate("HWForm", "1024x768", 0, QApplication::UnicodeUTF8)); + CBResolution->addItem(QApplication::translate("HWForm", "1280x1024", 0, QApplication::UnicodeUTF8)); + CBEnableSound->setText(QApplication::translate("HWForm", "Enable sound", 0, QApplication::UnicodeUTF8)); + CBFullscreen->setText(QApplication::translate("HWForm", "Fullscreen", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("HWForm", "Net nick", 0, QApplication::UnicodeUTF8)); + editNetNick->setText(QApplication::translate("HWForm", "unnamed", 0, QApplication::UnicodeUTF8)); + BtnSaveOptions->setText(QApplication::translate("HWForm", "Save", 0, QApplication::UnicodeUTF8)); + BtnSetupBack->setText(QApplication::translate("HWForm", "Back", 0, QApplication::UnicodeUTF8)); + BtnMPBack->setText(QApplication::translate("HWForm", "Back", 0, QApplication::UnicodeUTF8)); + BtnPlayDemo->setText(QApplication::translate("HWForm", "Play demo", 0, QApplication::UnicodeUTF8)); + BtnDemosBack->setText(QApplication::translate("HWForm", "Back", 0, QApplication::UnicodeUTF8)); + BtnNetConnect->setText(QApplication::translate("HWForm", "Connect", 0, QApplication::UnicodeUTF8)); + BtnNetBack->setText(QApplication::translate("HWForm", "Back", 0, QApplication::UnicodeUTF8)); + BtnNetChatDisconnect->setText(QApplication::translate("HWForm", "Disconnect", 0, QApplication::UnicodeUTF8)); + BtnNetChatJoin->setText(QApplication::translate("HWForm", "Join", 0, QApplication::UnicodeUTF8)); + BtnNetChatCreate->setText(QApplication::translate("HWForm", "Create", 0, QApplication::UnicodeUTF8)); + BtnNetCFGBack->setText(QApplication::translate("HWForm", "Back", 0, QApplication::UnicodeUTF8)); + BtnNetCFGAddTeam->setText(QApplication::translate("HWForm", "Add Team", 0, QApplication::UnicodeUTF8)); + BtnNetCFGGo->setText(QApplication::translate("HWForm", "Go!", 0, QApplication::UnicodeUTF8)); + BtnSinglePlayer->setText(QApplication::translate("HWForm", "Single Player", 0, QApplication::UnicodeUTF8)); + BtnMultiplayer->setText(QApplication::translate("HWForm", "Multiplayer", 0, QApplication::UnicodeUTF8)); + BtnSetup->setText(QApplication::translate("HWForm", "Setup", 0, QApplication::UnicodeUTF8)); + BtnExit->setText(QApplication::translate("HWForm", "Exit", 0, QApplication::UnicodeUTF8)); + BtnDemos->setText(QApplication::translate("HWForm", "Demos", 0, QApplication::UnicodeUTF8)); + BtnNet->setText(QApplication::translate("HWForm", "Net game", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(HWForm); +} diff -r 207c85fbef51 -r 0f6669da2fcb QTfrontend/ui_hwform.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/ui_hwform.h Mon Jul 24 22:37:34 2006 +0000 @@ -0,0 +1,108 @@ +#ifndef UI_HWFORM_H +#define UI_HWFORM_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_HWForm +{ +public: + QWidget *centralWidget; + QWidget *pageLG; + QPushButton *BtnSimpleGame; + QPushButton *BtnSPBack; + QWidget *pageET; + QGroupBox *GBoxHedgehogs; + QGroupBox *GBoxTeam; + QGroupBox *GBoxFort; + QComboBox *CBFort; + QLabel *FortPreview; + QGroupBox *GBoxGrave; + QComboBox *CBGrave; + QLabel *GravePreview; + QGroupBox *GBoxBinds; + QToolBox *BindsBox; + QWidget *page_A; + QWidget *page_W; + QWidget *page_WP; + QWidget *page_O; + QPushButton *BtnTeamDiscard; + QPushButton *BtnTeamSave; + QWidget *pageOpt; + QGroupBox *groupBox; + QPushButton *BtnNewTeam; + QPushButton *BtnEditTeam; + QComboBox *CBTeamName; + QComboBox *CBResolution; + QCheckBox *CBEnableSound; + QCheckBox *CBFullscreen; + QLabel *label; + QLineEdit *editNetNick; + QPushButton *BtnSaveOptions; + QPushButton *BtnSetupBack; + QWidget *pageMP; + QPushButton *BtnMPBack; + QListWidget *listWidget; + QWidget *pagePDemo; + QPushButton *BtnPlayDemo; + QListWidget *DemosList; + QPushButton *BtnDemosBack; + QWidget *pageNet; + QPushButton *BtnNetConnect; + QPushButton *BtnNetBack; + QWidget *pageNetChat; + QPushButton *BtnNetChatDisconnect; + QListWidget *ChannelsList; + QPushButton *BtnNetChatJoin; + QPushButton *BtnNetChatCreate; + QWidget *pageNetGame; + QPushButton *BtnNetCFGBack; + QPushButton *BtnNetCFGAddTeam; + QPushButton *BtnNetCFGGo; + QListWidget *listNetTeams; + QWidget *pageMain; + QPushButton *BtnSinglePlayer; + QPushButton *BtnMultiplayer; + QPushButton *BtnSetup; + QPushButton *BtnExit; + QPushButton *BtnDemos; + QPushButton *BtnNet; + + QStackedLayout *Pages; + QFont *font14; + + void setupUi(QMainWindow *HWForm); + void SetupFonts(); + void SetupPages(QWidget *Parent); + void SetupPageLocalGame(QWidget *Parent); + void SetupPageEditTeam(QWidget *Parent); + void SetupPageOptions(QWidget *Parent); + void SetupPageMultiplayer(QWidget *Parent); + void SetupPagePlayDemo(QWidget *Parent); + void SetupPageNet(QWidget *Parent); + void SetupPageNetChat(QWidget *Parent); + void SetupPageNetGame(QWidget *Parent); + void SetupPageMain(QWidget *Parent); + + void retranslateUi(QMainWindow *HWForm); +}; + +namespace Ui { + class HWForm: public Ui_HWForm {}; +} // namespace Ui + +#endif // UI_HWFORM_H