private void onStatusChanged(PlayerStatusData playerStatusData, string questMascotName)
        {
            DataEntityHandle entityByComponent = dataEntityCollection.GetEntityByComponent(playerStatusData);

            if (dataEntityCollection.TryGetComponent <SessionIdData>(entityByComponent, out var sessionId))
            {
                if (mascotNameToIconMap.TryGetValue(questMascotName, out var value))
                {
                    setStatusIcon(sessionId.SessionId, value);
                    return;
                }
                SpriteContentKey questStatusIconContentKey = getQuestStatusIconContentKey(questMascotName);
                if (questStatusIconContentKey != null && !string.IsNullOrEmpty(questStatusIconContentKey.Key))
                {
                    Content.LoadAsync(delegate(string path, Sprite mascotIcon)
                    {
                        onMascotIconLoaded(questMascotName, mascotIcon, sessionId.SessionId);
                    }, questStatusIconContentKey);
                }
                else
                {
                    Log.LogError(this, "Mascot icon content key was null or empty");
                }
            }
            else
            {
                Log.LogError(this, "Could not find a session id for this player status data");
            }
        }
예제 #2
0
        private void parseRewardDefinition(T[] unlocks, bool isMember, SpriteContentKey mascotIconContentKey, RewardThemeDefinition themeDefinition)
        {
            T[] array = filterDefinitions(unlocks);
            if (array == null || array.Length <= 0)
            {
                return;
            }
            bool flag  = false;
            bool flag2 = false;

            for (int i = 0; i < array.Length; i++)
            {
                if (!progressionService.IsUnlocked(array[i], UnlockCategory))
                {
                    flag = true;
                }
                if (!isMember && array[i].IsMemberOnly)
                {
                    flag2 = true;
                    break;
                }
            }
            ItemGroup.LockedState lockedState = (flag2 ? ItemGroup.LockedState.MemberLocked : (flag ? ItemGroup.LockedState.MascotLocked : ItemGroup.LockedState.Unlocked));
            addItems(array, lockedState, -1, mascotIconContentKey, themeDefinition);
            removeUnlocksFromRewardSet(array);
        }
예제 #3
0
 private void showIconErrorPrompt(ErrorData errorData, SpriteContentKey iconContentKey)
 {
     errorData.PromptPrefab = promptManager.ErrorPrefab;
     errorData.Buttons      = DPrompt.ButtonFlags.OK;
     showingError           = true;
     showIconPrompt(errorData, iconContentKey);
 }
예제 #4
0
 private void setUpItemGroup(ItemGroup itemGroup, int level, SpriteContentKey mascotIconContentKey = null, RewardThemeDefinition themeDefinition = null)
 {
     if (level > -1)
     {
         itemGroup.Level = level;
     }
     if (mascotIconContentKey != null)
     {
         if (!string.IsNullOrEmpty(mascotIconContentKey.Key))
         {
             itemGroup.MascotIconContentKey = mascotIconContentKey;
         }
         else
         {
             Log.LogError(this, "Mascot icon content key was null");
         }
     }
     if (themeDefinition != null)
     {
         if (!string.IsNullOrEmpty(themeDefinition.ShortThemeToken))
         {
             itemGroup.LocalizedThemeName = localizer.GetTokenTranslation(themeDefinition.ShortThemeToken);
         }
         else if (!string.IsNullOrEmpty(themeDefinition.LongThemeToken))
         {
             itemGroup.LocalizedThemeName = localizer.GetTokenTranslation(themeDefinition.LongThemeToken);
         }
         if (themeDefinition.ThemeIconContentKey != null && !string.IsNullOrEmpty(themeDefinition.ThemeIconContentKey.Key))
         {
             itemGroup.ThemeIconContentKey = themeDefinition.ThemeIconContentKey;
         }
     }
 }
예제 #5
0
    private IEnumerator renderSprite(SpriteContentKey unlockID)
    {
        AssetRequest <Sprite> assetRequest = Content.LoadAsync(unlockID);

        yield return(assetRequest);

        callback(assetRequest.Asset, null);
    }
