CvPlayer::getNameKey() const
- Defined in
- CvPlayer.cpp, line 4399
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_getNameKey
Hooks
static bool BeforeCvPlayer_getNameKey(const CvPlayer* self, const char*& result);static void AfterCvPlayer_getNameKey(const CvPlayer* self, const char*& result);static const char* ReplaceCvPlayer_getNameKey(const char* (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_getNameKey>(host, &BeforeCvPlayer_getNameKey);CivRegisterAfter<CivHooks::CvPlayer_getNameKey>(host, &AfterCvPlayer_getNameKey);CivRegisterReplace<CivHooks::CvPlayer_getNameKey>(host, &ReplaceCvPlayer_getNameKey);
Code
4399const char* CvPlayer::getNameKey() const4400{4401 if(isMinorCiv())4402 {4403 return GC.getMinorCivInfo(GetMinorCivAI()->GetMinorCivType())->GetTextKey();4404 }44054406 if(GC.getGame().isMPOption(MPOPTION_ANONYMOUS) && isAlive())4407 {4408 return getLeaderInfo().GetTextKey();4409 }44104411 if(GC.getGame().isGameMultiPlayer() && isHuman())4412 {4413 // No, this won't be a 'key', but it should just pass through the lookup code and display as is.4414 const CvString& szDisplayName = CvPreGame::nicknameDisplayed(GetID());4415 if(szDisplayName.GetLength())4416 return szDisplayName.c_str();4417 }44184419 const CvString& szPlayerName = CvPreGame::leaderNameKey(GetID());4420 if(szPlayerName.GetLength() == 0)4421 {4422 return getLeaderInfo().GetTextKey();4423 }44244425 return szPlayerName.c_str();4426}
Calls
- CvBaseInfo::GetTextKey() const
- CvGame::isGameMultiPlayer() const
- CvGame::isMPOption(MultiplayerOptionTypes) const
- CvGlobals::getGame()
- CvGlobals::getMinorCivInfo(MinorCivTypes)
- CvMinorCivAI::GetMinorCivType() const
- CvPlayer::GetID() const
- CvPlayer::getLeaderInfo() const
- CvPlayer::GetMinorCivAI() const
- CvPlayer::isAlive() const
- CvPlayer::isHuman() const
- CvPlayer::isMinorCiv() const
- CvPreGame::leaderNameKey(PlayerTypes)
- CvPreGame::nicknameDisplayed(PlayerTypes)
CvString::GetLengthstd::basic_string::c_str
Called by
44 functions in 13 files
- CvCityBuildings::SetNumRealBuildingTimed(BuildingTypes, int, bool, PlayerTypes, int)
- CvGameDeals::DoEndTradedItem(CvTradedItem *, PlayerTypes, bool)
- CvDiplomacyAI::DoFirstContact(PlayerTypes)
- CvDiplomacyAI::DoMakePublicDeclaration(PublicDeclarationTypes, int, int, PlayerTypes, PlayerTypes)
- CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes, DiploStatementTypes, int, CvDeal *)
- CvDiplomacyAI::GetGreetHumanMessage(LeaderheadAnimationTypes &)
- CvPlayerEspionage::AddIntrigueMessage(PlayerTypes, PlayerTypes, PlayerTypes, BuildingTypes, ProjectTypes, CvIntrigueType, uint, CvCity *, bool)
- CvPlayerEspionage::GetIntrigueMessage(uint)
- CvGame::DoPlaceTeamInVictoryCompetition(VictoryTypes, TeamTypes)
- CvGame::setWinner(TeamTypes, VictoryTypes)
- CvMinorCivAI::DoFriendship()
- CvMinorCivAI::DoIntrusion()
- CvMinorCivAI::DoLiberationByMajor(PlayerTypes, TeamTypes)
- CvMinorCivAI::DoObsoleteQuestsForPlayer(PlayerTypes, MinorCivQuestTypes)
- CvMinorCivAI::DoSetBonus(PlayerTypes, bool, bool, bool, bool, bool, PlayerTypes)
- CvMinorCivAI::DoSpawnUnit(PlayerTypes, bool, bool)
- CvMinorCivAI::DoTestThreatenedAnnouncementForPlayer(PlayerTypes)
- CvMinorCivAI::DoThreateningBarbKilled(PlayerTypes, int, int)
- CvMinorCivAI::GetStatusChangeNotificationStrings(PlayerTypes, bool, bool, bool, PlayerTypes, PlayerTypes)
- CvMinorCivQuest::DoCancelQuest()
- CvMinorCivQuest::DoFinishQuest()
- CvMinorCivQuest::DoStartQuest(int)
- CvMinorCivQuest::DoStartQuestUsingExistingData(CvMinorCivQuest *)
- CvPlayer::DoAnnounceReligionAdoption()
- CvPlayer::DoLiberatePlayer(PlayerTypes, int)
- CvPlayer::DoSpawnGreatPerson(PlayerTypes, bool)
- CvPlayer::SetHasLostCapital(bool, PlayerTypes)
- CvPlayer::acquireCity(CvCity *, bool, bool, bool)
- CvPlayer::changeNumResourceTotal(ResourceTypes, int, bool)
- CvPlayer::disconnected()
- CvPlayer::processPolicies(PolicyTypes, int)
- CvPlayer::reconnected()
- CvTeam::getNameKey() const
- CvTeam::makeHasMet(TeamTypes, bool)
- CvTeam::setHasTech(TechTypes, bool, PlayerTypes, bool, bool)
- CvPlayerTrade::PlunderTradeRoute(int, CvUnit *)
- CvUnit::PerformCultureBomb(int)
- CvUnit::createGreatWork()
- CvUnit::gift(bool)
- CvUnit::initWithNameOffset(int, UnitTypes, int, UnitAITypes, PlayerTypes, int, int, DirectionTypes, bool, bool, int, int)
- CvUnit::setXY(int, int, bool, bool, bool, bool, bool)
- CvUnitCombat::Attack(CvUnit &, CvPlot &, ATTACK_OPTION)
- CvLeague::GetMemberDelegationDetails(PlayerTypes, PlayerTypes)
- CvLuaPlayer::lGetNameKey(lua_State *)