CvGameReligions::NotifyPlayer(PlayerTypes, CvGameReligions::FOUNDING_RESULT)
- Defined in
- CvReligionClasses.cpp, line 2763
- Class
- CvGameReligions
- Hook name
CivHooks::CvGameReligions_NotifyPlayer
Hooks
static bool BeforeCvGameReligions_NotifyPlayer(PlayerTypes ePlayer, CvGameReligions::FOUNDING_RESULT eResult);static void AfterCvGameReligions_NotifyPlayer(PlayerTypes ePlayer, CvGameReligions::FOUNDING_RESULT eResult);static void ReplaceCvGameReligions_NotifyPlayer(void (*original)(PlayerTypes, CvGameReligions::FOUNDING_RESULT), PlayerTypes ePlayer, CvGameReligions::FOUNDING_RESULT eResult);CivRegisterBefore<CivHooks::CvGameReligions_NotifyPlayer>(host, &BeforeCvGameReligions_NotifyPlayer);CivRegisterAfter<CivHooks::CvGameReligions_NotifyPlayer>(host, &AfterCvGameReligions_NotifyPlayer);CivRegisterReplace<CivHooks::CvGameReligions_NotifyPlayer>(host, &ReplaceCvGameReligions_NotifyPlayer);
Code
2762// Notify the supplied player (if they are the local player) of an error when founding/modifying a religion/pantheon2763void CvGameReligions::NotifyPlayer(PlayerTypes ePlayer, CvGameReligions::FOUNDING_RESULT eResult)2764{2765 CvString strMessage;2766 CvString strSummary;27672768 NotificationTypes eNotificationType = NOTIFICATION_RELIGION_ERROR;27692770 switch(eResult)2771 {2772 case FOUNDING_OK:2773 break;2774 case FOUNDING_BELIEF_IN_USE:2775 strMessage = GetLocalizedText("TXT_KEY_NOTIFICATION_PANTHEON_BELIEF_IN_USE");2776 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_PANTHEON_BELIEF_IN_USE");2777 break;2778 case FOUNDING_RELIGION_IN_USE:2779 strMessage = GetLocalizedText("TXT_KEY_NOTIFICATION_RELIGION_IN_USE");2780 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_RELIGION_IN_USE");2781 break;2782 case FOUNDING_NOT_ENOUGH_FAITH:2783 strMessage = GetLocalizedText("TXT_KEY_NOTIFICATION_NOT_ENOUGH_FAITH_FOR_PANTHEON");2784 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_NOT_ENOUGH_FAITH_FOR_PANTHEON");2785 break;2786 case FOUNDING_NO_RELIGIONS_AVAILABLE:2787 strMessage = GetLocalizedText("TXT_KEY_NOTIFICATION_NO_RELIGIONS_AVAILABLE");2788 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_NO_RELIGIONS_AVAILABLE");2789 break;2790 case FOUNDING_INVALID_PLAYER:2791 break;2792 case FOUNDING_PLAYER_ALREADY_CREATED_RELIGION:2793 strMessage = GetLocalizedText("TXT_KEY_NOTIFICATION_ALREADY_CREATED_RELIGION");2794 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_ALREADY_CREATED_RELIGION");2795 break;2796 case FOUNDING_PLAYER_ALREADY_CREATED_PANTHEON:2797 strMessage = GetLocalizedText("TXT_KEY_NOTIFICATION_ALREADY_CREATED_PANTHEON");2798 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_ALREADY_CREATED_PANTHEON");2799 break;2800 case FOUNDING_NAME_IN_USE:2801 strMessage = GetLocalizedText("TXT_KEY_NOTIFICATION_RELIGION_NAME_IN_USE");2802 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_RELIGION_NAME_IN_USE");2803 break;2804 case FOUNDING_RELIGION_ENHANCED:2805 strMessage = GetLocalizedText("TXT_KEY_NOTIFICATION_ENHANCED_RELIGION_IN_USE");2806 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_ENHANCED_RELIGION_IN_USE");2807 break;2808 }28092810 if(strMessage.GetLength() != 0)2811 CvNotifications::AddToPlayer(ePlayer, eNotificationType, strMessage.c_str(), strSummary.c_str());2812}
Calls
- CvNotifications::AddToPlayer(PlayerTypes, NotificationTypes, const char *, const char *, int, int, int, int)
CvString::CvStringCvString::GetLengthCvString::operator=- GetLocalizedText(const char *)
std::basic_string::c_str
Called by
- CvDllNetMessageHandler::ResponseEnhanceReligion(PlayerTypes, ReligionTypes, const char *, BeliefTypes, BeliefTypes, int, int)
- CvDllNetMessageHandler::ResponseFoundPantheon(PlayerTypes, BeliefTypes)
- CvDllNetMessageHandler::ResponseFoundReligion(PlayerTypes, ReligionTypes, const char *, BeliefTypes, BeliefTypes, BeliefTypes, BeliefTypes, int, int)