Hooks
static bool BeforeCvLeague_CheckStartSpecialSession(CvLeague* self, LeagueSpecialSessionTypes eSpecialSession);static void AfterCvLeague_CheckStartSpecialSession(CvLeague* self, LeagueSpecialSessionTypes eSpecialSession);static void ReplaceCvLeague_CheckStartSpecialSession(void (*original)(CvLeague*, LeagueSpecialSessionTypes), CvLeague* self, LeagueSpecialSessionTypes eSpecialSession);CivRegisterBefore<CivHooks::CvLeague_CheckStartSpecialSession>(host, &BeforeCvLeague_CheckStartSpecialSession);CivRegisterAfter<CivHooks::CvLeague_CheckStartSpecialSession>(host, &AfterCvLeague_CheckStartSpecialSession);CivRegisterReplace<CivHooks::CvLeague_CheckStartSpecialSession>(host, &ReplaceCvLeague_CheckStartSpecialSession);
Code
5323void CvLeague::CheckStartSpecialSession(LeagueSpecialSessionTypes eSpecialSession)5324{5325 if (CanStartSpecialSession(eSpecialSession))5326 {5327 CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(eSpecialSession);5328 CvAssert(pInfo);5329 if (pInfo != NULL)5330 {5331 CvGame& kGame = GC.getGame();5332 CvPlayer& kActivePlayer = GET_PLAYER(kGame.getActivePlayer());53335334#if defined(MOD_API_EXTENSIONS)5335 if(!kGame.isReallyNetworkMultiPlayer() && !kActivePlayer.isObserver()){5336#else5337 if(!kGame.isNetworkMultiPlayer() && !kActivePlayer.isObserver()){5338#endif5339 // Show splash screen5340 CvPopupInfo kPopup(BUTTONPOPUP_LEAGUE_SPLASH, GetID(), GetHostMember(), eSpecialSession, 0, /*bJustFounded*/ false);5341 GC.GetEngineUserInterface()->AddPopup(kPopup);5342 }53435344 DLLUI->AddMessage(0, kGame.getActivePlayer(), false, GC.getEVENT_MESSAGE_TIME(), 5345 GetLocalizedText(pInfo->GetDescriptionKey()).GetCString());53465347 // Becomes United Nations?5348 CvAssert(!(!pInfo->IsUnitedNations() && IsUnitedNations())); // UN shouldn't be reversible5349 if (pInfo->IsUnitedNations())5350 {5351 SetUnitedNations(true);5352 }53535354 // Only actually hold a session if there is a proposal to be decided5355 CvAssertMsg(pInfo->GetImmediateProposal() != NO_RESOLUTION, "Cannot hold special session because there is no proposal to decide on. Please send Anton your save file and version.");5356 if (pInfo->GetImmediateProposal() != NO_RESOLUTION)5357 {5358 StartSpecialSession(eSpecialSession);5359 }5360 }5361 }5362}