コード例 #1
0
 private void onNotificationDismissed(NotificationCompleteEnum complete, DNotification notificationData)
 {
     if (notificationData.AdjustRectPositionForNotification && notificationData.Type != DNotification.NotificationType.DailyComplete && notificationData.Type != DNotification.NotificationType.ActivityTracker)
     {
         moveUp();
     }
 }
コード例 #2
0
 private void onNotificationStart(DNotification notificationData)
 {
     if (notificationData.AdjustRectPositionForNotification && notificationData.Type != DNotification.NotificationType.DailyComplete && notificationData.Type != DNotification.NotificationType.ActivityTracker)
     {
         moveDown();
     }
 }
コード例 #3
0
 public void ShowNotification(DNotification notification)
 {
     if (isEnabled && !(notificationParentTransform == null))
     {
         notificationQueue.Enqueue(notification);
         checkQueue();
     }
 }
コード例 #4
0
        private void showNotification()
        {
            string        tokenTranslation = Service.Get <Localizer>().GetTokenTranslation("GlobalUI.ReportingBans.SuccessNotification");
            DNotification dNotification    = new DNotification();

            dNotification.PopUpDelayTime = 6f;
            dNotification.Message        = tokenTranslation;
            Service.Get <TrayNotificationManager>().ShowNotification(dNotification);
        }
コード例 #5
0
 public override void Show(DNotification data)
 {
     base.Show(data);
     notificationData    = (ActivityNotificationData)data.DataPayload;
     CoinRewardText.text = notificationData.CoinReward.ToString();
     if (notificationData != null)
     {
     }
 }
コード例 #6
0
 private void checkQueue()
 {
     if (!showingNotification && notificationQueue.Count > 0)
     {
         showingNotification        = true;
         displayingNotificationData = notificationQueue.Dequeue();
         persistCurrentNotification = displayingNotificationData.PersistBetweenScenes;
         showNotification();
     }
 }
コード例 #7
0
        public static void ShowTestNotification(string message = "Test message", float delayTime = 5f, bool containsButtons = false, DNotification.NotificationType type = DNotification.NotificationType.Generic)
        {
            DNotification dNotification = new DNotification();

            dNotification.ContainsButtons = containsButtons;
            dNotification.Message         = message;
            dNotification.PopUpDelayTime  = delayTime;
            dNotification.Type            = type;
            if (containsButtons)
            {
                TrayNotificationManager trayNotificationManager = Service.Get <TrayNotificationManager>();
                trayNotificationManager.NotificationDismissed = (Action <NotificationCompleteEnum, DNotification>)Delegate.Combine(trayNotificationManager.NotificationDismissed, new Action <NotificationCompleteEnum, DNotification>(onNotificationDismissed));
            }
            Service.Get <TrayNotificationManager>().ShowNotification(dNotification);
        }
コード例 #8
0
 public override void Show(DNotification data)
 {
     base.Show(data);
     ClubPenguin.Task.Task task = (ClubPenguin.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);
         }
     }
 }
コード例 #9
0
        private static void onNotificationDismissed(NotificationCompleteEnum notificationOutcome, DNotification notification)
        {
            TrayNotificationManager trayNotificationManager = Service.Get <TrayNotificationManager>();

            trayNotificationManager.NotificationDismissed = (Action <NotificationCompleteEnum, DNotification>)Delegate.Remove(trayNotificationManager.NotificationDismissed, new Action <NotificationCompleteEnum, DNotification>(onNotificationDismissed));
            DNotification dNotification = new DNotification();

            dNotification.PopUpDelayTime = 5f;
            switch (notificationOutcome)
            {
            case NotificationCompleteEnum.acceptButton:
                dNotification.Message = "Accepted";
                Service.Get <TrayNotificationManager>().ShowNotification(dNotification);
                break;

            case NotificationCompleteEnum.declineButton:
                dNotification.Message = "Declined";
                Service.Get <TrayNotificationManager>().ShowNotification(dNotification);
                break;
            }
        }
コード例 #10
0
 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");
     }
 }
コード例 #11
0
 private void notificationComplete(NotificationCompleteEnum notificationOutcome, DNotification notificationData)
 {
     currentNotification = null;
     if (notificationOutcome == NotificationCompleteEnum.leftRoom && persistCurrentNotification)
     {
         reshowPreviousNotification = true;
         return;
     }
     if (NotificationDismissed != null)
     {
         NotificationDismissed(notificationOutcome, notificationData);
     }
     showingNotification = false;
     checkQueue();
 }
コード例 #12
0
 public ShowTrayNotificationCommand(DNotification notificationData, RectTransform notificationParentTransform)
 {
     this.notificationData            = notificationData;
     this.notificationParentTransform = notificationParentTransform;
 }
コード例 #13
0
 public override void Show(DNotification data)
 {
     rawMessage = data.Message;
     base.Show(data);
 }