示例#1
0
 protected override void onPreShow([Optional, DefaultParameterValue(null)] object param)
 {
     this.m_params = (InputParams)param;
     RewardGalleryCell.Content rewardContent = RewardGalleryCell.CreateDefaultContentForReward(this.m_params.Reward, true, null);
     ((MiniPopupMenu)base.m_contentMenu).populateLayout(ConfigUi.MiniPopupEntries.SPECIAL_OFFER, true, rewardContent, null, null, null);
     this.onRefresh();
     PlayerView.Binder.EventBus.SpecialOfferAdOffered(this.m_params.Reward);
 }
 public void cleanUpForReuse()
 {
     for (int i = this.m_rewardGalleryCells.Count - 1; i >= 0; i--)
     {
         RewardGalleryCell item = this.m_rewardGalleryCells[i];
         this.m_rewardGalleryCells.Remove(item);
         PlayerView.Binder.RewardGalleryCellPool.returnObject(item, item.Type);
     }
 }
示例#3
0
        private void addRewardGalleryCellToGrid(RewardGalleryCell.Content content)
        {
            RewardGalleryCell item = PlayerView.Binder.RewardGalleryCellPool.getObject(content.Type);

            item.transform.SetParent(this.RewardTm, false);
            item.initialize(content, null);
            this.m_rewardGalleryCells.Add(item);
            item.gameObject.SetActive(true);
        }
        private void onItemCellClick(RewardGalleryCell cell)
        {
            Item item = (Item)cell.ActiveContent.Obj;

            TooltipMenu.InputParameters parameters2 = new TooltipMenu.InputParameters();
            parameters2.CenterOnTm        = cell.RectTm;
            parameters2.MenuContentParams = item.Name;
            TooltipMenu.InputParameters parameter = parameters2;
            PlayerView.Binder.MenuSystem.transitionToMenu(MenuType.TooltipMenu, MenuContentType.InfoTooltip, parameter, 0f, false, true);
        }
        private void addItemToGrid(Item item, int rarity, SpriteAtlasEntry sprite)
        {
            RewardGalleryCell.Content content2 = new RewardGalleryCell.Content();
            content2.Obj             = item;
            content2.Sprite          = sprite;
            content2.StarRank        = rarity;
            content2.DoUseSmallStars = true;
            RewardGalleryCell.Content content = content2;
            RewardGalleryCell         cell    = PlayerView.Binder.RewardGalleryCellPool.getObject(RewardGalleryCellType.RewardGalleryCellFazer);

            cell.transform.SetParent(this.ItemGrid, false);
            cell.initialize(content, new Action <RewardGalleryCell>(this.onItemCellClick));
            this.m_rewardGalleryCells.Add(cell);
            cell.gameObject.SetActive(true);
        }
        private void setupChest(GameLogic.ChestType chestType)
        {
            ChestBlueprint blueprint = ConfigUi.CHEST_BLUEPRINTS[chestType];

            RewardGalleryCell.Content content2 = new RewardGalleryCell.Content();
            content2.Sprite = blueprint.Icon;
            RewardGalleryCell.Content content = content2;
            RewardGalleryCell         item    = PlayerView.Binder.RewardGalleryCellPool.getObject(RewardGalleryCellType.RewardGalleryCellFazer);

            RectTransformExtensions.SetSize(item.RectTm, new Vector2(300f, 300f));
            item.transform.SetParent(this.ChestRoot, false);
            item.initialize(content, null);
            this.m_rewardGalleryCells.Add(item);
            item.gameObject.SetActive(true);
        }