Beispiel #1
0
        private List <CellPhoneActivityDefinition> addTitleWidgesToList(List <CellPhoneActivityDefinition> widgetDatas)
        {
            List <CellPhoneActivityDefinition> list = new List <CellPhoneActivityDefinition>();

            for (int i = 0; i < widgetDatas.Count; i++)
            {
                if (widgetDatas[i] as CellPhoneFeatureActivityDefinition != null)
                {
                    if (i == 0 || widgetDatas[i - 1] as CellPhoneFeatureActivityDefinition == null)
                    {
                        CellPhoneActivityDefinition cellPhoneActivityDefinition = ScriptableObject.CreateInstance <CellPhoneActivityDefinition>();
                        cellPhoneActivityDefinition.WidgetPrefabKey = definition.FeatureTitleWidgetKey;
                        list.Add(cellPhoneActivityDefinition);
                    }
                }
                else if (widgetDatas[i] as CellPhoneEventActivityDefinition != null && (i == 0 || widgetDatas[i - 1] as CellPhoneEventActivityDefinition == null))
                {
                    CellPhoneActivityDefinition cellPhoneActivityDefinition = ScriptableObject.CreateInstance <CellPhoneActivityDefinition>();
                    cellPhoneActivityDefinition.WidgetPrefabKey = definition.EventTitleWidgetKey;
                    list.Add(cellPhoneActivityDefinition);
                }
                list.Add(widgetDatas[i]);
            }
            return(list);
        }
 public void SetWidgetData(CellPhoneActivityDefinition widgetData)
 {
     this.widgetData = widgetData;
     isMemberLocked  = widgetData.IsMemberOnly && !getIsLocalPlayerMember();
     showMemberStatus();
     setWidgetData(widgetData);
 }
        private IEnumerator loadWidget(CellPhoneActivityDefinition widgetData, Dictionary <CellPhoneActivityDefinition, GameObject> widgetDataToPrefab)
        {
            AssetRequest <GameObject> request = Content.LoadAsync(widgetData.WidgetPrefabKey);

            yield return(request);

            widgetDataToPrefab.Add(widgetData, request.Asset);
        }
Beispiel #4
0
 private void addDailyChallengeWidget(Dictionary <CellPhoneActivityDefinition, int> widgetToPriority)
 {
     if (definition.DailiesPriority != ActivityScreenPriorities.Hidden)
     {
         CellPhoneActivityDefinition cellPhoneActivityDefinition = ScriptableObject.CreateInstance <CellPhoneActivityDefinition>();
         cellPhoneActivityDefinition.WidgetPrefabKey = definition.DailyChallengeWidgetKey;
         widgetToPriority.Add(cellPhoneActivityDefinition, (int)definition.DailiesPriority);
     }
 }
Beispiel #5
0
 private void addStartingSoonWidget(DateTime date, Dictionary <CellPhoneActivityDefinition, int> widgetToPriority)
 {
     if (definition.ActivityPriority != ActivityScreenPriorities.Hidden)
     {
         CellPhoneActivityDefinition cellPhoneActivityDefinition = ScriptableObject.CreateInstance <CellPhoneActivityDefinition>();
         cellPhoneActivityDefinition.WidgetPrefabKey = definition.RecurringActivityWidgetKey;
         widgetToPriority.Add(cellPhoneActivityDefinition, (int)definition.ActivityPriority);
     }
 }
        protected override void setWidgetData(CellPhoneActivityDefinition widgetData)
        {
            CellPhoneLocationActivityDefinition cellPhoneLocationActivityDefinition = widgetData as CellPhoneLocationActivityDefinition;

            if (cellPhoneLocationActivityDefinition != null)
            {
                this.widgetData = cellPhoneLocationActivityDefinition;
            }
        }
