QTfrontend/newnetclient.cpp
changeset 1784 dfe9bafb4590
parent 1782 e7589e37a6d6
child 1793 3e8caf5fee58
equal deleted inserted replaced
1783:169ebeefd7ab 1784:dfe9bafb4590
   486 		}
   486 		}
   487 		if (lst[1] == "SOLIDLAND") {
   487 		if (lst[1] == "SOLIDLAND") {
   488 			emit solidChanged(lst[2].toInt() != 0);
   488 			emit solidChanged(lst[2].toInt() != 0);
   489 			return;
   489 			return;
   490 		}
   490 		}
       
   491 		if (lst[1] == "BORDER") {
       
   492 			emit borderChanged(lst[2].toInt() != 0);
       
   493 			return;
       
   494 		}
   491 		if (lst[1] == "AMMO") {
   495 		if (lst[1] == "AMMO") {
   492 			if(lst.size() < 4) return;
   496 			if(lst.size() < 4) return;
   493 			emit ammoChanged(lst[3], lst[2]);
   497 			emit ammoChanged(lst[3], lst[2]);
   494 			return;
   498 			return;
   495 		}
   499 		}
   560 	onInitHealthChanged(m_pGameCFGWidget->getInitHealth());
   564 	onInitHealthChanged(m_pGameCFGWidget->getInitHealth());
   561 	onTurnTimeChanged(m_pGameCFGWidget->getTurnTime());
   565 	onTurnTimeChanged(m_pGameCFGWidget->getTurnTime());
   562 	onFortsModeChanged(m_pGameCFGWidget->getGameFlags() & 0x1);
   566 	onFortsModeChanged(m_pGameCFGWidget->getGameFlags() & 0x1);
   563 	onTeamsDivideChanged(m_pGameCFGWidget->getGameFlags() & 0x10);
   567 	onTeamsDivideChanged(m_pGameCFGWidget->getGameFlags() & 0x10);
   564 	onSolidChanged(m_pGameCFGWidget->getGameFlags() & 0x04);
   568 	onSolidChanged(m_pGameCFGWidget->getGameFlags() & 0x04);
       
   569 	onBorderChanged(m_pGameCFGWidget->getGameFlags() & 0x08);
   565 	// always initialize with default ammo (also avoiding complicated cross-class dependencies)
   570 	// always initialize with default ammo (also avoiding complicated cross-class dependencies)
   566 	QString name = m_pGameCFGWidget->WeaponsName->currentText();
   571 	QString name = m_pGameCFGWidget->WeaponsName->currentText();
   567 	QString ammo = m_pGameCFGWidget->WeaponsName->itemData(
   572 	QString ammo = m_pGameCFGWidget->WeaponsName->itemData(
   568 			m_pGameCFGWidget->WeaponsName->currentIndex()
   573 			m_pGameCFGWidget->WeaponsName->currentIndex()
   569 			).toString();
   574 			).toString();
   641 void HWNewNet::onSolidChanged(bool value)
   646 void HWNewNet::onSolidChanged(bool value)
   642 {
   647 {
   643 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1SOLIDLAND%1%2").arg(delimeter).arg(value));
   648 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1SOLIDLAND%1%2").arg(delimeter).arg(value));
   644 }
   649 }
   645 
   650 
       
   651 void HWNewNet::onBorderChanged(bool value)
       
   652 {
       
   653 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1BORDER%1%2").arg(delimeter).arg(value));
       
   654 }
       
   655 
   646 void HWNewNet::onWeaponsNameChanged(const QString& name, const QString& ammo)
   656 void HWNewNet::onWeaponsNameChanged(const QString& name, const QString& ammo)
   647 {
   657 {
   648 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1AMMO%1%2%1%3").arg(delimeter).arg(ammo).arg(name));
   658 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1AMMO%1%2%1%3").arg(delimeter).arg(ammo).arg(name));
   649 }
   659 }
   650 
   660