Beispiel #1
0
    public void SetMallItem(ITEM_MALL_ITEM MallItem, int i32CharKind)
    {
        this.m_DrawTexture_Won.SetTexture(ItemMallItemManager.GetCashTextureName((eITEMMALL_MONEY_TYPE)MallItem.m_nMoneyType));
        this.m_Label_Price.Text        = ItemMallItemManager.GetCashPrice(MallItem);
        this.m_Button_Price.Data       = MallItem;
        this.m_Label_Price.Visible     = true;
        this.m_Button_Price.Visible    = true;
        this.m_DrawTexture_Won.Visible = true;
        byte             b     = 6;
        int              level = 50;
        List <SOL_GUIDE> value = NrTSingleton <NrTableSolGuideManager> .Instance.GetValue();

        foreach (SOL_GUIDE current in value)
        {
            if (current.m_i32CharKind == i32CharKind)
            {
                b = (byte)current.m_iSolGrade;
            }
        }
        NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(i32CharKind);

        if (i32CharKind != 0)
        {
            level = (int)charKindInfo.GetGradeMaxLevel((short)(b - 1));
        }
        this.SetSolKind(i32CharKind, b, level);
        this.m_eParentUI = G_ID.ITEMMALL_DLG;
    }
    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;
        }
    }