示例#1
0
    private void SetShoppingUnit1(OOShoppingUnit gridData, CommodityInfo commodityInfo)
    {
        int itemId      = commodityInfo.itemId;
        int commodityId = commodityInfo.commodityId;

        gridData.iId = commodityId;
        if (commodityInfo.sell)
        {
            gridData.EnableBtnBuy   = false;
            gridData.ItemFlagIconBg = true;
            gridData.ItemFlagIcon   = ResourceManager.GetIconSprite("font_yishouwan");
        }
        else
        {
            gridData.EnableBtnBuy   = true;
            gridData.ItemFlagIconBg = false;
            gridData.ItemFlagIcon   = ResourceManagerBase.GetNullSprite();
        }
        int num = commodityInfo.unitPrice * commodityInfo.itemNum;

        if ((long)num > MoneyType.GetNum(commodityInfo.moneyType))
        {
            gridData.PriceNow = "x" + num;
        }
        else
        {
            gridData.PriceNow = "x" + num;
        }
        gridData.ItemFrame = GameDataUtils.GetItemFrame(itemId);
        gridData.ItemIcon  = GameDataUtils.GetItemIcon(itemId);
        gridData.ItemName  = GameDataUtils.GetEquipItemNameAndLV(itemId, false);
        gridData.ItemNum   = string.Empty + commodityInfo.itemNum;
        gridData.CoinIcon  = MoneyType.GetIcon(commodityInfo.moneyType);
        gridData.PriceOld  = string.Empty;
    }
