Bazaar developer reference

CvNotifications::IsNotificationTypeEndOfTurnExpired(NotificationTypes, int)

Defined in
CvNotifications.cpp, line 2020
Class
CvNotifications
Hook name
CivHooks::CvNotifications_IsNotificationTypeEndOfTurnExpired

Hooks

static bool BeforeCvNotifications_IsNotificationTypeEndOfTurnExpired(CvNotifications* self, NotificationTypes eNotificationType, int iForSpecificEntry, bool& result);static void AfterCvNotifications_IsNotificationTypeEndOfTurnExpired(CvNotifications* self, NotificationTypes eNotificationType, int iForSpecificEntry, bool& result);static bool ReplaceCvNotifications_IsNotificationTypeEndOfTurnExpired(bool (*original)(CvNotifications*, NotificationTypes, int), CvNotifications* self, NotificationTypes eNotificationType, int iForSpecificEntry);CivRegisterBefore<CivHooks::CvNotifications_IsNotificationTypeEndOfTurnExpired>(host, &BeforeCvNotifications_IsNotificationTypeEndOfTurnExpired);CivRegisterAfter<CivHooks::CvNotifications_IsNotificationTypeEndOfTurnExpired>(host, &AfterCvNotifications_IsNotificationTypeEndOfTurnExpired);CivRegisterReplace<CivHooks::CvNotifications_IsNotificationTypeEndOfTurnExpired>(host, &ReplaceCvNotifications_IsNotificationTypeEndOfTurnExpired);

Code

2020bool CvNotifications::IsNotificationTypeEndOfTurnExpired(NotificationTypes eNotificationType, int iForSpecificEntry /*= -1*/)2021{2022	switch(eNotificationType)2023	{2024	case NOTIFICATION_POLICY:2025	case NOTIFICATION_FREE_POLICY:2026	case NOTIFICATION_TECH:2027	case NOTIFICATION_FREE_TECH:2028	case NOTIFICATION_PRODUCTION:2029	case NOTIFICATION_DIPLO_VOTE:2030	case NOTIFICATION_PLAYER_DEAL:2031	case NOTIFICATION_PLAYER_DEAL_RECEIVED:2032	case NOTIFICATION_FREE_GREAT_PERSON:2033	case NOTIFICATION_FOUND_PANTHEON:2034	case NOTIFICATION_FOUND_RELIGION:2035	case NOTIFICATION_ENHANCE_RELIGION:2036	case NOTIFICATION_SPY_STOLE_TECH:2037	case NOTIFICATION_MAYA_LONG_COUNT:2038	case NOTIFICATION_FAITH_GREAT_PERSON:2039	case NOTIFICATION_ADD_REFORMATION_BELIEF:2040	case NOTIFICATION_LEAGUE_CALL_FOR_PROPOSALS:2041	case NOTIFICATION_CHOOSE_ARCHAEOLOGY:2042	case NOTIFICATION_LEAGUE_CALL_FOR_VOTES:2043	case NOTIFICATION_CHOOSE_IDEOLOGY:2044		return false;2045		break;20462047	// These multiplayer notifications expire at the end of the next turn.2048	case NOTIFICATION_PLAYER_RECONNECTED:2049	case NOTIFICATION_PLAYER_DISCONNECTED:2050	case NOTIFICATION_HOST_MIGRATION:2051	case NOTIFICATION_PLAYER_CONNECTING:2052		if(iForSpecificEntry != -1 && m_aNotifications[iForSpecificEntry].m_iTurn == GC.getGame().getGameTurn()) //same turn as creation.2053		{2054			return false;2055		}2056		break;20572058	// In multiplayer, these notifications expire once they've been broadcast for the player and2059	// it is at least the end of the next turn.2060	// These are notifications that can occur mid-turn and are important enough that they shouldn't2061	// expire until the player has seen them.2062	case NOTIFICATION_UNIT_PROMOTION:2063	case NOTIFICATION_CAPITAL_LOST_ACTIVE_PLAYER:2064	case NOTIFICATION_CAPITAL_LOST:2065	case NOTIFICATION_WAR_ACTIVE_PLAYER:2066	case NOTIFICATION_WAR:2067	case NOTIFICATION_PEACE_ACTIVE_PLAYER:2068	case NOTIFICATION_PEACE:2069	case NOTIFICATION_VICTORY:2070	case NOTIFICATION_UNIT_DIED:2071	case NOTIFICATION_CITY_LOST:2072	case NOTIFICATION_PLAYER_KILLED:2073	case NOTIFICATION_DIPLOMACY_DECLARATION:2074	case NOTIFICATION_OTHER_PLAYER_NEW_ERA:2075	case NOTIFICATION_MINOR_BUYOUT:2076	case NOTIFICATION_LIBERATED_MAJOR_CITY:2077	case NOTIFICATION_RESURRECTED_MAJOR_CIV:2078	case NOTIFICATION_TURN_MODE_SEQUENTIAL:2079	case NOTIFICATION_TURN_MODE_SIMULTANEOUS:2080	case NOTIFICATION_PLAYER_KICKED:20812082	//XP12083	case NOTIFICATION_RELIGION_FOUNDED_ACTIVE_PLAYER:2084	case NOTIFICATION_RELIGION_FOUNDED:2085	case NOTIFICATION_PANTHEON_FOUNDED_ACTIVE_PLAYER:2086	case NOTIFICATION_PANTHEON_FOUNDED:20872088	//XP22089	case NOTIFICATION_TRADE_ROUTE_BROKEN:2090	case NOTIFICATION_REFORMATION_BELIEF_ADDED_ACTIVE_PLAYER:2091	case NOTIFICATION_REFORMATION_BELIEF_ADDED:2092		if(iForSpecificEntry != -1 && GC.getGame().isGameMultiPlayer() 2093			&& (m_aNotifications[iForSpecificEntry].m_bNeedsBroadcast //not broadcast yet.2094				|| m_aNotifications[iForSpecificEntry].m_iTurn == GC.getGame().getGameTurn())) //same turn as creation.2095		{2096			return false;2097		}2098		break;20992100#if defined(MOD_UI_CITY_EXPANSION)2101	case NOTIFICATION_CITY_TILE:2102		return !MOD_UI_CITY_EXPANSION;2103		break;2104#endif21052106	default:2107		return true;2108		break;2109	}21102111	return true;2112}

Calls

Called by