Exemplo n.º 1
0
        private void AddGoToStoreItem(List <UXElement> list)
        {
            int cRATE_INVENTORY_TO_STORE_LINK_SORT = GameConstants.CRATE_INVENTORY_TO_STORE_LINK_SORT;

            if (cRATE_INVENTORY_TO_STORE_LINK_SORT == 0 || !CrateUtils.HasVisibleCrateStoreItems())
            {
                return;
            }
            string      cRATE_INVENTORY_TO_STORE_LINK_CRATE_ASSET = GameConstants.CRATE_INVENTORY_TO_STORE_LINK_CRATE_ASSET;
            IGeometryVO vo          = Service.StaticDataController.Get <CrateVO>(cRATE_INVENTORY_TO_STORE_LINK_CRATE_ASSET);
            string      title       = this.lang.Get("CRATE_INVENTORY_TO_STORE_TITLE", new object[0]);
            string      description = this.lang.Get("CRATE_INVENTORY_TO_STORE_DESC", new object[0]);
            UXElement   item        = this.CreateInventoryGridItem("Id_Store", PrizeType.None, title, description, 0, vo, 0);

            if (cRATE_INVENTORY_TO_STORE_LINK_SORT == 1)
            {
                list.Insert(0, item);
            }
            else if (cRATE_INVENTORY_TO_STORE_LINK_SORT == 2)
            {
                list.Add(item);
            }
        }
Exemplo n.º 2
0
 private static bool IsValidForPlayer(LimitedEditionItemVO vo, CurrentPlayer player)
 {
     return(vo.Faction == player.Faction && CrateUtils.AllConditionsMet(vo.AudienceConditions));
 }
Exemplo n.º 3
0
        private void InitCTAUI()
        {
            this.crateInfoCTAButton         = base.GetElement <UXButton>("BtnCrateInfoCTA");
            this.crateInfoPayButton         = base.GetElement <UXButton>("BtnCrateInfoPay");
            this.crateInfoPayButton.Visible = false;
            this.crateInfoCTAButton.Visible = false;
            this.btnCurrencyLabel.Visible   = false;
            this.btnCurrencySprite.Visible  = false;
            bool     flag     = this.targetCrateVO.Purchasable && CrateUtils.IsVisibleInStore(this.targetCrateVO) && CrateUtils.IsPurchasableInStore(this.targetCrateVO);
            UXLabel  element  = base.GetElement <UXLabel>("LabelPurchase");
            UXSprite element2 = base.GetElement <UXSprite>("PurchaseCostCrystal");
            UXLabel  element3 = base.GetElement <UXLabel>("PurchaseCostLabel");
            UXLabel  element4 = base.GetElement <UXLabel>("LabelBtnPayCentered");

            if (this.ModalReason == CrateInfoReason.Reason_Targeted_Offer)
            {
                element.Visible  = false;
                element2.Visible = true;
                element3.Visible = true;
                element4.Visible = false;
                this.crateInfoPayButton.Visible = true;
                this.btnCurrencyLabel.Visible   = false;
                this.btnCurrencySprite.Visible  = false;
                if (this.CurrentOffer != null)
                {
                    this.crateInfoPayButton.OnClicked = new UXButtonClickedDelegate(this.OnTargetedOfferPurchaseClicked);
                    string[] cost = this.CurrentOffer.Cost;
                    if (cost != null && cost.Length != 0)
                    {
                        element.Visible = true;
                        element.Text    = this.lang.Get("CRATE_FLYOUT_STORE_OPEN_CTA", new object[0]);
                        UXUtils.SetupTargetedOfferCostUI(this.CurrentOffer, element3, element2);
                        return;
                    }
                    if (this.CurrentOffer.LinkedIAPs.Count <= 0)
                    {
                        Service.Get <StaRTSLogger>().Error("CrateModalInfoScreen::InitCTAUI No Cost on Offer: " + this.CurrentOffer.Uid);
                        return;
                    }
                    this.btnCurrencySprite.Visible = false;
                    this.currentIapId    = null;
                    this.currentRealCost = null;
                    if (!Service.Get <TargetedBundleController>().FindAvailableIAP(this.CurrentOffer, out this.currentIapId, out this.currentRealCost))
                    {
                        this.discountGroup.Visible      = false;
                        this.crateInfoPayButton.Visible = false;
                        this.btnCurrencyLabel.Visible   = false;
                        Service.Get <StaRTSLogger>().Error("CrateModalInfoScreen::InitCTAUI LinkedIAP invalid on Offer: " + this.CurrentOffer.Uid);
                        return;
                    }
                    element4.Text = this.lang.Get("TARGETED_BUNDLE_PURCHASE", new object[]
                    {
                        this.currentRealCost
                    });
                    element4.Visible = true;
                    element2.Visible = false;
                    element3.Visible = false;
                    return;
                }
            }
            else if (this.ModalReason == CrateInfoReason.Reason_Store_Buy && (flag || this.targetLEIVO != null))
            {
                this.crateInfoPayButton.Visible   = true;
                this.crateInfoPayButton.OnClicked = new UXButtonClickedDelegate(this.OnCrateInfoPayButtonClicked);
                element.Text     = this.lang.Get("CRATE_FLYOUT_STORE_OPEN_CTA", new object[0]);
                element4.Visible = false;
                int           num           = (this.targetLEIVO == null) ? this.targetCrateVO.Crystals : this.targetLEIVO.Crystals;
                CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>();
                if (currentPlayer.ArmoryInfo.FirstCratePurchased || this.targetLEIVO != null)
                {
                    element3.Text = this.lang.ThousandsSeparated(num);
                    UXUtils.UpdateCostColor(element3, null, 0, 0, 0, num, 0, false);
                    element2.Visible = true;
                    return;
                }
                element4.Text    = this.lang.Get("CRATE_FLYOUT_STORE_OPEN_CTA", new object[0]);
                element4.Visible = true;
                element.Visible  = false;
                element3.Visible = false;
                element2.Visible = false;
                return;
            }
            else if (this.ModalReason == CrateInfoReason.Reason_Inventory_Open && this.crateData != null)
            {
                this.crateInfoCTAButton.Visible   = true;
                this.crateInfoCTAButton.OnClicked = new UXButtonClickedDelegate(this.OnCrateInfoCTAButtonClicked);
                UXLabel element5 = base.GetElement <UXLabel>("LabelBtnCrateInfoCTA");
                element5.Text = this.lang.Get("CRATE_FLYOUT_OPEN_CTA", new object[0]);
            }
        }
Exemplo n.º 4
0
 protected virtual bool IsValidForPlayer(ILimitedEditionItemVO vo, CurrentPlayer player)
 {
     return(CrateUtils.AllConditionsMet(vo.AudienceConditions));
 }