Example #1
0
void CPlayerManager::UpdatePlayerInfo(PlayerInfo info)
{
	UpdatePlayerState(info.mPlayerId, info.mPlayerState);
	UpdatePlayerPosition(info.mPlayerId, NNPoint( info.mX, info.mY ) );
	UpdatePlayerRotation(info.mPlayerId, info.mAngle);
	UpdatePlayerMoveDirection(info.mPlayerId, info.mMoveVelocity);
	UpdatePlayerHP(info.mPlayerId, info.mHP);
	UpdatePlayerTeam(info.mPlayerId, info.mTeam);
	UpdatePlayerType(info.mPlayerId, (PlayerType)info.mType);
	//UpdatePlayerNickname(info.mPlayerId, info.mName);
	UpdatePlayerKillScore( info.mPlayerId, info.mKillScore );
}
Example #2
0
void TeamBox::SwitchPlayerType()
{
  if (!associated_team)
    return;

  ai_level++;
  if (ai_level > 3)
    ai_level = 0;
  UpdatePlayerType();
  if (Network::GetInstance()->IsConnected()) {
    ValidOptions();
  }
}
Example #3
0
void TeamBox::SetTeam(Team& _team, bool read_team_values)
{
  Team* old_team = associated_team;

  associated_team = &_team;

  if (_team.IsRemote()) {
    team_name->SetFont(dark_gray_color, Font::FONT_MEDIUM, Font::FONT_BOLD, false);

    // translators: this is the team listing and will expand in a context like "OOo team - Remote"
    team_name->SetText(Format(_("%s Team - Remote"), _team.GetName().c_str()));

    if (previous_custom_team) {
      previous_custom_team->SetVisible(false);
      next_custom_team->SetVisible(false);
    }
  } else {
    team_name->SetFont(primary_red_color, Font::FONT_MEDIUM, Font::FONT_BOLD, true);
    team_name->SetText(Format(_("%s Team"), _team.GetName().c_str()));

    if (previous_custom_team) {
      previous_custom_team->SetVisible(true);
      next_custom_team->SetVisible(true);
    }
  }
  UpdatePlayerType();
  team_logo->SetSurface(_team.GetFlag());

  // Update group
  SetGroup(_team.GetGroup());

  if (read_team_values) {
    player_name->SetText(_team.GetPlayerName());
    nb_characters->SetValue(_team.GetNbCharacters());
    for (uint i=0; i<4; i++) {
      if (ai_names[i] == _team.GetAIName()) {
        SetAILevel(i);
        break;
      }
    }
  } else if (old_team) {
    UpdateTeam(old_team->GetId());
  }
  previous_player_name = player_name->GetText();

  NeedRedrawing();
}
Example #4
0
void TeamBox::SetAIName(const std::string name)
{
  ai_name = name;
  UpdatePlayerType();
}