Beispiel #1
0
            public EventInfo(RemotePromotion remotePromotion)
            {
                this.DescriptionRows = new List <DescriptionRow>();
                EventParams parsedCustomParams = remotePromotion.ParsedCustomParams as EventParams;

                this.Title    = remotePromotion.ParsedLoca.PopupHeadline;
                this.Subtitle = remotePromotion.ParsedLoca.PopupTitle;
                this.Flavor   = remotePromotion.ParsedLoca.PopupDescription;
                this.DescriptionRows.Clear();
                if (!string.IsNullOrEmpty(remotePromotion.ParsedLoca.PopupBody))
                {
                    char[]   separator = new char[] { ';' };
                    string[] strArray  = remotePromotion.ParsedLoca.PopupBody.Split(separator);
                    for (int i = 0; i < strArray.Length; i++)
                    {
                        string str = strArray[i];
                        if (str != null)
                        {
                            str = str.Trim();
                            if (!string.IsNullOrEmpty(str))
                            {
                                SpriteAtlasEntry entry = (parsedCustomParams.DescriptionIcons.Count <= i) ? null : parsedCustomParams.DescriptionIcons[i];
                                DescriptionRow   item  = new DescriptionRow();
                                item.Icon = entry;
                                item.Text = str;
                                this.DescriptionRows.Add(item);
                            }
                        }
                    }
                }
            }
Beispiel #2
0
            public Event(RemotePromotion remotePromotion)
            {
                EventParams parsedCustomParams = remotePromotion.ParsedCustomParams as EventParams;

                this.Header   = parsedCustomParams.Header;
                this.Info     = new ConfigPromotionEvents.EventInfo(remotePromotion);
                this.Missions = new ConfigPromotionEvents.EventMissions(remotePromotion);
                this.IapPlacementPromotionId = parsedCustomParams.IapPlacementPromotionId;
                this.StartTimestamp          = (long)remotePromotion.timing.start;
                this.EndTimestamp            = (long)remotePromotion.timing.end;
                this.HideTimer = parsedCustomParams.HideTimer;
            }
Beispiel #3
0
        private void addPromotionCellToList(ShopEntry shopEntry, RemotePromotion promotion, RectTransform parentTm)
        {
            PromotionCard.Content content2 = new PromotionCard.Content();
            content2.Promotion     = promotion;
            content2.RemoteTexture = promotion.ParsedCustomParams.ShopBannerImage;
            PromotionCard.Content content = content2;
            PromotionCard         item    = PlayerView.Binder.PromotionCardAugmentationPool.getObject();

            item.transform.SetParent(parentTm, false);
            item.initialize(content, new Action <Card>(this.onCardClicked));
            this.m_promotionCards.Add(item);
            item.gameObject.SetActive(true);
        }
Beispiel #4
0
            public EventMissions(RemotePromotion remotePromotion)
            {
                this.Instances = new List <ConfigPromotionEvents.EventMissionInstance>();
                EventParams parsedCustomParams = remotePromotion.ParsedCustomParams as EventParams;

                this.BigPrizeDescription     = remotePromotion.ParsedLoca.PopupMissionsBigPrize;
                this.BigPrizeRewardChestType = parsedCustomParams.Missions.BigPrizeRewardChestType;
                this.BigPrizeSprite          = parsedCustomParams.Missions.BigPrizeSprite;
                this.Instances = parsedCustomParams.Missions.Instances;
                for (int i = 0; (i < this.Instances.Count) && (i < remotePromotion.ParsedLoca.PopupMissions.Count); i++)
                {
                    this.Instances[i].setInfo(remotePromotion.ParsedLoca.PopupMissions[i]);
                }
            }
Beispiel #5
0
        protected override void onRefresh()
        {
            base.m_contentMenu.refreshTitle(StringExtensions.ToUpperLoca(_.L(ConfigLoca.VENDOR_TITLE_SHOP, null, false)), string.Empty, string.Empty);
            Player player = GameLogic.Binder.GameState.Player;

            player.Notifiers.ShopInspected = true;
            this.RefreshValue.text         = MenuHelpers.SecondsToStringHoursMinutes(player.Vendor.getSecondsToNextVendorInventoryRefresh());
            for (int i = 0; i < this.m_augCards.Count; i++)
            {
                Card card = this.m_augCards[i];
                PlayerAugmentation augmentation = (PlayerAugmentation)card.ActiveContent.Obj;
                bool interactable = !player.Tournaments.hasTournamentSelected() && player.Augmentations.canBuy(augmentation.Id);
                this.m_augCards[i].refresh(card.ActiveContent.Text, card.ActiveContent.PriceText, card.ActiveContent.PriceIcon, interactable, !interactable);
            }
            for (int j = 0; j < this.m_vendorCards.Count; j++)
            {
                ShopPurchaseController controller = (ShopPurchaseController)this.m_vendorCards[j].ActiveContent.Obj;
                controller.updateDetails();
                this.m_vendorCards[j].refresh(StringExtensions.ToUpperLoca(controller.getTitle()), controller.getPriceText(1), controller.getPriceIcon(), controller.isPurchaseable(), !controller.isPurchaseable());
            }
            bool flag2 = false;

            foreach (string str in ShopManager.ValidPromoSlots)
            {
                RemotePromotion promotionForPromoSlot = Service.Binder.PromotionManager.GetPromotionForPromoSlot(str);
                if (((promotionForPromoSlot != null) && promotionForPromoSlot.ParsedLoca.ValidateShopBannerLoca()) && Service.Binder.PromotionManager.ShouldShowTimer(promotionForPromoSlot))
                {
                    flag2 = true;
                    this.PromoRunsOutValue.text = Service.Binder.PromotionManager.GetTimeLeftFormatted(promotionForPromoSlot);
                    break;
                }
            }
            this.PromoRunsOutTitle.gameObject.SetActive(flag2);
            this.PromoRunsOutValue.gameObject.SetActive(flag2);
            flag2 = false;
            foreach (string str2 in ShopManager.ValidSecondaryPromoSlots)
            {
                RemotePromotion promotion = Service.Binder.PromotionManager.GetPromotionForPromoSlot(str2);
                if (((promotion != null) && promotion.ParsedLoca.ValidateShopBannerLoca()) && Service.Binder.PromotionManager.ShouldShowTimer(promotion))
                {
                    flag2 = true;
                    this.SecondaryPromoRunsOutValue.text = Service.Binder.PromotionManager.GetTimeLeftFormatted(promotion);
                    break;
                }
            }
            this.SecondaryPromoRunsOutTitle.gameObject.SetActive(flag2);
            this.SecondaryPromoRunsOutValue.gameObject.SetActive(flag2);
        }
Beispiel #6
0
        private void addSecondaryPromotions()
        {
            bool flag = false;

            foreach (string str in ShopManager.ValidSecondaryPromoSlots)
            {
                RemotePromotion promotionForPromoSlot = Service.Binder.PromotionManager.GetPromotionForPromoSlot(str);
                if (((promotionForPromoSlot != null) && promotionForPromoSlot.IsValid()) && promotionForPromoSlot.ParsedLoca.ValidateShopBannerLoca())
                {
                    flag = true;
                    this.addPromotionCellToList(null, promotionForPromoSlot, this.SecondaryPromoGridTm);
                }
            }
            this.SecondaryPromoGridTm.gameObject.SetActive(flag);
            this.SecondaryPromoDividerRoot.gameObject.SetActive(flag);
        }
Beispiel #7
0
 public CmdBuyPromotion(Player player, RemotePromotion promotion)
 {
     this.m_player    = player;
     this.m_promotion = promotion;
 }