private void onNotificationDismissed(NotificationCompleteEnum complete, DNotification notificationData)
 {
     if (notificationData.AdjustRectPositionForNotification && notificationData.Type != DNotification.NotificationType.DailyComplete && notificationData.Type != DNotification.NotificationType.ActivityTracker)
     {
         moveUp();
     }
 }
 private void onNotificationStart(DNotification notificationData)
 {
     if (notificationData.AdjustRectPositionForNotification && notificationData.Type != DNotification.NotificationType.DailyComplete && notificationData.Type != DNotification.NotificationType.ActivityTracker)
     {
         moveDown();
     }
 }
Exemple #3
0
        private bool onRejectFriendInvitationSent(FriendsServiceEvents.RejectFriendInvitationSent evt)
        {
            string        messageToken = (evt.Success ? "Friends.FriendsService.requestrejected" : "Friends.FriendsService.actionfailed");
            DNotification notification = createNotification(false, messageToken);

            Service.Get <TrayNotificationManager>().ShowNotification(notification);
            return(false);
        }
Exemple #4
0
    private bool onFriendInvitationSent(FriendsServiceEvents.SendFriendInvitationSent evt)
    {
        string        messageToken = evt.Success ? "Friends.FriendsService.invitationsent" : "Friends.FriendsService.invitationfailed";
        DNotification notification = createNotification(false, messageToken);

        Service.Get <TrayNotificationManager>().ShowNotification(notification);
        return(false);
    }
Exemple #5
0
        private bool onUnfriendSent(FriendsServiceEvents.UnfriendSent evt)
        {
            string        messageToken = (evt.Success ? "Friends.FriendsService.removedsuccessful" : "Friends.FriendsService.removednotsuccessful");
            DNotification notification = createNotification(false, messageToken);

            Service.Get <TrayNotificationManager>().ShowNotification(notification);
            return(false);
        }
Exemple #6
0
    private void showSaveNotification(string message)
    {
        DNotification dNotification = new DNotification();

        dNotification.ContainsButtons = false;
        dNotification.PopUpDelayTime  = 3f;
        dNotification.Message         = message;
        Service.Get <TrayNotificationManager>().ShowNotification(dNotification);
    }
Exemple #7
0
 public override void Show(DNotification data)
 {
     base.Show(data);
     notificationData    = (ActivityNotificationData)data.DataPayload;
     CoinRewardText.text = notificationData.CoinReward.ToString();
     if (notificationData != null)
     {
     }
 }
Exemple #8
0
        private DNotification createNotification(bool containsButtons, string messageToken, params string[] args)
        {
            DNotification dNotification = new DNotification();

            dNotification.ContainsButtons = containsButtons;
            dNotification.PopUpDelayTime  = 3f;
            dNotification.Message         = string.Format(localizer.GetTokenTranslation(messageToken), args);
            return(dNotification);
        }
    public void OnDestroy()
    {
        DNotification dNotification = new DNotification();

        dNotification.PrefabLocation  = TrayNotificationManager.NonDisruptiveNotificationContentKey;
        dNotification.Message         = NotificationText;
        dNotification.ContainsButtons = false;
        dNotification.PopUpDelayTime  = 3f;
        Service.Get <TrayNotificationManager>().ShowNotification(dNotification);
    }
 private void notificationButtonPressed(NotificationCompleteEnum type, DNotification data)
 {
     noteCount--;
     if (noteCount == 0)
     {
         TrayNotificationManager trayNotificationManager = manager;
         trayNotificationManager.NotificationDismissed = (Action <NotificationCompleteEnum, DNotification>)Delegate.Remove(trayNotificationManager.NotificationDismissed, new Action <NotificationCompleteEnum, DNotification>(notificationButtonPressed));
         GUITray.SetActive(value: false);
     }
 }
Exemple #11
0
 private void ShowNotification()
 {
     if (!string.IsNullOrEmpty(NotificationText))
     {
         DNotification dNotification = new DNotification();
         dNotification.Message         = NotificationText;
         dNotification.ContainsButtons = false;
         dNotification.PopUpDelayTime  = 3f;
         Service.Get <TrayNotificationManager>().ShowNotification(dNotification);
     }
 }
 private void setExampleData()
 {
     noButtonNotification                 = new DNotification();
     noButtonNotification.Message         = "Test notification without buttons.";
     noButtonNotification.ContainsButtons = false;
     noButtonNotification.PopUpDelayTime  = 5f;
     buttonsNotification                 = new DNotification();
     buttonsNotification.Message         = "Test notification with buttons!";
     buttonsNotification.ContainsButtons = true;
     buttonsNotification.PopUpDelayTime  = 10f;
 }
