예제 #1
0
        /// <summary>
        /// 刷新抽奖礼包
        /// </summary>
        private void RefreshDrawUI(ChargeGiftData data)
        {
            IconSp.spriteName = data.icon;
            if (IconSp.keepAspectRatio != UIWidget.AspectRatioSource.Free)
            {
                IconSp.keepAspectRatio = UIWidget.AspectRatioSource.Free;
            }
            IconSp.MakePixelPerfect();
            IconSp.keepAspectRatio = UIWidget.AspectRatioSource.BasedOnWidth;
            IconSp.width           = 358;

            TitleLab.text     = data.title;
            GiftCountLab.text = string.Format("{0}/{1}", curGiftIndex + 1, giftDataList.Count);

            string colorStr = BalanceResourceUtil.GetUserDiamond() >= data.coinValue ? LT.Hotfix.Utility.ColorUtility.WhiteColorHexadecimal : LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;

            DiamondPriceLab.text = string.Format("[{0}]{1}[-]", colorStr, data.coinValue.ToString());

            DiscountLab.text = LTChargeManager.GetDiscountText(data.discount);
            DiscountLab.transform.parent.gameObject.CustomSetActive(data.discount > 0 && data.discount < 1);

            curItemDataList = data.rewardList;
            curCountDownEnd = data.countDownEnd;
            tempCountDown   = 1;
            RefreshShowItem();
            RefreshDrawCountDown();
        }
예제 #2
0
        private void RefreshUI()
        {
            IconSp.spriteName = curChargeData.icon;
            //免费礼包显示价格
            PriceValueLab.text = curChargeData.localizedCost;

            string colorStr = curChargeData.categoryValue == 2 ? LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal : LT.Hotfix.Utility.ColorUtility.YellowColorHexadecimal;

            TitleLab.text = string.Format("[{0}]{1}[-]", colorStr, curChargeData.longName);

            DiscountLab.text = LTChargeManager.GetDiscountText(curChargeData.discount);
            DiscountLab.transform.parent.gameObject.CustomSetActive(curChargeData.discount > 0 && curChargeData.discount < 1);

            if (curChargeData.limitNum > 0)
            {
                TimesLabel.text = curChargeData.limitNum.ToString();
                TimesLabel.gameObject.CustomSetActive(true);
            }
            else
            {
                TimesLabel.gameObject.CustomSetActive(false);
            }


            ShowTag();
            ShowMask();
        }
예제 #3
0
        /// <summary>
        /// 刷新商城礼包UI
        /// </summary>
        private void RefreshChargeUI()
        {
            InitChargeShowData();
            TitleLab.text      = curChargeData.longName;
            MoneyPriceLab.text = curChargeData.localizedCost;
            if (curItemDataList == null || curItemDataList.Count == 0)
            {
                DescLab.text  = string.Empty;
                DescLab2.text = curChargeData.localizedDesc;
            }
            else
            {
                DescLab2.text = string.Empty;
                DescLab.text  = curChargeData.localizedDesc;
            }
            IconSp.spriteName = curChargeData.icon;
            if (IconSp.keepAspectRatio != UIWidget.AspectRatioSource.Free)
            {
                IconSp.keepAspectRatio = UIWidget.AspectRatioSource.Free;
            }
            IconSp.MakePixelPerfect();
            IconSp.keepAspectRatio = UIWidget.AspectRatioSource.BasedOnWidth;
            IconSp.width           = 358;

            DiscountLab.text = LTChargeManager.GetDiscountText(curChargeData.discount);
            DiscountLab.transform.parent.gameObject.CustomSetActive(curChargeData.discount > 0 && curChargeData.discount < 1);
        }
