Bazaar developer reference

CvLeague::NotifyProposalResult(CvRepealProposal *)

Defined in
CvVotingClasses.cpp, line 5971
Class
CvLeague
Hook name
CivHooks::CvLeague_NotifyProposalResult_with_CvRepealProposal
Lua events
GameEvents.ResolutionResult

Hooks

static bool BeforeCvLeague_NotifyProposalResult_with_CvRepealProposal(CvLeague* self, CvRepealProposal* pProposal);static void AfterCvLeague_NotifyProposalResult_with_CvRepealProposal(CvLeague* self, CvRepealProposal* pProposal);static void ReplaceCvLeague_NotifyProposalResult_with_CvRepealProposal(void (*original)(CvLeague*, CvRepealProposal*), CvLeague* self, CvRepealProposal* pProposal);CivRegisterBefore<CivHooks::CvLeague_NotifyProposalResult_with_CvRepealProposal>(host, &BeforeCvLeague_NotifyProposalResult_with_CvRepealProposal);CivRegisterAfter<CivHooks::CvLeague_NotifyProposalResult_with_CvRepealProposal>(host, &AfterCvLeague_NotifyProposalResult_with_CvRepealProposal);CivRegisterReplace<CivHooks::CvLeague_NotifyProposalResult_with_CvRepealProposal>(host, &ReplaceCvLeague_NotifyProposalResult_with_CvRepealProposal);

Code

5971void CvLeague::NotifyProposalResult(CvRepealProposal* pProposal)5972{5973	CvAssert(pProposal != NULL);5974	if (pProposal == NULL) return;59755976	Localization::String sSummaryTemp = Localization::Lookup("TXT_KEY_NOTIFICATION_LEAGUE_VOTING_RESULT_FAIL_SUMMARY");5977	Localization::String sMessageTemp = Localization::Lookup("TXT_KEY_NOTIFICATION_LEAGUE_VOTING_RESULT_REPEAL_FAIL");5978	CvString sName = GetResolutionName(pProposal->GetType(), pProposal->GetID(), pProposal->GetProposerDecision()->GetDecision(), /*bIncludePrefix*/ true);5979	int iTotalSessionVotes = GetVotesSpentThisSession();5980	if (pProposal->IsPassed(iTotalSessionVotes))5981	{5982		sSummaryTemp = Localization::Lookup("TXT_KEY_NOTIFICATION_LEAGUE_VOTING_RESULT_PASS_SUMMARY");5983		sMessageTemp = Localization::Lookup("TXT_KEY_NOTIFICATION_LEAGUE_VOTING_RESULT_REPEAL_PASS");5984	}5985	sSummaryTemp << sName;5986	sMessageTemp << sName;5987	CvString sSummary = sSummaryTemp.toUTF8();5988	CvString sMessage = sMessageTemp.toUTF8();5989	sMessage += "[NEWLINE]" + pProposal->GetRepealDecision()->GetVotesAsText(this);59905991#if defined(MOD_EVENTS_RESOLUTIONS)5992	if (MOD_EVENTS_RESOLUTIONS) {5993		GAMEEVENTINVOKE_HOOK(GAMEEVENT_ResolutionResult, pProposal->GetType(), pProposal->GetProposerDecision()->GetDecision(), false, pProposal->IsPassed(iTotalSessionVotes));5994	}5995#endif59965997	for (MemberList::iterator it = m_vMembers.begin(); it != m_vMembers.end(); it++)5998	{5999		PlayerTypes eMember = it->ePlayer;6000		if (GET_PLAYER(eMember).isHuman())6001		{6002			CvNotifications* pNotifications = GET_PLAYER(eMember).GetNotifications();6003			if (pNotifications)6004			{6005				pNotifications->Add(NOTIFICATION_LEAGUE_VOTING_DONE, sMessage, sSummary, -1, -1, GetID());6006			}				6007		}6008	}6009}

Calls

Called by