コード例 #1
0
    private void Buy2Normal()
    {
        if (this.ItemFlagOn)
        {
            UIManagerControl.Instance.ShowToastText("购买数量已用完");
            return;
        }
        SShangPinKu sShangPinKu = DataReader <SShangPinKu> .Get(this.iId);

        if (sShangPinKu == null)
        {
            return;
        }
        UIManagerControl.Instance.OpenUI("BuyUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush);
        BuyUIViewModel.Instance.BuyNumberAdjustOn = true;
        BuyUIViewModel.Instance.BuyCallback       = delegate(int count)
        {
            this.DoOK(count);
        };
        BuyUIViewModel.Instance.RefreshInfo(this.iId, sShangPinKu, BaseMarketManager.CurrentManagerInstance.GetCommodityPrice(this.iId, 1), BaseMarketManager.CurrentManagerInstance.GetCommodityMoneyType(this.iId), XMarketManager.Instance.GetMaxBuyCount(this.iId));
    }
コード例 #2
0
    public void RefreshInfo(int iId, SShangPinKu dataSSPK, int group_price, int money_type, int buyMaxCount)
    {
        if (dataSSPK == null)
        {
            return;
        }
        StoreGoodsInfo commodityInfo = XMarketManager.Instance.GetCommodityInfo(dataSSPK.Id);

        if (commodityInfo == null)
        {
            return;
        }
        this.ResetBuyRequire();
        if (commodityInfo.extraInfo.vipLvLmt > 0)
        {
            this.is_vip_privilege_on = VIPManager.Instance.IsVIPPrivilegeOn();
            this.is_vip_level_on     = (EntityWorld.Instance.EntSelf.VipLv >= commodityInfo.extraInfo.vipLvLmt);
        }
        if (!this.is_vip_privilege_on)
        {
            this.BtnOKName = string.Format("激活VIP{0}", commodityInfo.extraInfo.vipLvLmt);
        }
        else if (!this.is_vip_level_on)
        {
            this.BtnOKName = string.Format("VIP{0}可购买", commodityInfo.extraInfo.vipLvLmt);
        }
        else
        {
            this.BtnOKName = GameDataUtils.GetChineseContent(508013, false);
        }
        this.m_iId       = iId;
        this.BuyMaxCount = buyMaxCount;
        int   itemId   = dataSSPK.itemId;
        int   itemNum  = 1;
        Items dataItem = DataReader <Items> .Get(itemId);

        this.SetItem(dataItem, itemNum, money_type, group_price);
    }