예제 #6
0
        private IEnumerator loadImage(SpriteContentKey assetContentKey)
        {
            AssetRequest <Sprite> assetRequest = Content.LoadAsync(assetContentKey);

            yield return(assetRequest);

            ItemImage.sprite = assetRequest.Asset;
        }
예제 #7
0
        private IEnumerator loadImageSprite(SpriteContentKey imageContentPath, Image image)
        {
            AssetRequest <Sprite> request = Content.LoadAsync(imageContentPath);

            yield return(request);

            image.sprite = request.Asset;
        }
    private IEnumerator loadImage(SpriteContentKey imageContentKey, Image image)
    {
        AssetRequest <Sprite> assetRequest = Content.LoadAsync(imageContentKey);

        yield return(assetRequest);

        image.sprite = assetRequest.Asset;
    }
예제 #9
0
        private IEnumerator loadItemImage(SpriteContentKey contentKey)
        {
            AssetRequest <Sprite> assetRequest = Content.LoadAsync(contentKey);

            yield return(assetRequest);

            ItemImage.sprite = assetRequest.Asset;
            ItemImage.gameObject.SetActive(value: true);
        }
예제 #10
0
 public DImagePopup()
 {
     ImageContentKey = null;
     ImageOffset     = default(Vector2);
     ImageScale      = Vector2.one;
     Text            = "";
     TextStyle       = new DTextStyle();
     TextAlignment   = TextAnchor.MiddleCenter;
     TextOffset      = default(Vector2);
 }
예제 #11
0
 public ItemGroup(T[] items, LockedState lockedState)
 {
     State = lockedState;
     Items = items;
     Level = -1;
     MascotIconContentKey = null;
     LocalizedThemeName   = null;
     ThemeIconContentKey  = null;
     BGImage       = BGImage.Default;
     GroupPosition = GroupPosition.None;
 }
 public void GoToMascotLockState(SpriteContentKey mascotIconContentKey)
 {
     isLocked = true;
     MemberLock.SetActive(value: false);
     LevelLock.SetActive(value: false);
     MascotLock.SetActive(value: true);
     MascotIcon.enabled = false;
     UnlockedBG.SetActive(value: false);
     setCustomLockVisibility(visibility: false);
     SetThemeIconActive(state: false);
     Content.LoadAsync(onMascotIconLoaded, mascotIconContentKey);
 }
예제 #13
0
    private IEnumerator loadImage(SpriteContentKey imageContentKey)
    {
        AssetRequest <Sprite> assetRequest = Content.LoadAsync(imageContentKey);

        yield return(assetRequest);

        Image.sprite = assetRequest.Asset;
        if (OpenDelay == 0f || openDelayComplete)
        {
            OpenPopup();
        }
    }
예제 #14
0
        private IEnumerator loadMascotIcon(SpriteContentKey iconKey, string mascotName)
        {
            UILoadingController.RegisterLoad(base.gameObject);
            AssetRequest <Sprite> assetRequest = Content.LoadAsync(iconKey, mascotName);

            yield return(assetRequest);

            if (assetRequest.Asset == null)
            {
                Log.LogError(this, "Missing mascot icon at " + iconKey);
            }
            MascotIconImage.sprite = assetRequest.Asset;
            UILoadingController.RegisterLoadComplete(base.gameObject);
        }
        private IEnumerator renderDurable(int unlockID)
        {
            Dictionary <int, PropDefinition> decals = Service.Get <GameData>().Get <Dictionary <int, PropDefinition> >();
            SpriteContentKey iconContentKey         = new SpriteContentKey(RewardPopupConstants.DefaultIconContentKey.Key);

            if (decals.TryGetValue(unlockID, out var definition))
            {
                iconContentKey = definition.GetIconContentKey();
            }
            AssetRequest <Sprite> assetRequest = Content.LoadAsync(iconContentKey);

            yield return(assetRequest);

            callback(assetRequest.Asset, null);
        }
 public void SetThemeState(string localizedThemeName, SpriteContentKey packIconContentKey = null)
 {
     if (packIconContentKey == null)
     {
         SetThemeWithoutIconActive(state: true);
         SetThemeIconActive(state: false);
         if (ThemeNameWithoutIcon != null)
         {
             ThemeNameWithoutIcon.text = "";
             if (!string.IsNullOrEmpty(localizedThemeName))
             {
                 ThemeNameWithoutIcon.text = localizedThemeName;
             }
             if (isLocked)
             {
                 ThemeNameWithoutIcon.color = LOCKED_THEME_NAME_TEXT_COLOR;
             }
             else
             {
                 ThemeNameWithoutIcon.color = UNLOCKED_THEME_NAME_TEXT_COLOR;
             }
         }
         return;
     }
     SetThemeIconActive(state: true);
     SetThemeWithoutIconActive(state: false);
     if (ThemeNameWithIcon != null)
     {
         ThemeNameWithIcon.text = "";
         if (!string.IsNullOrEmpty(localizedThemeName))
         {
             ThemeNameWithIcon.text = localizedThemeName;
         }
         if (isLocked)
         {
             ThemeNameWithIcon.color = LOCKED_THEME_NAME_TEXT_COLOR;
         }
         else
         {
             ThemeNameWithIcon.color = UNLOCKED_THEME_NAME_TEXT_COLOR;
         }
     }
     if (ThemeIcon != null)
     {
         Content.LoadAsync(onThemeIconLoaded, packIconContentKey);
     }
 }