예제 #4
0
        public void UpdateUI()
        {
            if (string.IsNullOrEmpty(Data.id))
            {
                mDMono.gameObject.CustomSetActive(false);
                return;
            }
            else
            {
                mDMono.gameObject.CustomSetActive(true);
            }

            //m_Have_Label.text = string.Format(HaveFormatStr,EB.Localizer.GetString("ID_LABEL_NAME_HADE"),Data.have);

            if (m_Discount_Label != null)
            {
                m_Discount_Label.text = LTChargeManager.GetDiscountText(Data.discount);
                m_Discount_Label.gameObject.CustomSetActive(Data.discount > 0 && Data.discount < 1);
            }

            int resBalance = BalanceResourceUtil.GetResValue(Data.cost_id);

            if (resBalance < Data.cost)
            {
                m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.RedColor;
            }
            else
            {
                m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.WhiteColor;
            }

            LTUIUtil.AddBlackOutLineToLabel(m_Cost_Label, Data.cost.ToString());
            m_Cost_Sprite.spriteName = BalanceResourceUtil.GetResSpriteName(Data.cost_id);

            if (m_UIResourceComponent != null)
            {
                m_UIResourceComponent.m_ResID = Data.cost_id;
            }

            m_Item.LTItemData = new LTShowItemData(Data.id, Data.num, Data.type, false);
            LTIconNameQuality itemInfo = LTItemInfoTool.GetInfo(m_Item.LTItemData.id, m_Item.LTItemData.type, m_Item.LTItemData.coloring);

            Data.item_name            = itemInfo.name;
            m_Item.Name.applyGradient = false;

            if (Data.sell_out)
            {
                m_Cost_Label.gameObject.CustomSetActive(false);
                m_Cost_Sprite.gameObject.CustomSetActive(false);
                m_SellOut_Sprite.gameObject.CustomSetActive(true);
                m_BuyBtn.enabled = false;
            }
            else
            {
                m_Cost_Label.gameObject.CustomSetActive(true);
                m_Cost_Sprite.gameObject.CustomSetActive(true);
                m_SellOut_Sprite.gameObject.CustomSetActive(false);
                m_BuyBtn.enabled = true;
            }
        }
예제 #5
0
        public override void Fill(LTChargeLimitTimeGiftData itemData)
        {
            if (itemData != null)
            {
                Data = itemData;
                EB.Sparx.Hub.Instance.WalletManager.GetGiftItem(Data.PaymentId, out curChargeData);

                IconSp.spriteName = curChargeData.icon;

                NameLab.text = curChargeData.longName;

                DiscountLab.text = LTChargeManager.GetDiscountTextEx(curChargeData.discount);
                DiscountLab.transform.parent.gameObject.CustomSetActive(curChargeData.discount > 0);

                PriceValueLab.text = curChargeData.localizedCost;

                ShowTag();

                InitChargeShowData();

                InitTimeLabel();

                mDMono.gameObject.CustomSetActive(true);
            }
            else
            {
                mDMono.gameObject.CustomSetActive(false);
            }
        }
예제 #6
0
        /// <summary>
        /// 刷新抽奖礼包
        /// </summary>
        private void RefreshDrawUI(ChargeGiftData data)
        {
            TitleLab.text = data.title;

            string colorStr = BalanceResourceUtil.GetUserDiamond() >= data.coinValue ? LT.Hotfix.Utility.ColorUtility.WhiteColorHexadecimal : LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;

            DiscountLab.text = LTChargeManager.GetDiscountText(data.discount);
            DiscountLab.transform.parent.gameObject.CustomSetActive(data.discount > 0 && data.discount < 1);

            curItemDataList = data.rewardList;
            RefreshShowItem();
        }
예제 #7
0
        private void InitUI(LTChargeLimitTimeGiftData itemData)
        {
            if (itemData != null)
            {
                Data = itemData;
                EB.Sparx.Hub.Instance.WalletManager.GetGiftItem(Data.PaymentId, out curChargeData);

                DiscountLab.text = LTChargeManager.GetDiscountTextEx(curChargeData.discount);
                DiscountLab.transform.parent.gameObject.CustomSetActive(curChargeData.discount > 0);

                PriceValueLab.text = curChargeData.localizedCost;

                DescriptLab.text = curChargeData.localizedDesc;

                InitChargeShowData();

                InitTimeLabel();

                controller.gameObject.CustomSetActive(true);
            }
        }
예제 #8
0
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);
            Data                  = param as StoreItemData;
            Item.LTItemData       = new LTShowItemData(Data.id, Data.num, Data.type, false);
            HaveLabel.text        = EB.Localizer.GetString("ID_codefont_in_LTStoreBuyController_544") + Data.have;
            m_Discount_Label.text = LTChargeManager.GetDiscountText(Data.discount);
            m_Discount_Label.gameObject.CustomSetActive(Data.discount > 0 && Data.discount < 1);

            m_Cost_Label.text = m_Cost_Label.transform.GetChild(0).GetComponent <UILabel>().text = Data.cost.ToString();
            int resBalance = BalanceResourceUtil.GetResValue(Data.cost_id);

            if (resBalance < Data.cost)
            {
                m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.RedColor;
            }
            else
            {
                m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.WhiteColor;
            }
            m_Cost_Sprite.spriteName = BalanceResourceUtil.GetResSpriteName(Data.cost_id);

            string desc = string.Empty;

            if (Data.store_type == "challenge")
            {
                Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(int.Parse(Data.id));
                desc = skillTpl.Description;
            }
            else
            {
                var item = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(Data.id);
                desc = item.Desc;
            }
            Info.text = desc;
        }