Bazaar developer reference

CvNotifications::Dismiss(int, bool)

Defined in
CvNotifications.cpp, line 523
Class
CvNotifications
Hook name
CivHooks::CvNotifications_Dismiss

Hooks

static bool BeforeCvNotifications_Dismiss(CvNotifications* self, int iLookupIndex, bool bUserInvoked);static void AfterCvNotifications_Dismiss(CvNotifications* self, int iLookupIndex, bool bUserInvoked);static void ReplaceCvNotifications_Dismiss(void (*original)(CvNotifications*, int, bool), CvNotifications* self, int iLookupIndex, bool bUserInvoked);CivRegisterBefore<CivHooks::CvNotifications_Dismiss>(host, &BeforeCvNotifications_Dismiss);CivRegisterAfter<CivHooks::CvNotifications_Dismiss>(host, &AfterCvNotifications_Dismiss);CivRegisterReplace<CivHooks::CvNotifications_Dismiss>(host, &ReplaceCvNotifications_Dismiss);

Code

523void CvNotifications::Dismiss(int iLookupIndex, bool bUserInvoked)524{525	int iIndex = m_iNotificationsBeginIndex;526	while(iIndex != m_iNotificationsEndIndex)527	{528		if(m_aNotifications[iIndex].m_iLookupIndex == iLookupIndex)529		{530			m_aNotifications[iIndex].m_bDismissed = true;531			GC.GetEngineUserInterface()->RemoveNotification(m_aNotifications[iIndex].m_iLookupIndex, m_ePlayer);532533			switch(m_aNotifications[iIndex].m_eNotificationType)534			{535			case NOTIFICATION_POLICY:536			{537				if(m_ePlayer == GC.getGame().getActivePlayer() && bUserInvoked)538				{539					GC.GetEngineUserInterface()->SetPolicyNotificationSeen(true);540				}541#if defined(MOD_BUGFIX_MINOR)542				break;543#endif544			}545#if defined(MOD_AI_MP_DIPLOMACY)546			case NOTIFICATION_PLAYER_DEAL_RECEIVED:547			{548				break;549			}550#endif551			default:552				break;553			}554555			break;556		}557558		iIndex++;559		if(iIndex >= (int)m_aNotifications.size())560		{561			iIndex = 0;562		}563	}564}

Calls

Called by