Put color change code in a better location
This commit is contained in:
parent
4c4b4782e0
commit
bfd66ebbac
@ -287,6 +287,10 @@ GUIEngine::EventPropagation SoccerSetupScreen::filterActions(PlayerAction action
|
||||
{
|
||||
team_switch = SOCCER_TEAM_RED;
|
||||
|
||||
// Change the kart color
|
||||
m_kart_view_info[playerId].view->getRenderInfo()
|
||||
.setKartModelRenderInfo(RenderInfo::KRT_RED);
|
||||
|
||||
for(int i=0 ; i < nb_players ; i++)
|
||||
{
|
||||
m_kart_view_info[i].view->unsetBadge(BAD_BADGE);
|
||||
@ -300,6 +304,10 @@ GUIEngine::EventPropagation SoccerSetupScreen::filterActions(PlayerAction action
|
||||
{
|
||||
team_switch = SOCCER_TEAM_BLUE;
|
||||
|
||||
// Change the kart color
|
||||
m_kart_view_info[playerId].view->getRenderInfo()
|
||||
.setKartModelRenderInfo(RenderInfo::KRT_BLUE);
|
||||
|
||||
for(int i=0 ; i < nb_players ; i++)
|
||||
{
|
||||
m_kart_view_info[i].view->unsetBadge(BAD_BADGE);
|
||||
@ -454,11 +462,6 @@ void SoccerSetupScreen::updateKartViewsLayout()
|
||||
const KartViewInfo& view_info = m_kart_view_info[i];
|
||||
const SoccerTeam team = view_info.team;
|
||||
|
||||
// Change the kart color
|
||||
m_kart_view_info[i].view->getRenderInfo().setKartModelRenderInfo
|
||||
(view_info.team == SOCCER_TEAM_BLUE ?
|
||||
RenderInfo::KRT_BLUE : RenderInfo::KRT_RED);
|
||||
|
||||
// Compute the position
|
||||
const int cur_row = cur_kart_per_team[team] / nb_columns;
|
||||
const int pos_y = start_y[team] + cur_row*kart_view_size;
|
||||
|
Loading…
x
Reference in New Issue
Block a user