Beispiel #7
0
 private void addDailySpinWidget(Dictionary <CellPhoneActivityDefinition, int> widgetToPriority)
 {
     if (definition.DailySpinPriority != ActivityScreenPriorities.Hidden && Service.Get <GameStateController>().IsFTUEComplete)
     {
         CellPhoneActivityDefinition cellPhoneActivityDefinition = ScriptableObject.CreateInstance <CellPhoneActivityDefinition>();
         cellPhoneActivityDefinition.WidgetPrefabKey = definition.DailySpinWidgetKey;
         widgetToPriority.Add(cellPhoneActivityDefinition, (int)definition.DailySpinPriority);
     }
 }
        public void SetWidgetData(CellPhoneActivityDefinition widgetData)
        {
            CellPhoneQuestActivityDefinition cellPhoneQuestActivityDefinition = widgetData as CellPhoneQuestActivityDefinition;

            if (cellPhoneQuestActivityDefinition != null)
            {
                this.widgetData = cellPhoneQuestActivityDefinition;
                skinForQuest(this.widgetData.Quest);
            }
        }
        protected override void setWidgetData(CellPhoneActivityDefinition widgetData)
        {
            CellPhoneRecurringLocationActivityDefinition cellPhoneRecurringLocationActivityDefinition = widgetData as CellPhoneRecurringLocationActivityDefinition;

            if (cellPhoneRecurringLocationActivityDefinition != null)
            {
                this.widgetData = cellPhoneRecurringLocationActivityDefinition;
                resetStartTime(this.widgetData.ActivityStartScheduleCron);
                CoroutineRunner.Start(updateTimer(), this, "updateTimer");
            }
        }
        protected override void setWidgetData(CellPhoneActivityDefinition widgetData)
        {
            CellPhoneSaleActivityDefinition cellPhoneSaleActivityDefinition = widgetData as CellPhoneSaleActivityDefinition;

            if (cellPhoneSaleActivityDefinition != null)
            {
                saleData = cellPhoneSaleActivityDefinition;
                setEndTime(saleData);
                setSaleDiscount(saleData);
                CoroutineRunner.Start(updateTimer(), this, "updateTimer");
            }
        }
        public void SetWidgetData(CellPhoneActivityDefinition widgetData)
        {
            CellPhoneProgressionActivityDefinition cellPhoneProgressionActivityDefinition = widgetData as CellPhoneProgressionActivityDefinition;

            if (cellPhoneProgressionActivityDefinition != null)
            {
                this.widgetData = cellPhoneProgressionActivityDefinition;
                showLevelText();
                showTipText(this.widgetData.TipToken);
                loadIconPrefab();
                showMascotLevelProgress();
            }
        }
 public void SetWidgetData(CellPhoneActivityDefinition widgetData)
 {
 }
 protected abstract void setWidgetData(CellPhoneActivityDefinition setWidgetData);
Beispiel #14
0
 private bool hasWidgetBeenAccessed(CellPhoneActivityDefinition widgetData)
 {
     return(accessedWidgets != null && accessedWidgets.Widgets.Contains(widgetData.name));
 }
Beispiel #15
0
 private ActivityScreenPriorities getGlobalPriorityForItem(CellPhoneActivityDefinition item, ActivityScreenPriorities globalPriorityForType)
 {
     return((item.WidgetGlobalPriorityOverride == ActivityScreenPriorities.None) ? globalPriorityForType : item.WidgetGlobalPriorityOverride);
 }
 private bool checkNotificationIsAllowed(CellPhoneActivityDefinition definition)
 {
     return((!definition.IsMemberOnly || Service.Get <CPDataEntityCollection>().IsLocalPlayerMember()) && Service.Get <QuestService>().ActiveQuest == null && !Service.Get <UIElementDisablerManager>().IsUIElementDisabled("CellphoneButton") && base.gameObject.activeSelf && (!(definition is CellPhoneQuestActivityDefinition) || (definition is CellPhoneQuestActivityDefinition && ((CellPhoneQuestActivityDefinition)definition).Quest != null)));
 }
        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);
            }
        }