Exemple #13
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);
        }
Exemple #14
0
    protected void showMembershipDisclaimer(string notificationText)
    {
        DNotification dNotification = new DNotification();

        dNotification.PrefabLocation       = new PrefabContentKey(TrayNotificationManager.MemberNotificationContentKey);
        dNotification.Message              = notificationText;
        dNotification.ContainsButtons      = false;
        dNotification.AutoClose            = false;
        dNotification.PersistBetweenScenes = false;
        Service.Get <TrayNotificationManager>().ShowNotification(dNotification);
    }
		public override void OnEnter()
		{
			DNotification dNotification = new DNotification();
			dNotification.PrefabLocation = new PrefabContentKey(PrefabLocation);
			dNotification.Message = Service.Get<Localizer>().GetTokenTranslation(i18nMessage);
			dNotification.ContainsButtons = ContainsButtons;
			dNotification.AutoClose = AutoClose;
			dNotification.PopUpDelayTime = PopUpDelayTime;
			dNotification.PersistBetweenScenes = PersistBetweenScenes;
			Service.Get<TrayNotificationManager>().ShowNotification(dNotification);
			Finish();
		}
Exemple #16
0
    private bool onShowIglooNotification(IglooUIEvents.ShowNotification evt)
    {
        DNotification dNotification = new DNotification();

        dNotification.PopUpDelayTime = evt.DisplayTime;
        dNotification.PrefabLocation = evt.Prefab;
        dNotification.Message        = evt.TranslatedText;
        dNotification.AdjustRectPositionForNotification = evt.AdjustRectPositionForNotification;
        dNotification.ShowAfterSceneLoad   = evt.ShowAfterSceneLoad;
        dNotification.PersistBetweenScenes = false;
        dNotification.HeaderTint           = new Color32(75, 102, 184, byte.MaxValue);
        trayNotificationManager.ShowNotification(dNotification);
        return(false);
    }
        private void notificationComplete(NotificationCompleteEnum completed)
        {
            TrayNotification trayNotification = currentNotification;

            trayNotification.ENotificationCompleted = (Action <NotificationCompleteEnum>)Delegate.Remove(trayNotification.ENotificationCompleted, new Action <NotificationCompleteEnum>(notificationComplete));
            currentNotificationPanel.SetActive(value: false);
            DNotification arg = notificationData;

            notificationData = null;
            if (NotificationDismissed != null)
            {
                NotificationDismissed(completed, arg);
            }
            SetParticlesActive(state: false);
        }
Exemple #18
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);
        }
    }
Exemple #19
0
    public override void Show(DNotification data)
    {
        base.Show(data);
        Task task = (Task)data.DataPayload;

        if (task != null)
        {
            string subGroupByTaskName = Service.Get <TaskService>().GetSubGroupByTaskName(task.Id);
            Mascot mascot             = Service.Get <MascotService>().GetMascot(subGroupByTaskName);
            MascotImage.color = mascot.Definition.NavigationArrowColor;
            if (ParticlesToTint != null)
            {
                ParticlesToTint.SetStartColor(mascot.Definition.NavigationArrowColor);
            }
            messageWithoutButtons.color = mascot.Definition.NavigationArrowColor;
            if (data.Type == DNotification.NotificationType.DailyComplete)
            {
                DailyChallengesListItem.ClaimDailyTaskReward(task);
            }
        }
    }
 public virtual void Show(DNotification data)
 {
     if (anim == null)
     {
         anim = GetComponent <Animator>();
     }
     anim.SetBool("HideNotification", value: false);
     messageWithoutButtons.text = data.Message;
     if (TintableHeader != null)
     {
         TintableHeader.color = data.HeaderTint;
     }
     if (data.ContainsButtons)
     {
         NotificationView.SetActive(value: false);
         if (NotificationButtonView != null)
         {
             NotificationButtonView.SetActive(value: true);
         }
         messageWithButtons.text = data.Message;
     }
     else
     {
         if (NotificationButtonView != null)
         {
             NotificationButtonView.SetActive(value: false);
         }
         NotificationView.SetActive(value: true);
     }
     if (AccessibilitySpeak != null)
     {
         AccessibilitySpeak.enabled = true;
     }
     Service.Get <EventDispatcher>().AddListener <SceneTransitionEvents.TransitionStart>(onSceneTransition);
     if (data.AutoClose)
     {
         CoroutineRunner.Start(notificationDisplayTime(data.PopUpDelayTime), this, "notificationDisplayTime");
     }
 }
        public void ShowNotification(DNotification notificationData)
        {
            this.notificationData = notificationData;
            switch (notificationData.Type)
            {
            case DNotification.NotificationType.DailyComplete:
                currentNotificationPanel = DailyNotificationPanel;
                currentNotification      = DailyNotification;
                break;

            case DNotification.NotificationType.ActivityTracker:
                currentNotificationPanel = ActivityTrackerNotificationPanel;
                currentNotification      = ActivityTrackerNotification;
                break;
            }
            currentNotificationPanel.SetActive(value: true);
            TrayNotification trayNotification = currentNotification;

            trayNotification.ENotificationCompleted = (Action <NotificationCompleteEnum>)Delegate.Combine(trayNotification.ENotificationCompleted, new Action <NotificationCompleteEnum>(notificationComplete));
            currentNotification.Show(notificationData);
            SetParticlesActive(state: true);
        }
