1 /* |
1 /* |
2 * Hedgewars, a worms-like game |
2 * Hedgewars, a worms-like game |
3 * Copyright (c) 2006 Ulyanov Igor <iulyanov@gmail.com> |
3 * Copyright (c) 2006, 2007 Ulyanov Igor <iulyanov@gmail.com> |
4 * |
4 * |
5 * This program is free software; you can redistribute it and/or modify |
5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License as published by |
6 * it under the terms of the GNU General Public License as published by |
7 * the Free Software Foundation; version 2 of the License |
7 * the Free Software Foundation; version 2 of the License |
8 * |
8 * |
31 if(team.isNetTeam()) { |
31 if(team.isNetTeam()) { |
32 framePlaying->addTeam(team, true); |
32 framePlaying->addTeam(team, true); |
33 curPlayingTeams.push_back(team); |
33 curPlayingTeams.push_back(team); |
34 connect(framePlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
34 connect(framePlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
35 this, SLOT(netTeamStatusChanged(const HWTeam&))); |
35 this, SLOT(netTeamStatusChanged(const HWTeam&))); |
36 connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)), |
36 connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)), |
37 this, SLOT(hhNumChanged(const HWTeam&))); |
37 this, SLOT(hhNumChanged(const HWTeam&))); |
38 connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)), |
38 connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)), |
39 this, SLOT(proxyTeamColorChanged(const HWTeam&))); |
39 this, SLOT(proxyTeamColorChanged(const HWTeam&))); |
40 } else { |
40 } else { |
41 frameDontPlaying->addTeam(team, false); |
41 frameDontPlaying->addTeam(team, false); |
42 curDontPlayingTeams.push_back(team); |
42 curDontPlayingTeams.push_back(team); |
43 if(m_acceptOuter) { |
43 if(m_acceptOuter) { |
102 } |
102 } |
103 |
103 |
104 void TeamSelWidget::netTeamStatusChanged(const HWTeam& team) |
104 void TeamSelWidget::netTeamStatusChanged(const HWTeam& team) |
105 { |
105 { |
106 QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
106 QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
107 |
107 |
108 } |
108 } |
109 |
109 |
110 //void TeamSelWidget::removeTeam(__attribute__ ((unused)) HWTeam team) |
110 //void TeamSelWidget::removeTeam(__attribute__ ((unused)) HWTeam team) |
111 //{ |
111 //{ |
112 //curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team)); |
112 //curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team)); |
153 } else { |
153 } else { |
154 connect(pAddTeams->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
154 connect(pAddTeams->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
155 this, SLOT(changeTeamStatus(HWTeam))); |
155 this, SLOT(changeTeamStatus(HWTeam))); |
156 } |
156 } |
157 if(willBePlaying) { |
157 if(willBePlaying) { |
158 connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)), |
158 connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)), |
159 this, SLOT(hhNumChanged(const HWTeam&))); |
159 this, SLOT(hhNumChanged(const HWTeam&))); |
160 connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)), |
160 connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)), |
161 this, SLOT(proxyTeamColorChanged(const HWTeam&))); |
161 this, SLOT(proxyTeamColorChanged(const HWTeam&))); |
162 emit teamColorChanged(((TeamShowWidget*)framePlaying->getTeamWidget(team))->getTeam()); |
162 emit teamColorChanged(((TeamShowWidget*)framePlaying->getTeamWidget(team))->getTeam()); |
163 } |
163 } |
164 |
164 |
165 QSize szh=pAddTeams->sizeHint(); |
165 QSize szh=pAddTeams->sizeHint(); |