Пример #1
0
        private bool onFriendsServiceInitialized(FriendsServiceEvents.FriendsServiceInitialized evt)
        {
            notificationBreadcrumbController.ResetBreadcrumbs(friendAddedBreadcrumb);
            notificationBreadcrumbController.ResetBreadcrumbs(friendRequestBreadcrumb);
            int count = FriendsDataModelService.IncomingInvitationsList.Count;

            if (count > 0)
            {
                notificationBreadcrumbController.AddBreadcrumb(friendRequestBreadcrumb, count);
            }
            dataEntityCollection.EventDispatcher.AddListener <DataEntityEvents.ComponentAddedEvent <FriendData> >(onFriendComponentAdded);
            dataEntityCollection.EventDispatcher.AddListener <DataEntityEvents.ComponentAddedEvent <IncomingFriendInvitationData> >(onIncomingFriendInvitationComponentAdded);
            return(false);
        }
        private bool onPurchaseComplete(IglooServiceEvents.DecorationUpdated evt)
        {
            Service.Get <EventDispatcher>().RemoveListener <IglooServiceEvents.DecorationUpdated>(onPurchaseComplete);
            setState(ConfirmationState.Complete);
            hidePurchaseModal();
            PersistentBreadcrumbTypeDefinitionKey type          = null;
            StaticBreadcrumbDefinitionKey         breadcrumbKey = null;
            string id = "";

            if (evt.DecorationId.type == DecorationType.Decoration)
            {
                type          = decorationTypeBreadcrumb;
                id            = evt.DecorationId.definitionId.ToString();
                breadcrumbKey = decorationBreadcrumb;
            }
            else if (evt.DecorationId.type == DecorationType.Structure)
            {
                type          = structureTypeBreadcrumb;
                id            = evt.DecorationId.definitionId.ToString();
                breadcrumbKey = structureBreadcrumb;
            }
            if (notificationBreadcrumbController.GetPersistentBreadcrumbCount(type, id) == 0)
            {
                notificationBreadcrumbController.AddPersistentBreadcrumb(type, id);
            }
            notificationBreadcrumbController.AddBreadcrumb(breadcrumbKey);
            return(false);
        }
Пример #3
0
        private void onTimerTick()
        {
            DateTime     dateTime = Service.Get <INetworkServicesManager>().GameTimeMilliseconds.MsToDateTime();
            List <Quest> list     = new List <Quest>();
            NotificationBreadcrumbController notificationBreadcrumbController = Service.Get <NotificationBreadcrumbController>();

            for (int i = 0; i < timeLockedQuests.Count; i++)
            {
                Quest    quest     = timeLockedQuests[i];
                DateTime dateTime2 = quest.UnlockedTimeMilliseconds.MsToDateTime();
                long     num       = (long)(dateTime2 - dateTime).TotalMilliseconds;
                if (num > 0)
                {
                    continue;
                }
                quest.UpdateLockedState();
                if (quest.State == Quest.QuestState.Available)
                {
                    list.Add(quest);
                    notificationBreadcrumbController.AddPersistentBreadcrumb(breadcrumbType, quest.Definition.name);
                    string breadcrumbId = $"{quest.Definition.Mascot.AbbreviatedName}{quest.Definition.ChapterNumber}";
                    if (Service.Get <NotificationBreadcrumbController>().GetBreadcrumbCount(breadcrumbId) == 0)
                    {
                        Service.Get <NotificationBreadcrumbController>().AddBreadcrumb(breadcrumbId);
                    }
                }
            }
            for (int i = 0; i < list.Count; i++)
            {
                string breadcrumbId2 = $"{list[i].Mascot.AbbreviatedName}Quest";
                if (notificationBreadcrumbController.GetBreadcrumbCount(breadcrumbId2) == 0)
                {
                    notificationBreadcrumbController.AddBreadcrumb(breadcrumbId2);
                }
                timeLockedQuests.Remove(list[i]);
            }
        }