Exemple #22
0
    private bool onSelfJoinedRoom(WorldServiceEvents.SelfRoomJoinedEvent evt)
    {
        IsConnecting = false;
        dispatcher.RemoveListener <WorldServiceEvents.SelfRoomJoinedEvent>(onSelfJoinedRoom);
        ZoneDefinition zone = GetZone(evt.Room.zoneId.name);

        if (zone != null && !zone.IsQuestOnly && zone.Type != ZoneDefinition.ZoneType.Igloo)
        {
            Service.Get <GameSettings>().LastZone.SetValue(evt.Room.zoneId.name);
            IsInIgloo = false;
        }
        else if (zone != null)
        {
            IsInIgloo = (zone.Type == ZoneDefinition.ZoneType.Igloo);
        }
        checkIfZoneTransitionComplete();
        checkForLocalizationChange(GetWorld(evt.Room.world));
        if (targetWorldToJoin != null && targetWorldToJoin != evt.Room.world)
        {
            onJoinNotificationTag = "GlobalUI.Notification.WorldBump";
        }
        if (!string.IsNullOrEmpty(onJoinNotificationTag))
        {
            DNotification dNotification = new DNotification();
            dNotification.Message              = string.Format(Service.Get <Localizer>().GetTokenTranslation(onJoinNotificationTag), evt.Room.world);
            dNotification.PopUpDelayTime       = 6f;
            dNotification.WaitForLoading       = true;
            dNotification.PersistBetweenScenes = false;
            Service.Get <TrayNotificationManager>().ShowNotification(dNotification);
            onJoinNotificationTag = string.Empty;
        }
        Service.Get <ICPSwrveService>().EndTimer("igloo");
        if (zone.Type == ZoneDefinition.ZoneType.Igloo)
        {
            startBIVisitIglooTimer(evt);
        }
        return(false);
    }
 public ShowTrayNotificationCommand(DNotification notificationData, RectTransform notificationParentTransform)
 {
     this.notificationData            = notificationData;
     this.notificationParentTransform = notificationParentTransform;
 }
 public void CreateNotification(DNotification notification)
 {
     Callback?.CreateNotification(notification);
 }
Exemple #25
0
        private void onFriendInvitationNotificationDismissed(NotificationCompleteEnum dismissAction, DNotification data)
        {
            TrayNotificationManager obj = trayNotificationManager;

            obj.NotificationDismissed = (Action <NotificationCompleteEnum, DNotification>)Delegate.Remove(obj.NotificationDismissed, new Action <NotificationCompleteEnum, DNotification>(onFriendInvitationNotificationDismissed));
            switch (dismissAction)
            {
            case NotificationCompleteEnum.acceptButton:
                if (FriendsDataModelService.FriendsList.Count < FriendsDataModelService.MaxFriendsCount)
                {
                    IncomingFriendInvitationData incomingFriendInvitationData2 = (IncomingFriendInvitationData)data.DataPayload;
                    Service.Get <INetworkServicesManager>().FriendsService.AcceptFriendInvitation(incomingFriendInvitationData2.Invitation, Service.Get <SessionManager>().LocalUser);
                }
                else
                {
                    Service.Get <PromptManager>().ShowPrompt("MaximumFriendsPrompt", null);
                }
                break;

            case NotificationCompleteEnum.declineButton:
            {
                IncomingFriendInvitationData incomingFriendInvitationData = (IncomingFriendInvitationData)data.DataPayload;
                Service.Get <INetworkServicesManager>().FriendsService.RejectFriendInvitation(incomingFriendInvitationData.Invitation, Service.Get <SessionManager>().LocalUser);
                break;
            }
            }
        }
Exemple #26
0
        private void onOutgoingFriendInvitationAccepted(string displayName, IFriend friend)
        {
            DNotification notification = createNotification(false, "Friends.FriendsService.acceptedinvitation", displayName);

            trayNotificationManager.ShowNotification(notification);
        }
        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);
            }
        }