private void UpdateElements(Entity entity)
        {
            SpecialOfferContentLocalizationComponent component = entity.GetComponent <SpecialOfferContentLocalizationComponent>();

            this.title.text = component.Title;
            SpecialOfferScreenLocalizationComponent component2 = entity.GetComponent <SpecialOfferScreenLocalizationComponent>();

            this.hurryUp.text     = component2.Footer;
            this.description.text = component2.Description;
            GoodsPriceComponent component3 = entity.GetComponent <GoodsPriceComponent>();

            this.newPrice.text = component3.Price + " " + component3.Currency;
            LayoutRebuilder.ForceRebuildLayoutImmediate((RectTransform)this.newPrice.rectTransform.parent.parent);
            ItemsPackFromConfigComponent component4 = entity.GetComponent <ItemsPackFromConfigComponent>();
            CountableItemsPackComponent  component5 = entity.GetComponent <CountableItemsPackComponent>();
            XCrystalsPackComponent       component6 = entity.GetComponent <XCrystalsPackComponent>();
            CrystalsPackComponent        component7 = entity.GetComponent <CrystalsPackComponent>();
            List <long> itemIds = new List <long>(component4.Pack);

            itemIds.AddRange(component5.Pack.Keys);
            RequestInfoForItemsEvent evt = new RequestInfoForItemsEvent(itemIds);

            this.SendEvent <RequestInfoForItemsEvent>(evt, entity);
            this.AddMainItem(evt.mainItemTitle, (long)evt.mainItemCount, evt.mainItemSprite, false, ItemRarityType.COMMON);
            this.mainItemDescription.text = evt.mainItemDescription;
            foreach (long num in component5.Pack.Keys)
            {
                if (evt.mainItemId != num)
                {
                    string title     = evt.titles[num];
                    string spriteUid = evt.previews[num];
                    this.AddItem(title, (long)component5.Pack[num], this.previewContainer.transform, spriteUid, evt.rarityFrames[num], evt.rarities[num]);
                }
            }
            foreach (long num3 in component4.Pack)
            {
                if (evt.mainItemId != num3)
                {
                    string title     = evt.titles[num3];
                    string spriteUid = evt.previews[num3];
                    this.AddItem(title, 0L, this.previewContainer.transform, spriteUid, evt.rarityFrames[num3], evt.rarities[num3]);
                }
            }
            if ((component7.Total > 0L) && !evt.mainItemCrystal)
            {
                this.AddItem(evt.crystalTitle, component7.Total, this.previewContainer.transform, evt.crystalSprite, false, ItemRarityType.COMMON);
            }
            if (((component6.Amount + component6.Bonus) > 0L) && !evt.mainItemXCrystal)
            {
                this.AddItem(evt.xCrystalTitle, component6.Amount + component6.Bonus, this.previewContainer.transform, evt.xCrystalSprite, false, ItemRarityType.COMMON);
            }
        }
Ejemplo n.º 2
0
 public void CheckItem(RequestInfoForItemsEvent e, SingleNode <StarterPackMainElementComponent> starterPack, [JoinAll] SelfUserNode user, [JoinAll] CrystalMarketItemNode crystal, [JoinAll] XCrystalMarketItemNode xCrystal)
 {