QTfrontend/hwform.cpp
changeset 1531 f404233b6d9b
parent 1530 3b8d723661b2
child 1566 6b63c75fdc68
equal deleted inserted replaced
1530:3b8d723661b2 1531:f404233b6d9b
    93 	connect(ui.pageOptions->BtnSaveOptions,	SIGNAL(clicked()),	this, SLOT(GoBack()));
    93 	connect(ui.pageOptions->BtnSaveOptions,	SIGNAL(clicked()),	this, SLOT(GoBack()));
    94 
    94 
    95 	connect(ui.pageOptions->WeaponEdit, SIGNAL(clicked()), this, SLOT(GoToSelectWeapon()));
    95 	connect(ui.pageOptions->WeaponEdit, SIGNAL(clicked()), this, SLOT(GoToSelectWeapon()));
    96 	connect(ui.pageOptions->WeaponsButt, SIGNAL(clicked()), this, SLOT(GoToSelectNewWeapon()));
    96 	connect(ui.pageOptions->WeaponsButt, SIGNAL(clicked()), this, SLOT(GoToSelectNewWeapon()));
    97 	connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsChanged()), this, SLOT(UpdateWeapons()));
    97 	connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsChanged()), this, SLOT(UpdateWeapons()));
    98 	connect(ui.pageNetGame->pGameCFG, SIGNAL(newWeaponsName(const QString&)), this, SLOT(NetWeaponNameChanged(const QString&)));
       
    99 
    98 
   100 	connect(ui.pageNet->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
    99 	connect(ui.pageNet->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
   101 	connect(ui.pageNet->BtnSpecifyServer, SIGNAL(clicked()), this, SLOT(NetConnect()));
   100 	connect(ui.pageNet->BtnSpecifyServer, SIGNAL(clicked()), this, SLOT(NetConnect()));
   102 	connect(ui.pageNet->BtnOfficialServer, SIGNAL(clicked()), this, SLOT(NetConnectOfficialServer()));
   101 	connect(ui.pageNet->BtnOfficialServer, SIGNAL(clicked()), this, SLOT(NetConnectOfficialServer()));
   103 	connect(ui.pageNet->BtnNetSvrStart, SIGNAL(clicked()), this, SLOT(GoToNetServer()));
   102 	connect(ui.pageNet->BtnNetSvrStart, SIGNAL(clicked()), this, SLOT(GoToNetServer()));
   181 		int pos = (*it)->findText("Default");
   180 		int pos = (*it)->findText("Default");
   182 		if (pos != -1) {
   181 		if (pos != -1) {
   183 			(*it)->setCurrentIndex(pos);
   182 			(*it)->setCurrentIndex(pos);
   184 		}
   183 		}
   185 	}
   184 	}
   186 }
       
   187 
       
   188 void HWForm::NetWeaponNameChanged(const QString& name)
       
   189 {
       
   190 	QString ammo = ui.pageSelectWeapon->pWeapons->getWeaponsString(name);
       
   191 
       
   192 	if (hwnet)
       
   193 		hwnet->onWeaponsNameChanged(name, ammo);
       
   194 }
   185 }
   195 
   186 
   196 void HWForm::UpdateTeamsLists(const QStringList* editable_teams)
   187 void HWForm::UpdateTeamsLists(const QStringList* editable_teams)
   197 {
   188 {
   198 	QStringList teamslist;
   189 	QStringList teamslist;
   500 	connect(ui.pageNetGame->pGameCFG, SIGNAL(initHealthChanged(int)), hwnet, SLOT(onInitHealthChanged(int)));
   491 	connect(ui.pageNetGame->pGameCFG, SIGNAL(initHealthChanged(int)), hwnet, SLOT(onInitHealthChanged(int)));
   501 	connect(ui.pageNetGame->pGameCFG, SIGNAL(turnTimeChanged(int)), hwnet, SLOT(onTurnTimeChanged(int)));
   492 	connect(ui.pageNetGame->pGameCFG, SIGNAL(turnTimeChanged(int)), hwnet, SLOT(onTurnTimeChanged(int)));
   502 	connect(ui.pageNetGame->pGameCFG, SIGNAL(fortsModeChanged(bool)), hwnet, SLOT(onFortsModeChanged(bool)));
   493 	connect(ui.pageNetGame->pGameCFG, SIGNAL(fortsModeChanged(bool)), hwnet, SLOT(onFortsModeChanged(bool)));
   503 	connect(ui.pageNetGame->pGameCFG, SIGNAL(teamsDivideChanged(bool)), hwnet, SLOT(onTeamsDivideChanged(bool)));
   494 	connect(ui.pageNetGame->pGameCFG, SIGNAL(teamsDivideChanged(bool)), hwnet, SLOT(onTeamsDivideChanged(bool)));
   504 	connect(ui.pageNetGame->pGameCFG, SIGNAL(solidChanged(bool)), hwnet, SLOT(onSolidChanged(bool)));
   495 	connect(ui.pageNetGame->pGameCFG, SIGNAL(solidChanged(bool)), hwnet, SLOT(onSolidChanged(bool)));
       
   496 	connect(ui.pageNetGame->pGameCFG, SIGNAL(newWeaponScheme(const QString &, const QString &)),
       
   497 			hwnet, SLOT(onWeaponsNameChanged(const QString &, const QString &)));
   505 
   498 
   506 	connect(hwnet, SIGNAL(Disconnected()), this, SLOT(ForcedDisconnect()));
   499 	connect(hwnet, SIGNAL(Disconnected()), this, SLOT(ForcedDisconnect()));
   507 	connect(hwnet, SIGNAL(seedChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setSeed(const QString &)));
   500 	connect(hwnet, SIGNAL(seedChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setSeed(const QString &)));
   508 	connect(hwnet, SIGNAL(mapChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setMap(const QString &)));
   501 	connect(hwnet, SIGNAL(mapChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setMap(const QString &)));
   509 	connect(hwnet, SIGNAL(themeChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setTheme(const QString &)));
   502 	connect(hwnet, SIGNAL(themeChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setTheme(const QString &)));
   610 	ui.pageNetGame->pNetTeamsWidget->addTeam(team);
   603 	ui.pageNetGame->pNetTeamsWidget->addTeam(team);
   611 }
   604 }
   612 
   605 
   613 void HWForm::StartMPGame()
   606 void HWForm::StartMPGame()
   614 {
   607 {
   615 	QString ammo = ui.pageSelectWeapon->pWeapons->getWeaponsString(ui.pageMultiplayer->gameCFG->WeaponsName->currentText());
   608 	QString ammo;
       
   609 	ammo = ui.pageMultiplayer->gameCFG->WeaponsName->itemData(
       
   610 		ui.pageMultiplayer->gameCFG->WeaponsName->currentIndex()
       
   611 		).toString();
   616 
   612 
   617 	CreateGame(ui.pageMultiplayer->gameCFG, ui.pageMultiplayer->teamsSelect, ammo);
   613 	CreateGame(ui.pageMultiplayer->gameCFG, ui.pageMultiplayer->teamsSelect, ammo);
   618 
   614 
   619 	game->StartLocal();
   615 	game->StartLocal();
   620 }
   616 }