94 // and this one flag does not warrant a static class |
94 // and this one flag does not warrant a static class |
95 bool frontendEffects = true; |
95 bool frontendEffects = true; |
96 QString playerHash; |
96 QString playerHash; |
97 |
97 |
98 HWForm::HWForm(QWidget *parent, QString styleSheet) |
98 HWForm::HWForm(QWidget *parent, QString styleSheet) |
99 : QMainWindow(parent), pnetserver(0), pRegisterServer(0), editedTeam(0), hwnet(0) |
99 : QMainWindow(parent) |
|
100 , game(0) |
|
101 , pnetserver(0) |
|
102 , pRegisterServer(0) |
|
103 , editedTeam(0) |
|
104 , hwnet(0) |
100 { |
105 { |
101 // set music track |
106 // set music track |
102 SDLInteraction::instance().setMusicTrack( |
107 SDLInteraction::instance().setMusicTrack( |
103 HWDataManager::instance().findFileForRead("Music/main_theme.ogg") |
108 HWDataManager::instance().findFileForRead("Music/main_theme.ogg") |
104 ); |
109 ); |
105 |
110 |
106 #ifdef USE_XFIRE |
111 #ifdef USE_XFIRE |
107 xfire_init(); |
112 xfire_init(); |
108 #endif |
113 #endif |
109 game = NULL; |
|
110 gameSettings = new QSettings(cfgdir->absolutePath() + "/hedgewars.ini", QSettings::IniFormat); |
114 gameSettings = new QSettings(cfgdir->absolutePath() + "/hedgewars.ini", QSettings::IniFormat); |
111 frontendEffects = gameSettings->value("frontend/effects", true).toBool(); |
115 frontendEffects = gameSettings->value("frontend/effects", true).toBool(); |
112 playerHash = QString(QCryptographicHash::hash(gameSettings->value("net/nick","").toString().toLatin1(), QCryptographicHash::Md5).toHex()); |
116 playerHash = QString(QCryptographicHash::hash(gameSettings->value("net/nick","").toString().toLatin1(), QCryptographicHash::Md5).toHex()); |
113 |
117 |
114 this->setStyleSheet(styleSheet); |
118 this->setStyleSheet(styleSheet); |
1160 QString ammo; |
1164 QString ammo; |
1161 ammo = ui.pageNetGame->pGameCFG->WeaponsName->itemData( |
1165 ammo = ui.pageNetGame->pGameCFG->WeaponsName->itemData( |
1162 ui.pageNetGame->pGameCFG->WeaponsName->currentIndex() |
1166 ui.pageNetGame->pGameCFG->WeaponsName->currentIndex() |
1163 ).toString(); |
1167 ).toString(); |
1164 |
1168 |
1165 CreateGame(ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget, ammo); |
1169 CreateGame(ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget, ammo); |
1166 |
1170 |
1167 connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &))); |
1171 connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &))); |
1168 connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &))); |
1172 connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &))); |
1169 connect(game, SIGNAL(SendTeamMessage(const QString &)), hwnet, SLOT(SendTeamMessage(const QString &))); |
1173 connect(game, SIGNAL(SendTeamMessage(const QString &)), hwnet, SLOT(SendTeamMessage(const QString &))); |
1170 connect(hwnet, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &))); |
1174 connect(hwnet, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &))); |