Hooks
static bool BeforeCvLeague_NotifySessionSoon(CvLeague* self, int iTurnsLeft);static void AfterCvLeague_NotifySessionSoon(CvLeague* self, int iTurnsLeft);static void ReplaceCvLeague_NotifySessionSoon(void (*original)(CvLeague*, int), CvLeague* self, int iTurnsLeft);CivRegisterBefore<CivHooks::CvLeague_NotifySessionSoon>(host, &BeforeCvLeague_NotifySessionSoon);CivRegisterAfter<CivHooks::CvLeague_NotifySessionSoon>(host, &AfterCvLeague_NotifySessionSoon);CivRegisterReplace<CivHooks::CvLeague_NotifySessionSoon>(host, &ReplaceCvLeague_NotifySessionSoon);
Code
6011void CvLeague::NotifySessionSoon(int iTurnsLeft)6012{6013 for (MemberList::iterator it = m_vMembers.begin(); it != m_vMembers.end(); it++)6014 {6015 PlayerTypes eMember = it->ePlayer;6016 if (GET_PLAYER(eMember).isHuman())6017 {6018 CvNotifications* pNotifications = GET_PLAYER(eMember).GetNotifications();6019 if (pNotifications)6020 {6021 CvString strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_LEAGUE_VOTING_SOON");60226023 Localization::String strTemp = Localization::Lookup("TXT_KEY_NOTIFICATION_LEAGUE_VOTING_SOON_TT");6024 strTemp << GetName() << iTurnsLeft;6025 CvString strInfo = strTemp.toUTF8();60266027 for (EnactProposalList::iterator itProposal = m_vEnactProposals.begin(); itProposal != m_vEnactProposals.end(); ++itProposal)6028 {6029 strInfo += "[NEWLINE][ICON_BULLET]";6030 strInfo += GetResolutionName(itProposal->GetType(), itProposal->GetID(), itProposal->GetProposerDecision()->GetDecision(), /*bIncludePrefix*/ true);6031 }6032 for (RepealProposalList::iterator itProposal = m_vRepealProposals.begin(); itProposal != m_vRepealProposals.end(); ++itProposal)6033 {6034 strInfo += "[NEWLINE][ICON_BULLET]";6035 strInfo += GetResolutionName(itProposal->GetType(), itProposal->GetID(), itProposal->GetProposerDecision()->GetDecision(), /*bIncludePrefix*/ true);6036 }60376038 pNotifications->Add(NOTIFICATION_LEAGUE_VOTING_SOON, strInfo, strSummary, -1, -1, GetID());6039 }6040 }6041 }6042}