Esempio n. 1
0
    public override void Update()
    {
        int noticeCount = this.GetNoticeCount();

        if (0 < noticeCount)
        {
            if (this.count != noticeCount)
            {
                int num = noticeCount;
                this.menuNotice.Visible = true;
                this.menuNotice.Text    = num.ToString();
                this.count = num;
            }
        }
        else if (this.menuNotice.Visible)
        {
            this.menuNotice.Visible = false;
        }
        List <ITEM_MALL_ITEM> group = NrTSingleton <ItemMallItemManager> .Instance.GetGroup(50);

        if (group == null)
        {
            return;
        }
        bool flag = false;

        for (int i = 0; i < group.Count; i++)
        {
            ITEM_MALL_ITEM iTEM_MALL_ITEM = group[i];
            if (iTEM_MALL_ITEM != null)
            {
                ITEM_VOUCHER_DATA itemVoucherDataFromItemID = NrTSingleton <ItemMallItemManager> .Instance.GetItemVoucherDataFromItemID(iTEM_MALL_ITEM.m_Idx);

                if (itemVoucherDataFromItemID != null)
                {
                    eVOUCHER_TYPE ui8VoucherType    = (eVOUCHER_TYPE)itemVoucherDataFromItemID.ui8VoucherType;
                    long          voucherRemainTime = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetVoucherRemainTime(ui8VoucherType, itemVoucherDataFromItemID.i64ItemMallID);

                    if (voucherRemainTime > 0L && NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.IsUseVoucher(ui8VoucherType, itemVoucherDataFromItemID.i64ItemMallID))
                    {
                        flag = true;
                        break;
                    }
                }
            }
        }
        if (!flag)
        {
            NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
            long         charSubData = kMyCharInfo.GetCharSubData(eCHAR_SUBDATA.CHAR_SUBDATA_FREETICKET_PREMINUM_TIME);
            if (PublicMethod.GetCurTime() > charSubData)
            {
                flag = true;
            }
            charSubData = kMyCharInfo.GetCharSubData(eCHAR_SUBDATA.CHAR_SUBDATA_FREETICKET_HEARTS_TIME);
            if (PublicMethod.GetCurTime() > charSubData)
            {
                flag = true;
            }
        }
        if (flag && this.btShopMenu.Visible)
        {
            this.ShopNotice.Visible = true;
        }
        else
        {
            this.ShopNotice.Visible = false;
        }
    }
 public bool IsItemVoucherType(eVOUCHER_TYPE eVoucherType)
 {
     return(eVoucherType > eVOUCHER_TYPE.eVOUCHER_TYPE_NONE && eVoucherType < eVOUCHER_TYPE.eVOUCHER_TYPE_MAX);
 }
    public void SetItem(ITEM_MALL_ITEM Item)
    {
        this.m_Item = Item;
        this.m_lbProductName.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromItem(Item.m_strTextKey);

        this.m_lbDecription.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(Item.m_strItemTooltip);

        this.m_dtProductImg.SetFadeTextureFromBundle(Item.m_strIconPath);
        this.m_lbPrice.Text = ItemMallItemManager.GetCashPrice(Item);
        ITEM_VOUCHER_DATA itemVoucherDataFromItemID = NrTSingleton <ItemMallItemManager> .Instance.GetItemVoucherDataFromItemID(Item.m_Idx);

        if (itemVoucherDataFromItemID != null)
        {
            NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
            if (kMyCharInfo == null)
            {
                return;
            }
            eVOUCHER_TYPE ui8VoucherType = (eVOUCHER_TYPE)itemVoucherDataFromItemID.ui8VoucherType;
            if (ui8VoucherType == eVOUCHER_TYPE.eVOUCHER_TYPE_RECRUIT_HEARTS_HERO)
            {
                long charSubData = kMyCharInfo.GetCharSubData(eCHAR_SUBDATA.CHAR_SUBDATA_FREETICKET_HEARTS_TIME);
                if (PublicMethod.GetCurTime() > charSubData)
                {
                    this.m_lbPrice.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3344");
                }
            }
            else if (ui8VoucherType == eVOUCHER_TYPE.eVOUCHER_TYPE_RECRUIT_HERO)
            {
                long charSubData = kMyCharInfo.GetCharSubData(eCHAR_SUBDATA.CHAR_SUBDATA_FREETICKET_PREMINUM_TIME);
                if (PublicMethod.GetCurTime() > charSubData)
                {
                    this.m_lbPrice.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3344");
                }
            }
            else
            {
                long voucherRemainTime = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetVoucherRemainTime(ui8VoucherType, itemVoucherDataFromItemID.i64ItemMallID);

                if (voucherRemainTime > 0L)
                {
                    this.m_btPrice.controlIsEnabled = false;
                }
            }
        }
        this.m_btPrice.Data = Item;
        this.m_btPrice.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClicked));
        this.m_dt_won.SetTexture(ItemMallItemManager.GetCashTextureName((eITEMMALL_MONEY_TYPE)Item.m_nMoneyType));
        this.VisibleContent(false);
        if (NrTSingleton <ContentsLimitManager> .Instance.IsRateUrl() && (this.m_Item.m_nGroup == 50 || this.m_Item.m_nGroup == 51 || this.m_Item.m_nGroup == 5))
        {
            this.m_bRateOpenUrl.Visible = true;
        }
        char[] separator = new char[]
        {
            '+'
        };
        string[] array = Item.m_strSolKind.Split(separator);
        if (array == null)
        {
            return;
        }
        int num = 0;

        string[] array2 = array;
        for (int i = 0; i < array2.Length; i++)
        {
            string text  = array2[i];
            string text2 = text.Trim();
            if (!(text2 == string.Empty))
            {
                int charKindByCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindByCode(text2);

                if (charKindByCode != 0)
                {
                    NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(charKindByCode);

                    this.m_btSol[num].Visible  = true;
                    this.m_btSol2[num].Visible = true;
                    this.m_btSol[num].Data     = charKindByCode;
                    this.m_btSol[num].Text     = string.Format("{0} {1}", charKindInfo.GetName(), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("788"));
                    this.m_btSol2[num].Data    = charKindByCode;
                    num++;
                }
            }
        }
        if (TsPlatform.IsAndroid)
        {
            if (Item.m_nGift == 1)
            {
                this.m_lbGiftHelp.Visible = true;
            }
            else
            {
                this.m_lbGiftHelp.Visible = false;
            }
        }
        if (0 < Item.m_nSaleNum)
        {
            int num2 = Item.m_nSaleNum - NrTSingleton <ItemMallItemManager> .Instance.GetBuyCount(Item.m_Idx);

            string empty = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2611"),
                "Count",
                num2
            });

            this.m_lbSaleNum.SetText(empty);
            this.m_lbSaleNum.Visible = true;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2639"),
                "count",
                Item.m_nSaleNum
            });

            this.m_lbSaleNumHelp.SetText(empty);
            this.m_lbSaleNumHelp.Visible = true;
        }
        else
        {
            this.m_lbSaleNum.Visible     = false;
            this.m_lbSaleNumHelp.Visible = false;
            this.m_dtProductLine.Visible = false;
        }
    }