private void onPooledObjectAdded(RectTransform item, int index)
        {
            if (index >= filteredDefinitions.Count)
            {
                return;
            }
            StaticGameDataDefinition staticGameDataDefinition = filteredDefinitions[index];
            IglooCatalogItem         component            = item.GetComponent <IglooCatalogItem>();
            IglooCatalogItemData     iglooCatalogItemData = null;

            if (staticGameDataDefinition.GetType() == typeof(DecorationDefinition))
            {
                DecorationDefinition decorationDefinition = (DecorationDefinition)staticGameDataDefinition;
                if (!decorationProgressionStatus.TryGetValue(decorationDefinition.Id, out var value))
                {
                    value = new ProgressionUtils.ParsedProgression <DecorationDefinition>(decorationDefinition, -1, null, levelLocked: false, progressionLocked: false, decorationDefinition.IsMemberOnly);
                }
                iglooCatalogItemData = new IglooCatalogItemData(decorationDefinition, value);
                component.SetItem(iglooCatalogItemData, this);
                try
                {
                    Content.LoadAsync(component.SetImageFromTexture2D, decorationDefinition.Icon);
                }
                catch (Exception ex)
                {
                    Log.LogException(this, ex);
                }
            }
            else if (staticGameDataDefinition.GetType() == typeof(StructureDefinition))
            {
                StructureDefinition structureDefinition = (StructureDefinition)staticGameDataDefinition;
                if (!structureProgressionStatus.TryGetValue(structureDefinition.Id, out var value2))
                {
                    value2 = new ProgressionUtils.ParsedProgression <StructureDefinition>(structureDefinition, -1, null, levelLocked: false, progressionLocked: false, structureDefinition.IsMemberOnly);
                }
                iglooCatalogItemData = new IglooCatalogItemData(structureDefinition, value2);
                component.SetItem(iglooCatalogItemData, this);
                try
                {
                    Content.LoadAsync(component.SetImageFromTexture2D, structureDefinition.Icon);
                }
                catch (Exception ex)
                {
                    Log.LogException(this, ex);
                }
            }
            else
            {
                Log.LogErrorFormatted(this, "Definition was not a Decoration or a Structure!");
            }
        }
 public void SetItem(IglooCatalogItemData item, Sprite icon, IglooCatalogController catalog, IglooCatalogItem catalogItem, RectTransform scrollRectTransform)
 {
     this.catalog         = catalog;
     this.item            = item;
     this.catalogItem     = catalogItem;
     titleText.text       = Service.Get <Localizer>().GetTokenTranslation(item.TitleToken);
     descriptionText.text = Service.Get <Localizer>().GetTokenTranslation(item.DescriptionToken);
     StartCoroutine(waitForItemIcon());
     setState(ConfirmationState.Pending);
     setPurchaseCount(1);
     ConfirmationPlacement.PositionConfirmation((RectTransform)catalogItem.transform, scrollRectTransform);
     logItemViewed(item);
     if (notificationBreadcrumbController == null)
     {
         notificationBreadcrumbController = Service.Get <NotificationBreadcrumbController>();
     }
     Service.Get <EventDispatcher>().AddListener <IglooServiceEvents.DecorationPurchaseFailed>(onDecorationPurchaseFailed);
 }
        private IEnumerator loadConfirmation(PrefabContentKey prefabKey, IglooCatalogItemData item, Sprite icon, IglooCatalogItem catalogItem)
        {
            AssetRequest <GameObject> request = Content.LoadAsync(prefabKey);

            yield return(request);

            GameObject newConfirmation = UnityEngine.Object.Instantiate(request.Asset, base.transform, worldPositionStays: false);

            newConfirmation.GetComponent <IglooCatalogPurchaseConfirmation>().SetItem(item, icon, this, catalogItem, (RectTransform)catalogScrollRect.transform);
            hideConfirmation();
            confirmation = newConfirmation;
        }
 public void ShowConfirmation(IglooCatalogItemData item, Sprite icon, IglooCatalogItem catalogItem)
 {
     CoroutineRunner.Start(loadConfirmation(PurchaseConfirmationPrefabKey, item, icon, catalogItem), this, "");
 }