示例#2
0
    private OOShoppingUnit2 GetShoppingUnit2(CommodityInfo commodityInfo)
    {
        int             itemId         = commodityInfo.itemId;
        int             commodityId    = commodityInfo.commodityId;
        OOShoppingUnit2 oOShoppingUnit = new OOShoppingUnit2();

        oOShoppingUnit.iId = commodityId;
        if (commodityInfo.sell)
        {
            oOShoppingUnit.EnableBtnBuy   = false;
            oOShoppingUnit.ItemFlagIconBg = true;
            oOShoppingUnit.ItemFlagIcon   = ResourceManager.GetIconSprite("font_yishouwan");
        }
        else
        {
            oOShoppingUnit.EnableBtnBuy   = true;
            oOShoppingUnit.ItemFlagIconBg = false;
            oOShoppingUnit.ItemFlagIcon   = ResourceManagerBase.GetNullSprite();
        }
        int num = commodityInfo.unitPrice * commodityInfo.itemNum;

        if ((long)num > MoneyType.GetNum(commodityInfo.moneyType))
        {
            oOShoppingUnit.PriceNow = "x" + num;
        }
        else
        {
            oOShoppingUnit.PriceNow = "x" + num;
        }
        oOShoppingUnit.ItemFrame = GameDataUtils.GetItemFrame(itemId);
        oOShoppingUnit.ItemIcon  = GameDataUtils.GetItemIcon(itemId);
        oOShoppingUnit.ItemName  = GameDataUtils.GetEquipItemNameAndLV(itemId, false);
        oOShoppingUnit.ItemNum   = string.Empty + commodityInfo.itemNum;
        oOShoppingUnit.CoinIcon  = MoneyType.GetIcon(commodityInfo.moneyType);
        oOShoppingUnit.PriceOld  = string.Empty;
        ShangPinBiao shangPinBiao = DataReader <ShangPinBiao> .Get(commodityInfo.commodityId);

        if (shangPinBiao != null)
        {
            if (shangPinBiao.pvpLevel > 0)
            {
                oOShoppingUnit.PVPIcon = ResourceManager.GetIconSprite(PVPManager.Instance.GetGetIntegralByLevel(shangPinBiao.pvpLevel, false));
                JingJiChangFenDuan jingJiChangFenDuan = DataReader <JingJiChangFenDuan> .Get(shangPinBiao.pvpLevel);

                if (jingJiChangFenDuan != null)
                {
                    oOShoppingUnit.PVPName = GameDataUtils.GetChineseContent(jingJiChangFenDuan.name, false);
                }
                oOShoppingUnit.TipShow = (shangPinBiao.pvpLevel > PVPManager.Instance.GetIntegralLevel().id);
            }
            else
            {
                oOShoppingUnit.PVPIcon = ResourceManagerBase.GetNullSprite();
                oOShoppingUnit.PVPName = string.Empty;
                oOShoppingUnit.TipShow = false;
            }
        }
        return(oOShoppingUnit);
    }
    private OOXShoppingUnit GetItem2Normal(int storeId, StoreGoodsInfo sgi)
    {
        OOXShoppingUnit oOXShoppingUnit = new OOXShoppingUnit();

        oOXShoppingUnit.iStoreId = storeId;
        oOXShoppingUnit.iId      = sgi.iId;
        int itemId = sgi.itemId;

        oOXShoppingUnit.ItemFrame = GameDataUtils.GetItemFrame(itemId);
        oOXShoppingUnit.ItemIcon  = GameDataUtils.GetItemIcon(itemId);
        oOXShoppingUnit.ItemName  = GameDataUtils.GetEquipItemNameAndLV(itemId, false);
        if (sgi.stockCfg == -1)
        {
            oOXShoppingUnit.ItemNum    = string.Empty;
            oOXShoppingUnit.ItemFlagOn = false;
        }
        else
        {
            int num = Mathf.Max(0, sgi.stockCfg - sgi.buyTimes);
            oOXShoppingUnit.ItemNum = num + "/" + sgi.stockCfg;
            if (num > 0 && XMarketManager.Instance.GetCurrentShopCanBuyMax() > 0)
            {
                oOXShoppingUnit.ItemFlagOn = false;
            }
            else
            {
                oOXShoppingUnit.ItemFlagOn = true;
            }
        }
        if (sgi.extraInfo.vipLvLmt > 0 && sgi.extraInfo.vipLvLmt > EntityWorld.Instance.EntSelf.VipLv)
        {
            oOXShoppingUnit.LockTip      = string.Format(GameDataUtils.GetChineseContent(508054, false), sgi.extraInfo.vipLvLmt);
            oOXShoppingUnit.PriceNowIcon = ResourceManagerBase.GetNullSprite();
            oOXShoppingUnit.PriceNow     = string.Empty;
        }
        else
        {
            oOXShoppingUnit.LockTip      = string.Empty;
            oOXShoppingUnit.PriceNowIcon = MoneyType.GetIcon(sgi.moneyType);
            oOXShoppingUnit.PriceNow     = "x" + BaseMarketManager.CurrentManagerInstance.GetCommodityPrice(sgi.iId, 1);
        }
        if (!oOXShoppingUnit.ItemFlagOn && sgi.extraInfo.discountIds.get_Count() > 0)
        {
            oOXShoppingUnit.DiscountOn = true;
            SZheKouPeiZhi sZheKouPeiZhi = DataReader <SZheKouPeiZhi> .Get(this.GetDiscountNow(sgi));

            if (sZheKouPeiZhi != null)
            {
                oOXShoppingUnit.DiscountNumber = GameDataUtils.GetChineseContent(sZheKouPeiZhi.icon, false);
            }
        }
        else
        {
            oOXShoppingUnit.DiscountOn = false;
        }
        oOXShoppingUnit.ItemFlagOwnOn = false;
        return(oOXShoppingUnit);
    }
    public void OnGetRewardRes(short state, GetActivityItemPrizeRes down = null)
    {
        if (GrowUpPlanUI.Instance != null && GrowUpPlanUI.Instance.get_gameObject().get_activeSelf())
        {
            ChengChangJiHua chengChangJiHua = DataReader <ChengChangJiHua> .Get(down.activityItemId);

            long   itemNum            = chengChangJiHua.ItemNum;
            string equipItemNameAndLV = GameDataUtils.GetEquipItemNameAndLV(chengChangJiHua.ItemId, false);
            string text = string.Format(GameDataUtils.GetChineseContent(513180, false), equipItemNameAndLV, itemNum);
            UIManagerControl.Instance.ShowToastText(text);
        }
    }
    private OOXShoppingUnit GetItem2Fashion(int storeId, StoreGoodsInfo sgi)
    {
        OOXShoppingUnit oOXShoppingUnit = new OOXShoppingUnit();

        oOXShoppingUnit.iStoreId = storeId;
        oOXShoppingUnit.iId      = sgi.iId;
        int itemId = sgi.itemId;

        oOXShoppingUnit.ItemFrame     = GameDataUtils.GetItemFrame(itemId);
        oOXShoppingUnit.ItemIcon      = GameDataUtils.GetItemIcon(itemId);
        oOXShoppingUnit.ItemName      = GameDataUtils.GetEquipItemNameAndLV(itemId, false);
        oOXShoppingUnit.ItemNum       = string.Empty;
        oOXShoppingUnit.ItemFlagOn    = false;
        oOXShoppingUnit.LockTip       = string.Empty;
        oOXShoppingUnit.PriceNowIcon  = MoneyType.GetIcon(sgi.moneyType);
        oOXShoppingUnit.PriceNow      = "x" + BaseMarketManager.CurrentManagerInstance.GetCommodityPrice(sgi.iId, 1);
        oOXShoppingUnit.DiscountOn    = false;
        oOXShoppingUnit.ItemFlagOwnOn = FashionManager.Instance.IsHasEternalFashion(sgi.iId);
        return(oOXShoppingUnit);
    }