예제 #17
0
    private IEnumerator renderPartySupply(PropDefinition propDefinition)
    {
        SpriteContentKey      iconContentKey = propDefinition.IconContentKey;
        AssetRequest <Sprite> iconRequest    = Content.LoadAsync(iconContentKey);

        yield return(iconRequest);

        AssetRequest <GameObject> prefabRequest = Content.LoadAsync(prefabContentKey);

        yield return(prefabRequest);

        GameObject prefab     = prefabRequest.Asset;
        GameObject itemPrefab = Object.Instantiate(prefab);

        itemPrefab.GetComponent <RewardPopupLabelComponent>().Init(iconRequest.Asset, propDefinition.Cost.ToString());
        callback(null, itemPrefab.GetComponent <RectTransform>(), propDefinition.Name);
    }
예제 #18
0
    private void showIconPrompt(ErrorData errorData, SpriteContentKey iconContentKey)
    {
        DPrompt data = new DPrompt(errorData.TitleToken, errorData.MessageToken, errorData.Buttons, iconSprites[iconContentKey.Key]);

        promptManager.ShowPrompt(data, errorData.Callback ?? new Action <DPrompt.ButtonFlags>(clearShowingError), errorData.PromptPrefab);
    }
예제 #19
0
 private void addItems(T[] items, ItemGroup.LockedState lockedState, int level, SpriteContentKey mascotIconContentKey = null, RewardThemeDefinition themeDefinition = null)
 {
     if (!GroupAllUnlockedItems || lockedState != 0)
     {
         createItemGroup(items, lockedState, level, mascotIconContentKey, themeDefinition);
     }
     else
     {
         unlockedItemsList.AddRange(items);
     }
 }
예제 #20
0
 private void LoadIcon(SpriteContentKey contentKey)
 {
     Content.LoadAsync(onSpriteLoaded, contentKey);
 }
예제 #21
0
        protected void createItemGroup(T[] items, ItemGroup.LockedState lockedState, int level, SpriteContentKey mascotIconContentKey, RewardThemeDefinition themeDefinition, bool displayBeforeUnlocks = false)
        {
            if (spacingRulesMap.ContainsKey(items.Length))
            {
                items = spacingRulesMap[items.Length].CreateSpacing(items);
            }
            ItemGroup itemGroup = new ItemGroup(items, lockedState);

            setUpItemGroup(itemGroup, level, mascotIconContentKey, themeDefinition);
            if (lockedState != 0)
            {
                if (displayBeforeUnlocks)
                {
                    lastUnlockedIndex++;
                    itemGroups.Insert(0, itemGroup);
                }
                else
                {
                    itemGroups.Add(itemGroup);
                }
            }
            else
            {
                lastUnlockedIndex++;
                itemGroups.Insert(lastUnlockedIndex, itemGroup);
            }
        }