34 QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0), colorButt(0) |
34 QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0), colorButt(0) |
35 { |
35 { |
36 mainLayout.setSpacing(1); |
36 mainLayout.setSpacing(1); |
37 mainLayout.setMargin(2); |
37 mainLayout.setMargin(2); |
38 this->setMaximumHeight(35); |
38 this->setMaximumHeight(35); |
39 QIcon difficultyIcon=team.netTeam ? QIcon(QString(":/res/net.png")) |
39 QIcon difficultyIcon=team.isNetTeam() ? QIcon(QString(":/res/net.png")) |
40 : QIcon(QString(":/res/botlevels/%1.png").arg(m_team.difficulty)); |
40 : QIcon(QString(":/res/botlevels/%1.png").arg(m_team.difficulty)); |
41 |
41 |
42 QPalette newPalette = palette(); |
42 QPalette newPalette = palette(); |
43 newPalette.setColor(QPalette::Button, palette().color(backgroundRole())); |
43 newPalette.setColor(QPalette::Button, palette().color(backgroundRole())); |
44 |
44 |
66 connect(colorButt, SIGNAL(clicked()), this, SLOT(changeTeamColor())); |
66 connect(colorButt, SIGNAL(clicked()), this, SLOT(changeTeamColor())); |
67 mainLayout.addWidget(colorButt); |
67 mainLayout.addWidget(colorButt); |
68 |
68 |
69 // hedgehogs num |
69 // hedgehogs num |
70 phhoger=new CHedgehogerWidget(this); |
70 phhoger=new CHedgehogerWidget(this); |
|
71 connect(phhoger, SIGNAL(hedgehogsNumChanged()), this, SLOT(hhNumChanged())); |
71 mainLayout.addWidget(phhoger); |
72 mainLayout.addWidget(phhoger); |
72 } |
73 } |
73 |
74 |
74 QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam())); |
75 QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam())); |
75 QObject::connect(bText, SIGNAL(clicked()), this, SLOT(activateTeam())); |
76 QObject::connect(bText, SIGNAL(clicked()), this, SLOT(activateTeam())); |
|
77 } |
|
78 |
|
79 void TeamShowWidget::setHHNum(unsigned int num) |
|
80 { |
|
81 phhoger->setHHNum(num); |
|
82 } |
|
83 |
|
84 void TeamShowWidget::hhNumChanged() |
|
85 { |
|
86 m_team.numHedgehogs=phhoger->getHedgehogsNum(); |
|
87 emit hhNmChanged(m_team); |
76 } |
88 } |
77 |
89 |
78 void TeamShowWidget::activateTeam() |
90 void TeamShowWidget::activateTeam() |
79 { |
91 { |
80 emit teamStatusChanged(m_team); |
92 emit teamStatusChanged(m_team); |