CvNotifications::MayUserDismiss(int)
- Defined in
- CvNotifications.cpp, line 567
- Class
- CvNotifications
- Hook name
CivHooks::CvNotifications_MayUserDismiss
Hooks
static bool BeforeCvNotifications_MayUserDismiss(CvNotifications* self, int iLookupIndex, bool& result);static void AfterCvNotifications_MayUserDismiss(CvNotifications* self, int iLookupIndex, bool& result);static bool ReplaceCvNotifications_MayUserDismiss(bool (*original)(CvNotifications*, int), CvNotifications* self, int iLookupIndex);CivRegisterBefore<CivHooks::CvNotifications_MayUserDismiss>(host, &BeforeCvNotifications_MayUserDismiss);CivRegisterAfter<CivHooks::CvNotifications_MayUserDismiss>(host, &AfterCvNotifications_MayUserDismiss);CivRegisterReplace<CivHooks::CvNotifications_MayUserDismiss>(host, &ReplaceCvNotifications_MayUserDismiss);
Code
567bool CvNotifications::MayUserDismiss(int iLookupIndex)568{569 int iIndex = m_iNotificationsBeginIndex;570 while(iIndex != m_iNotificationsEndIndex)571 {572 if(m_aNotifications[iIndex].m_iLookupIndex == iLookupIndex)573 {574 switch(m_aNotifications[iIndex].m_eNotificationType)575 {576 case NOTIFICATION_DIPLO_VOTE:577 case NOTIFICATION_PRODUCTION:578 case NOTIFICATION_TECH:579 case NOTIFICATION_FREE_TECH:580 case NOTIFICATION_FREE_POLICY:581 case NOTIFICATION_FREE_GREAT_PERSON:582 case NOTIFICATION_FOUND_PANTHEON:583 case NOTIFICATION_FOUND_RELIGION:584 case NOTIFICATION_ENHANCE_RELIGION:585 case NOTIFICATION_SPY_STOLE_TECH:586 case NOTIFICATION_MAYA_LONG_COUNT:587 case NOTIFICATION_FAITH_GREAT_PERSON:588 case NOTIFICATION_ADD_REFORMATION_BELIEF:589 case NOTIFICATION_LEAGUE_CALL_FOR_PROPOSALS:590 case NOTIFICATION_CHOOSE_ARCHAEOLOGY:591 case NOTIFICATION_LEAGUE_CALL_FOR_VOTES:592 case NOTIFICATION_CHOOSE_IDEOLOGY:593 return false;594 break;595596#if defined(MOD_UI_CITY_EXPANSION)597 // We'll let the user right click the End Turn button to ignore this, as the notification will be sent again next turn 598 case NOTIFICATION_CITY_TILE:599 // We could just let this drop through as the default is true anyway600 return true;601 break;602#endif603604 case NOTIFICATION_POLICY:605 if(GC.getGame().isOption(GAMEOPTION_POLICY_SAVING))606 {607 return true;608 break;609 }610 else611 {612 return false;613 break;614 }615616 default:617 return true;618 break;619 }620 }621622 iIndex++;623 if(iIndex >= (int)m_aNotifications.size())624 {625 iIndex = 0;626 }627 }628629 return false;630}
Calls
- CvGame::isOption(GameOptionTypes) const
- CvGlobals::getGame()
std::vector::operator[]std::vector::size