示例#1
0
        private void addShopCellToList(ShopEntry shopEntry, ShopEntryInstance shopEntryInstance, RectTransform parentTm)
        {
            ShopPurchaseController controller = this.createShopPurchaseController(shopEntry, shopEntryInstance);
            string str = StringExtensions.ToUpperLoca(_.L(ConfigLoca.VENDOR_SOLD_OUT, null, false));

            Card.Content content2 = new Card.Content();
            content2.Obj          = controller;
            content2.Text         = StringExtensions.ToUpperLoca(controller.getTitle());
            content2.Sprite       = controller.getSprite();
            content2.Interactable = controller.isPurchaseable();
            content2.Grayscale    = !controller.isPurchaseable();
            content2.PriceText    = controller.getPriceText(1);
            content2.PriceIcon    = controller.getPriceIcon();
            content2.SoldText     = !controller.isSold() ? null : str;
            content2.StickerText  = controller.getStickerText();
            Card.Content content = content2;
            if (controller.payWithAd() && !Service.Binder.AdsSystem.initialized())
            {
                content.SoldText = str;
            }
            Card item = PlayerView.Binder.CardButtonPool.getObject();

            item.transform.SetParent(parentTm, false);
            item.initialize(content, new Action <Card>(this.onCardClicked));
            this.m_vendorCards.Add(item);
            item.gameObject.SetActive(true);
        }
        private void addRunestoneToGrid(Card.Content content, Transform parentTm)
        {
            Card item = PlayerView.Binder.CardRewardPool.getObject();

            item.transform.SetParent(parentTm, false);
            item.initialize(content, new Action <Card>(this.onCardClicked));
            this.m_rewardGalleryCards.Add(item);
            item.gameObject.SetActive(true);
        }
示例#3
0
        private void addAugmentationToGrid(Card.Content content)
        {
            Card item = PlayerView.Binder.CardButtonPool.getObject();

            item.transform.SetParent(this.AugmentationGridTm, false);
            item.initialize(content, new Action <Card>(this.onCardClicked));
            this.m_augCards.Add(item);
            item.gameObject.SetActive(true);
        }
        private void reconstructContent()
        {
            Player player = GameLogic.Binder.GameState.Player;

            base.m_contentMenu.refreshTitle("SKILL RUNES", string.Empty, string.Empty);
            this.cleanupCells();
            int       num      = 0;
            int       rowIdx   = 0;
            Transform parentTm = null;
            int       index    = 0;

            while (index < ConfigRunestones.RUNESTONES.Length)
            {
                if (num == 0)
                {
                    parentTm = this.addGridRowCellToVerticalGroup(rowIdx).GridRoot.transform;
                    this.addSkillTitleCellToGrid(rowIdx, parentTm);
                    rowIdx++;
                }
                else
                {
                    Card.Content content2;
                    ConfigRunestones.SharedData data = ConfigRunestones.RUNESTONES[index];
                    string       id      = data.Id;
                    Card.Content content = null;
                    if (player.Runestones.ownsRunestone(id))
                    {
                        content2              = new Card.Content();
                        content2.Id           = id;
                        content2.Sprite       = data.Sprite;
                        content2.Rarity       = data.Rarity;
                        content2.Interactable = true;
                        content = content2;
                    }
                    else
                    {
                        content2              = new Card.Content();
                        content2.Id           = id;
                        content2.Sprite       = data.Sprite;
                        content2.Rarity       = data.Rarity;
                        content2.Interactable = true;
                        content2.Grayscale    = true;
                        content = content2;
                    }
                    this.addRunestoneToGrid(content, parentTm);
                    index++;
                }
                num = (num + 1) % 4;
            }
        }