QTfrontend/newnetclient.cpp
changeset 703 424297e3165a
parent 697 44f167938201
child 747 c7f67e90c3ee
equal deleted inserted replaced
702:97858a6682bb 703:424297e3165a
   282   	if (lst[1] == "FORTSMODE") {
   282   	if (lst[1] == "FORTSMODE") {
   283 	  emit fortsModeChanged(lst[2].toInt() != 0);
   283 	  emit fortsModeChanged(lst[2].toInt() != 0);
   284 	  return;
   284 	  return;
   285   	}
   285   	}
   286 	if (lst[1] == "AMMO") {
   286 	if (lst[1] == "AMMO") {
   287 	  emit ammoChanged(lst[2]);
   287 	  if(lst.size() < 4) return;
       
   288 	  emit ammoChanged(lst[3], lst[2]);
   288 	  return;
   289 	  return;
   289 	}
   290 	}
   290 	QStringList hhTmpList=lst[1].split('+');
   291 	QStringList hhTmpList=lst[1].split('+');
   291   	if (hhTmpList[0] == "TEAM_COLOR") {
   292   	if (hhTmpList[0] == "TEAM_COLOR") {
   292 	  HWTeam tmptm(hhTmpList[1], hhTmpList[2].toUInt());
   293 	  HWTeam tmptm(hhTmpList[1], hhTmpList[2].toUInt());
   338   onThemeChanged(m_pGameCFGWidget->getCurrentTheme());
   339   onThemeChanged(m_pGameCFGWidget->getCurrentTheme());
   339   onInitHealthChanged(m_pGameCFGWidget->getInitHealth());
   340   onInitHealthChanged(m_pGameCFGWidget->getInitHealth());
   340   onTurnTimeChanged(m_pGameCFGWidget->getTurnTime());
   341   onTurnTimeChanged(m_pGameCFGWidget->getTurnTime());
   341   onFortsModeChanged(m_pGameCFGWidget->getGameFlags() & 0x1);
   342   onFortsModeChanged(m_pGameCFGWidget->getGameFlags() & 0x1);
   342   // always initialize with default ammo (also avoiding complicated cross-class dependencies)
   343   // always initialize with default ammo (also avoiding complicated cross-class dependencies)
   343   onWeaponsNameChanged(cDefaultAmmoStore->mid(10)); 
   344   onWeaponsNameChanged("Default", cDefaultAmmoStore->mid(10)); 
   344 }
   345 }
   345 
   346 
   346 void HWNewNet::RunGame()
   347 void HWNewNet::RunGame()
   347 {
   348 {
   348   emit AskForRunGame();
   349   emit AskForRunGame();
   390 void HWNewNet::onFortsModeChanged(bool value)
   391 void HWNewNet::onFortsModeChanged(bool value)
   391 {
   392 {
   392   RawSendNet(QString("CONFIG_PARAM%1FORTSMODE%1%2").arg(delimeter).arg(value));
   393   RawSendNet(QString("CONFIG_PARAM%1FORTSMODE%1%2").arg(delimeter).arg(value));
   393 }
   394 }
   394 
   395 
   395 void HWNewNet::onWeaponsNameChanged(const QString& ammo)
   396 void HWNewNet::onWeaponsNameChanged(const QString& name, const QString& ammo)
   396 {
   397 {
   397   RawSendNet(QString("CONFIG_PARAM%1AMMO%1%2").arg(delimeter).arg(ammo));
   398   RawSendNet(QString("CONFIG_PARAM%1AMMO%1%2%1%3").arg(delimeter).arg(ammo).arg(name));
   398 }
   399 }
   399 
   400 
   400 void HWNewNet::chatLineToNet(const QString& str)
   401 void HWNewNet::chatLineToNet(const QString& str)
   401 {
   402 {
   402   if(str!="") {
   403   if(str!="") {