Пример #4
0
    private void addBreadcrumbsForReward(Reward reward)
    {
        addBreadCrumbsForReward <PropDefinition, DurableReward, int>(reward, breadcrumbIdentifiers.GearType, breadcrumbIdentifiers.Gear);
        addBreadCrumbsForReward <TemplateDefinition, EquipmentTemplateReward, int>(reward, breadcrumbIdentifiers.TemplateType, breadcrumbIdentifiers.Template);
        addBreadCrumbsForReward <FabricDefinition, FabricReward, int>(reward, breadcrumbIdentifiers.FabricType, breadcrumbIdentifiers.Fabric);
        addBreadCrumbsForReward <DecalDefinition, DecalReward, int>(reward, breadcrumbIdentifiers.DecalType, breadcrumbIdentifiers.Decal);
        addBreadCrumbsForReward <TubeDefinition, TubeReward, int>(reward, breadcrumbIdentifiers.TubeType, breadcrumbIdentifiers.Tube);
        addBreadCrumbsForReward <DecorationDefinition, DecorationReward, int>(reward, breadcrumbIdentifiers.DecorationType, breadcrumbIdentifiers.Decoration);
        addBreadCrumbsForReward <StructureDefinition, StructureReward, int>(reward, breadcrumbIdentifiers.StructureType, breadcrumbIdentifiers.Structure);
        addBreadCrumbsForReward <MusicTrackDefinition, MusicTrackReward, int>(reward, breadcrumbIdentifiers.MusicTrackType, breadcrumbIdentifiers.MusicTrack);
        addBreadCrumbsForReward <LightingDefinition, LightingReward, int>(reward, breadcrumbIdentifiers.LightingType, breadcrumbIdentifiers.Lighting);
        if (reward.TryGetValue(out EquipmentInstanceReward rewardable) && !rewardable.IsEmpty())
        {
            bool flag = false;
            for (int i = 0; i < rewardable.EquipmentInstances.Count; i++)
            {
                if (dataEntityCollection.IsLocalPlayerMember() || !RewardUtils.IsMemberLockableItemMemberOnly <TemplateDefinition, int>(rewardable.EquipmentInstances[i].definitionId))
                {
                    NotificationBreadcrumbController      obj           = notificationBreadcrumbController;
                    PersistentBreadcrumbTypeDefinitionKey inventoryType = breadcrumbIdentifiers.InventoryType;
                    long equipmentId = rewardable.EquipmentInstances[i].equipmentId;
                    obj.AddPersistentBreadcrumb(inventoryType, equipmentId.ToString());
                    flag = true;
                }
            }
            if (flag)
            {
                notificationBreadcrumbController.AddBreadcrumb(breadcrumbIdentifiers.Inventory);
            }
        }
        if (!reward.TryGetValue(out ConsumableInstanceReward rewardable2) || rewardable2.IsEmpty())
        {
            return;
        }
        Dictionary <string, int> .Enumerator enumerator = rewardable2.Consumables.GetEnumerator();
        bool flag2 = false;
        bool flag3 = false;

        while (enumerator.MoveNext())
        {
            if (dataEntityCollection.IsLocalPlayerMember() || !RewardUtils.IsMemberLockableItemMemberOnly <PropDefinition, int>(RewardUtils.GetConsumableIdByServerName(enumerator.Current.Key)))
            {
                PersistentBreadcrumbTypeDefinitionKey type;
                if (RewardUtils.IsConsumablePartyGame(enumerator.Current.Key))
                {
                    type  = breadcrumbIdentifiers.PartyGameType;
                    flag3 = true;
                }
                else
                {
                    type  = breadcrumbIdentifiers.ConsumableType;
                    flag2 = true;
                }
                notificationBreadcrumbController.AddPersistentBreadcrumb(type, RewardUtils.GetConsumableIdByServerName(enumerator.Current.Key).ToString());
            }
        }
        if (flag2)
        {
            notificationBreadcrumbController.AddBreadcrumb(breadcrumbIdentifiers.Consumable);
        }
        if (flag3)
        {
            notificationBreadcrumbController.AddBreadcrumb(breadcrumbIdentifiers.PartyGame);
        }
    }