author | dag10 |
Wed, 23 Jan 2013 16:35:26 -0500 | |
changeset 8430 | 5a5c34a75e1a |
parent 8424 | 225ede46e3dc |
child 8432 | f2d57e987ba9 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
4976 | 3 |
* Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com> |
6952 | 4 |
* Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com> |
184 | 5 |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
|
7 |
* it under the terms of the GNU General Public License as published by |
|
8 |
* the Free Software Foundation; version 2 of the License |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
18 |
*/ |
|
19 |
||
572 | 20 |
#include <algorithm> |
21 |
||
184 | 22 |
#include <QLabel> |
23 |
#include <QPixmap> |
|
24 |
#include <QPushButton> |
|
25 |
#include <QFrame> |
|
884 | 26 |
#include <QDebug> |
184 | 27 |
|
2522 | 28 |
#include "vertScrollArea.h" |
184 | 29 |
#include "teamselect.h" |
30 |
#include "teamselhelper.h" |
|
31 |
#include "frameTeam.h" |
|
32 |
||
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
322
diff
changeset
|
33 |
void TeamSelWidget::addTeam(HWTeam team) |
184 | 34 |
{ |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
35 |
if(team.isNetTeam()) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
36 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
37 |
framePlaying->addTeam(team, true); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
38 |
curPlayingTeams.push_back(team); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
39 |
connect(framePlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
40 |
this, SLOT(netTeamStatusChanged(const HWTeam&))); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
41 |
connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)), |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
42 |
this, SLOT(hhNumChanged(const HWTeam&))); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
43 |
dynamic_cast<TeamShowWidget*>(framePlaying->getTeamWidget(team))->hhNumChanged(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
44 |
connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)), |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
45 |
this, SLOT(proxyTeamColorChanged(const HWTeam&))); |
373 | 46 |
} |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
47 |
else |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
48 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
49 |
frameDontPlaying->addTeam(team, false); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
50 |
m_curNotPlayingTeams.push_back(team); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
51 |
if(m_acceptOuter) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
52 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
53 |
connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
54 |
this, SLOT(pre_changeTeamStatus(HWTeam))); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
55 |
} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
56 |
else |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
57 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
58 |
connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
59 |
this, SLOT(changeTeamStatus(HWTeam))); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
60 |
} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
61 |
} |
8129 | 62 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
63 |
emit setEnabledGameStart(curPlayingTeams.size()>1); |
184 | 64 |
} |
65 |
||
1475
bab5650fc894
- Fix ConfigAsked not sending full config (leads to team divide checkbox inconsistency)
unc0rr
parents:
1425
diff
changeset
|
66 |
void TeamSelWidget::setInteractivity(bool interactive) |
362
b28e0dd48269
hedgehogs num modification now allowed to chief client only
displacer
parents:
356
diff
changeset
|
67 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
68 |
framePlaying->setInteractivity(interactive); |
362
b28e0dd48269
hedgehogs num modification now allowed to chief client only
displacer
parents:
356
diff
changeset
|
69 |
} |
b28e0dd48269
hedgehogs num modification now allowed to chief client only
displacer
parents:
356
diff
changeset
|
70 |
|
352 | 71 |
void TeamSelWidget::hhNumChanged(const HWTeam& team) |
72 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
73 |
QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
74 |
if(itPlay==curPlayingTeams.end()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
75 |
{ |
6015
daffc14a518a
cleaning up a little bit more, especially team class. we were leaking teams into heap memory on quick game starts btw
sheepluva
parents:
5773
diff
changeset
|
76 |
qWarning() << QString("hhNumChanged: team '%1' not found").arg(team.name()); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
77 |
return; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
78 |
} |
6015
daffc14a518a
cleaning up a little bit more, especially team class. we were leaking teams into heap memory on quick game starts btw
sheepluva
parents:
5773
diff
changeset
|
79 |
itPlay->setNumHedgehogs(team.numHedgehogs()); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
80 |
emit hhogsNumChanged(team); |
352 | 81 |
} |
82 |
||
372 | 83 |
void TeamSelWidget::proxyTeamColorChanged(const HWTeam& team) |
84 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
85 |
QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
86 |
if(itPlay==curPlayingTeams.end()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
87 |
{ |
6015
daffc14a518a
cleaning up a little bit more, especially team class. we were leaking teams into heap memory on quick game starts btw
sheepluva
parents:
5773
diff
changeset
|
88 |
qWarning() << QString("proxyTeamColorChanged: team '%1' not found").arg(team.name()); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
89 |
return; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
90 |
} |
6015
daffc14a518a
cleaning up a little bit more, especially team class. we were leaking teams into heap memory on quick game starts btw
sheepluva
parents:
5773
diff
changeset
|
91 |
itPlay->setColor(team.color()); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
92 |
emit teamColorChanged(team); |
372 | 93 |
} |
94 |
||
352 | 95 |
void TeamSelWidget::changeHHNum(const HWTeam& team) |
96 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
97 |
QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
98 |
if(itPlay==curPlayingTeams.end()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
99 |
{ |
6015
daffc14a518a
cleaning up a little bit more, especially team class. we were leaking teams into heap memory on quick game starts btw
sheepluva
parents:
5773
diff
changeset
|
100 |
qWarning() << QString("changeHHNum: team '%1' not found").arg(team.name()); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
101 |
return; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
102 |
} |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
103 |
itPlay->setNumHedgehogs(team.numHedgehogs()); |
352 | 104 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
105 |
framePlaying->setHHNum(team); |
352 | 106 |
} |
107 |
||
372 | 108 |
void TeamSelWidget::changeTeamColor(const HWTeam& team) |
109 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
110 |
QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
111 |
if(itPlay==curPlayingTeams.end()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
112 |
{ |
6015
daffc14a518a
cleaning up a little bit more, especially team class. we were leaking teams into heap memory on quick game starts btw
sheepluva
parents:
5773
diff
changeset
|
113 |
qWarning() << QString("changeTeamColor: team '%1' not found").arg(team.name()); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
114 |
return; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
115 |
} |
6015
daffc14a518a
cleaning up a little bit more, especially team class. we were leaking teams into heap memory on quick game starts btw
sheepluva
parents:
5773
diff
changeset
|
116 |
itPlay->setColor(team.color()); |
372 | 117 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
118 |
framePlaying->setTeamColor(team); |
372 | 119 |
} |
120 |
||
347 | 121 |
void TeamSelWidget::removeNetTeam(const HWTeam& team) |
122 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
123 |
//qDebug() << QString("removeNetTeam: removing team '%1'").arg(team.TeamName); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
124 |
for(;;) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
125 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
126 |
QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
127 |
if(itPlay==curPlayingTeams.end()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
128 |
{ |
6015
daffc14a518a
cleaning up a little bit more, especially team class. we were leaking teams into heap memory on quick game starts btw
sheepluva
parents:
5773
diff
changeset
|
129 |
qWarning() << QString("removeNetTeam: team '%1' not found").arg(team.name()); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
130 |
break; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
131 |
} |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
132 |
if(itPlay->isNetTeam()) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
133 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
134 |
QObject::disconnect(framePlaying->getTeamWidget(*itPlay), SIGNAL(teamStatusChanged(HWTeam))); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
135 |
framePlaying->removeTeam(team); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
136 |
curPlayingTeams.erase(itPlay); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
137 |
break; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
138 |
} |
7523
0790527b4e00
When exiting a room where one was host, server sends a REMOVE_TEAM for the local team. It appears that this loop would not break in that case. Add a log message and a break. (I've hit a frozen frontend twice now)
nemo
parents:
7145
diff
changeset
|
139 |
else |
0790527b4e00
When exiting a room where one was host, server sends a REMOVE_TEAM for the local team. It appears that this loop would not break in that case. Add a log message and a break. (I've hit a frozen frontend twice now)
nemo
parents:
7145
diff
changeset
|
140 |
{ |
0790527b4e00
When exiting a room where one was host, server sends a REMOVE_TEAM for the local team. It appears that this loop would not break in that case. Add a log message and a break. (I've hit a frozen frontend twice now)
nemo
parents:
7145
diff
changeset
|
141 |
qWarning() << QString("removeNetTeam: team '%1' was actually a local team!").arg(team.name()); |
0790527b4e00
When exiting a room where one was host, server sends a REMOVE_TEAM for the local team. It appears that this loop would not break in that case. Add a log message and a break. (I've hit a frozen frontend twice now)
nemo
parents:
7145
diff
changeset
|
142 |
break; |
0790527b4e00
When exiting a room where one was host, server sends a REMOVE_TEAM for the local team. It appears that this loop would not break in that case. Add a log message and a break. (I've hit a frozen frontend twice now)
nemo
parents:
7145
diff
changeset
|
143 |
} |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
144 |
} |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
145 |
emit setEnabledGameStart(curPlayingTeams.size()>1); |
347 | 146 |
} |
147 |
||
148 |
void TeamSelWidget::netTeamStatusChanged(const HWTeam& team) |
|
149 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
150 |
QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
486 | 151 |
|
347 | 152 |
} |
153 |
||
184 | 154 |
//void TeamSelWidget::removeTeam(__attribute__ ((unused)) HWTeam team) |
155 |
//{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
156 |
//curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team)); |
184 | 157 |
//} |
158 |
||
159 |
void TeamSelWidget::changeTeamStatus(HWTeam team) |
|
160 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
161 |
QList<HWTeam>::iterator itDontPlay=std::find(m_curNotPlayingTeams.begin(), m_curNotPlayingTeams.end(), team); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
162 |
QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
184 | 163 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
164 |
bool willBePlaying=itDontPlay!=m_curNotPlayingTeams.end(); |
184 | 165 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
166 |
if(!willBePlaying) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
167 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
168 |
// playing team => dont playing |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
169 |
m_curNotPlayingTeams.push_back(*itPlay); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
170 |
emit teamNotPlaying(*itPlay); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
171 |
curPlayingTeams.erase(itPlay); |
8129 | 172 |
|
173 |
// Show team notice if less than two teams. |
|
174 |
if (curPlayingTeams.size() < 2) |
|
175 |
{ |
|
176 |
numTeamNotice->show(); |
|
177 |
} |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
178 |
} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
179 |
else |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
180 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
181 |
// return if max playing teams reached |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
182 |
if(framePlaying->isFullTeams()) return; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
183 |
// dont playing team => playing |
7145
1d1a14b39400
Fix a bug with wrong state of teams list when color isn't changed manually
unc0rr
parents:
6952
diff
changeset
|
184 |
itDontPlay->setColor(framePlaying->getNextColor()); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
185 |
team=*itDontPlay; // for net team info saving in framePlaying (we have only name with netID from network) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
186 |
curPlayingTeams.push_back(*itDontPlay); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
187 |
if(!m_acceptOuter) emit teamWillPlay(*itDontPlay); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
188 |
m_curNotPlayingTeams.erase(itDontPlay); |
8129 | 189 |
|
190 |
// Hide team notice if at least two teams. |
|
191 |
if (curPlayingTeams.size() >= 2) |
|
192 |
{ |
|
193 |
numTeamNotice->hide(); |
|
194 |
} |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
195 |
} |
184 | 196 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
197 |
FrameTeams* pRemoveTeams; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
198 |
FrameTeams* pAddTeams; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
199 |
if(!willBePlaying) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
200 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
201 |
pRemoveTeams=framePlaying; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
202 |
pAddTeams=frameDontPlaying; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
203 |
} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
204 |
else |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
205 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
206 |
pRemoveTeams=frameDontPlaying; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
207 |
pAddTeams=framePlaying; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
208 |
} |
184 | 209 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
210 |
pAddTeams->addTeam(team, willBePlaying); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
211 |
pRemoveTeams->removeTeam(team); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
212 |
if(!team.isNetTeam() && m_acceptOuter && !willBePlaying) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
213 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
214 |
connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
215 |
this, SLOT(pre_changeTeamStatus(HWTeam))); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
216 |
} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
217 |
else |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
218 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
219 |
connect(pAddTeams->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
220 |
this, SLOT(changeTeamStatus(HWTeam))); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
221 |
} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
222 |
if(willBePlaying) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
223 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
224 |
connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)), |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
225 |
this, SLOT(hhNumChanged(const HWTeam&))); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
226 |
dynamic_cast<TeamShowWidget*>(framePlaying->getTeamWidget(team))->hhNumChanged(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
227 |
connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)), |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
228 |
this, SLOT(proxyTeamColorChanged(const HWTeam&))); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
229 |
emit teamColorChanged(((TeamShowWidget*)framePlaying->getTeamWidget(team))->getTeam()); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
230 |
} |
184 | 231 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
232 |
QSize szh=pAddTeams->sizeHint(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
233 |
QSize szh1=pRemoveTeams->sizeHint(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
234 |
if(szh.isValid() && szh1.isValid()) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
235 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
236 |
pAddTeams->resize(pAddTeams->size().width(), szh.height()); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
237 |
pRemoveTeams->resize(pRemoveTeams->size().width(), szh1.height()); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
238 |
} |
492 | 239 |
|
8430
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
240 |
repaint(); |
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
241 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
242 |
emit setEnabledGameStart(curPlayingTeams.size()>1); |
184 | 243 |
} |
244 |
||
1647 | 245 |
void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color, int fixedHeight) |
184 | 246 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
247 |
VertScrArea* area = new VertScrArea(color); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
248 |
area->setWidget(pfteams); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
249 |
mainLayout.addWidget(area, 30); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
250 |
if (fixedHeight > 0) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
251 |
{ |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
252 |
area->setMinimumHeight(fixedHeight); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
253 |
area->setMaximumHeight(fixedHeight); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
254 |
area->setStyleSheet( |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
255 |
"FrameTeams{" |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
256 |
"border: solid;" |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
257 |
"border-width: 1px;" |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
258 |
"border-radius: 16px;" |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
259 |
"border-color: #ffcc00;" |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
260 |
"}" |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
261 |
); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
262 |
} |
184 | 263 |
} |
264 |
||
265 |
TeamSelWidget::TeamSelWidget(QWidget* parent) : |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
266 |
QGroupBox(parent), mainLayout(this), m_acceptOuter(false) |
184 | 267 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
268 |
setTitle(QGroupBox::tr("Playing teams")); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
269 |
framePlaying = new FrameTeams(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
270 |
frameDontPlaying = new FrameTeams(); |
2377 | 271 |
|
8129 | 272 |
// Add notice about number of required teams. |
273 |
numTeamNotice = new QLabel("Two teams are required to play!"); |
|
8140 | 274 |
mainLayout.addWidget(numTeamNotice); |
8129 | 275 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
276 |
QPalette p; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
277 |
p.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00)); |
8424
225ede46e3dc
On pagenetgame, when window is too small the map/game options becomes a tabbed interface to allow for a few lines of chat to always be visible.
dag10
parents:
8140
diff
changeset
|
278 |
addScrArea(framePlaying, p.color(QPalette::Window).light(105), 150); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2522
diff
changeset
|
279 |
addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0); |
184 | 280 |
} |
281 |
||
373 | 282 |
void TeamSelWidget::setAcceptOuter(bool acceptOuter) |
283 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
284 |
m_acceptOuter=acceptOuter; |
373 | 285 |
} |
286 |
||
231 | 287 |
void TeamSelWidget::resetPlayingTeams(const QList<HWTeam>& teamslist) |
184 | 288 |
{ |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
289 |
//for(it=curPlayingTeams.begin(); it!=curPlayingTeams.end(); it++) { |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
290 |
//framePlaying->removeTeam(*it); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
291 |
//} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
292 |
framePlaying->resetTeams(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
293 |
framePlaying->resetColors(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
294 |
curPlayingTeams.clear(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
295 |
//for(it=curDontPlayingTeams.begin(); it!=curDontPlayingTeams.end(); it++) { |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
296 |
//frameDontPlaying->removeTeam(*it); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
297 |
//} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
298 |
frameDontPlaying->resetTeams(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
299 |
m_curNotPlayingTeams.clear(); |
184 | 300 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
301 |
foreach(HWTeam team, teamslist) |
8430
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
302 |
addTeam(team); |
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
303 |
|
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
304 |
repaint(); |
184 | 305 |
} |
306 |
||
7835
a84936d1618a
Clear hedgehog's gear Power value when switching. Should fix issue 446 (not tested, but looks obvious).
unc0rr
parents:
7523
diff
changeset
|
307 |
bool TeamSelWidget::isPlaying(const HWTeam &team) const |
184 | 308 |
{ |
7835
a84936d1618a
Clear hedgehog's gear Power value when switching. Should fix issue 446 (not tested, but looks obvious).
unc0rr
parents:
7523
diff
changeset
|
309 |
return curPlayingTeams.contains(team); |
184 | 310 |
} |
311 |
||
352 | 312 |
QList<HWTeam> TeamSelWidget::getPlayingTeams() const |
184 | 313 |
{ |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
314 |
return curPlayingTeams; |
184 | 315 |
} |
316 |
||
5773 | 317 |
QList<HWTeam> TeamSelWidget::getNotPlayingTeams() const |
535
a14eaf35cf4b
"Setup" button instead of "New team", exclude playing teams from setup
displacer
parents:
523
diff
changeset
|
318 |
{ |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
319 |
return m_curNotPlayingTeams; |
535
a14eaf35cf4b
"Setup" button instead of "New team", exclude playing teams from setup
displacer
parents:
523
diff
changeset
|
320 |
} |
a14eaf35cf4b
"Setup" button instead of "New team", exclude playing teams from setup
displacer
parents:
523
diff
changeset
|
321 |
|
7835
a84936d1618a
Clear hedgehog's gear Power value when switching. Should fix issue 446 (not tested, but looks obvious).
unc0rr
parents:
7523
diff
changeset
|
322 |
void TeamSelWidget::pre_changeTeamStatus(const HWTeam & team) |
373 | 323 |
{ |
7145
1d1a14b39400
Fix a bug with wrong state of teams list when color isn't changed manually
unc0rr
parents:
6952
diff
changeset
|
324 |
//team.setColor(framePlaying->getNextColor()); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
325 |
emit acceptRequested(team); |
373 | 326 |
} |
8430
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
327 |
|
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
328 |
void TeamSelWidget::repaint() |
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
329 |
{ |
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
330 |
QWidget::repaint(); |
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
331 |
framePlaying->repaint(); |
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
332 |
frameDontPlaying->repaint(); |
5a5c34a75e1a
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint().
dag10
parents:
8424
diff
changeset
|
333 |
} |