public void SetCellPhoneNotificationHandler(CellPhoneNotificationHandler handler) { cellPhoneNotificationHandler = handler; CellPhoneNotificationHandler obj = cellPhoneNotificationHandler; obj.NotificationDismissed = (Action <NotificationCompleteEnum, DNotification>)Delegate.Combine(obj.NotificationDismissed, new Action <NotificationCompleteEnum, DNotification>(notificationComplete)); }
private void Start() { eventDispatcher = Service.Get <EventDispatcher>(); eventChannel = new EventChannel(eventDispatcher); eventChannel.AddListener <HudEvents.HideCellPhoneHud>(onHideCellPhoneHud); eventChannel.AddListener <HudEvents.ShowCellPhoneHud>(onShowCellPhoneHud); eventChannel.AddListener <CellPhoneEvents.CellPhoneClosed>(onCellPhoneClosed); notificationHandler = GetComponent <CellPhoneNotificationHandler>(); if (Service.Get <SceneTransitionService>().HasSceneArg(SceneTransitionService.SceneArgs.ShowCellPhoneOnEnterScene.ToString())) { CoroutineRunner.Start(showPhone(playTransitionAnimation: false), this, "showPhone(false)"); } else { if (!Service.Get <GameStateController>().IsFTUEComplete || Service.Get <ZoneTransitionService>().IsInIgloo) { return; } bool flag = true; DateTime dateTime = Service.Get <ContentSchedulerService>().PresentTime(); if (shouldPreventPhoneFromOpening()) { flag = false; PlayerPrefs.SetString("DailyChallengesLastOpen", dateTime.GetTimeInMilliseconds().ToString()); } else if (PlayerPrefs.HasKey("DailyChallengesLastOpen")) { string @string = PlayerPrefs.GetString("DailyChallengesLastOpen"); if (!string.IsNullOrEmpty(@string)) { DateTime dateTime2 = Convert.ToInt64(@string).MsToDateTime(); if (dateTime.Day == dateTime2.Day) { flag = false; } } } if (flag) { autoOpened = true; if (!Service.Get <LoadingController>().IsLoading) { CoroutineRunner.Start(playRingAnimationAndShowPhone(), this, "CellPhoneRing"); } else { eventDispatcher.AddListener <LoadingController.LoadingScreenHiddenEvent>(onLoadingScreenHidden); } logOpenPhoneBi(); PlayerPrefs.SetString("DailyChallengesLastOpen", dateTime.GetTimeInMilliseconds().ToString()); } } }