Example #1
0
void GSAvatarMod::OnOk()
{
  PlayerInfo* pi = ThePlayerInfoManager::Instance()->GetPI();
//  pi->PISetBool(PI_KEY("has set up"), true);

  // This may not be necessary except as an optimisation and so we display the correct type next time
  //  we are in this game state...?
  // TODO Not using this info yet
//  pi->PISetInt(PI_KEY("avatar"), m_currentChar);

  // Send update req so all clients show correct avatar settings
  int objId = pi->PIGetInt(PI_KEY("player obj id"));
  // OR GetLocalPlayer()->GetId() -- which is better ?
  TheObjectUpdater::Instance()->SendUpdateReq(objId, SET_KEY("avatar"), m_currentChar); 
  // TODO more avatar settings

  GoBack(); 
}