public void ShowNoButtonsNotification()
    {
        GUITray.SetActive(value: true);
        noteCount = 1;
        TrayNotificationManager trayNotificationManager = manager;

        trayNotificationManager.NotificationDismissed = (Action <NotificationCompleteEnum, DNotification>)Delegate.Combine(trayNotificationManager.NotificationDismissed, new Action <NotificationCompleteEnum, DNotification>(notificationButtonPressed));
        manager.ShowNotification(noButtonNotification);
    }
Exemplo n.º 2
0
        private void onIncomingFriendInvitationComponentInitialized(IncomingFriendInvitationData incomingFriendInvitationData)
        {
            incomingFriendInvitationData.OnInitialized -= onIncomingFriendInvitationComponentInitialized;
            DNotification dNotification = createNotification(true, "Friends.FriendsService.wantsfriend", incomingFriendInvitationData.Invitation.Inviter.DisplayName.Text);

            dNotification.DataPayload = incomingFriendInvitationData;
            TrayNotificationManager obj = trayNotificationManager;

            obj.NotificationDismissed = (Action <NotificationCompleteEnum, DNotification>)Delegate.Combine(obj.NotificationDismissed, new Action <NotificationCompleteEnum, DNotification>(onFriendInvitationNotificationDismissed));
            trayNotificationManager.ShowNotification(dNotification);
        }
Exemplo n.º 3
0
    private IEnumerator showNotification(Task task)
    {
        yield return(new WaitForSeconds(1.3f));

        if (!tasksAlreadyShown.Contains(task.Id))
        {
            tasksAlreadyShown.Add(task.Id);
            DNotification dNotification = new DNotification();
            dNotification.PopUpDelayTime = 3.7f;
            dNotification.DataPayload    = task;
            dNotification.PrefabLocation = TrayNotificationManager.CellPhoneDailyNotificationContentKey;
            dNotification.Message        = Service.Get <Localizer>().GetTokenTranslation(task.Definition.CompletionMessage);
            dNotification.Type           = DNotification.NotificationType.DailyComplete;
            trayNotificationManager.ShowNotification(dNotification);
        }
    }
        private void triggerNotification(ActivityNotificationScheduleBlock notificationBlock)
        {
            int num  = generateRandomNotificationIndex(notificationBlock.Notifications.Length);
            int num2 = num;
            CellPhoneActivityDefinition cellPhoneActivityDefinition = null;

            do
            {
                cellPhoneActivityDefinition = notificationBlock.Notifications[num];
                if (cellPhoneActivityDefinition.GetType() == typeof(CellPhoneScheduledLocationActivityDefinition) || cellPhoneActivityDefinition.GetType().IsSubclassOf(typeof(CellPhoneScheduledLocationActivityDefinition)))
                {
                    CellPhoneScheduledLocationActivityDefinition cellPhoneScheduledLocationActivityDefinition = (CellPhoneScheduledLocationActivityDefinition)cellPhoneActivityDefinition;
                    DateTime target = Service.Get <ContentSchedulerService>().ScheduledEventDate();
                    if (cellPhoneScheduledLocationActivityDefinition is CellPhoneRecurringLocationActivityDefinition)
                    {
                        cellPhoneScheduledLocationActivityDefinition = CellPhoneActivityScreenRecurringWidgetLoader.GetActiveRecurringActivityDefinition(recurringActivityDefinitions);
                    }
                    if (cellPhoneScheduledLocationActivityDefinition != null && DateTimeUtils.DoesDateFallBetween(target, cellPhoneScheduledLocationActivityDefinition.GetStartingDate().Date, cellPhoneScheduledLocationActivityDefinition.GetEndingDate().Date))
                    {
                        break;
                    }
                    cellPhoneActivityDefinition = null;
                    num++;
                    if (num >= notificationBlock.Notifications.Length)
                    {
                        num = 0;
                    }
                    continue;
                }
                break;
            }while (num != num2);
            if (!(cellPhoneActivityDefinition != null))
            {
                return;
            }
            string message = "";

            if (cellPhoneActivityDefinition is CellPhoneQuestActivityDefinition)
            {
                CellPhoneQuestActivityDefinition cellPhoneQuestActivityDefinition = (CellPhoneQuestActivityDefinition)cellPhoneActivityDefinition;
                cellPhoneQuestActivityDefinition.Quest = getAvailableQuest();
                if (cellPhoneQuestActivityDefinition.Quest != null)
                {
                    message = localizer.GetTokenTranslation(cellPhoneQuestActivityDefinition.Quest.Mascot.GoForItNotificationText);
                }
            }
            else
            {
                message = localizer.GetTokenTranslation(cellPhoneActivityDefinition.NotificationMessageToken);
            }
            if (checkNotificationIsAllowed(cellPhoneActivityDefinition))
            {
                ActivityNotificationData dataPayload = null;
                if (schedule.NotificationReward.ToReward().TryGetValue <CoinReward>(out var rewardable))
                {
                    dataPayload = new ActivityNotificationData(rewardable.Coins, cellPhoneActivityDefinition);
                }
                DNotification dNotification = new DNotification();
                dNotification.PopUpDelayTime       = NotificationShowTime;
                dNotification.DataPayload          = dataPayload;
                dNotification.PrefabLocation       = notificationKey;
                dNotification.Message              = message;
                dNotification.Type                 = DNotification.NotificationType.ActivityTracker;
                dNotification.PersistBetweenScenes = false;
                trayNotificationManager.ShowNotification(dNotification);
            }
        }