Esempio n. 1
0
 public string ObtWay()
 {
     CMallItem.ItemType type = this.m_type;
     if (type != CMallItem.ItemType.Hero)
     {
         if (type != CMallItem.ItemType.Skin)
         {
             return(null);
         }
         if (this.m_skinData == null)
         {
             return(null);
         }
         ResHeroSkinShop resHeroSkinShop = null;
         GameDataMgr.skinShopInfoDict.TryGetValue(this.m_skinData.dwID, ref resHeroSkinShop);
         return((resHeroSkinShop == null) ? null : resHeroSkinShop.szGetPath);
     }
     else
     {
         if (this.m_heroData == null)
         {
             return(null);
         }
         ResHeroShop resHeroShop = null;
         GameDataMgr.heroShopInfoDict.TryGetValue(this.m_heroData.heroCfgInfo.dwCfgID, ref resHeroShop);
         return((resHeroShop == null) ? null : resHeroShop.szObtWay);
     }
 }
Esempio n. 2
0
    public string ObtWay()
    {
        ItemType type = this.m_type;

        if (type != ItemType.Hero)
        {
            if (type != ItemType.Skin)
            {
                return(null);
            }
        }
        else
        {
            if (this.m_heroData == null)
            {
                return(null);
            }
            ResHeroShop shop = null;
            GameDataMgr.heroShopInfoDict.TryGetValue(this.m_heroData.heroCfgInfo.dwCfgID, out shop);
            return((shop == null) ? null : shop.szObtWay);
        }
        if (this.m_skinData == null)
        {
            return(null);
        }
        ResHeroSkinShop shop2 = null;

        GameDataMgr.skinShopInfoDict.TryGetValue(this.m_skinData.dwID, out shop2);
        return((shop2 == null) ? null : shop2.szGetPath);
    }
Esempio n. 3
0
    public byte ObtWayType()
    {
        ItemType type = this.m_type;

        if (type != ItemType.Hero)
        {
            if (type != ItemType.Skin)
            {
                return(0);
            }
        }
        else
        {
            if (this.m_heroData == null)
            {
                return(0);
            }
            ResHeroShop shop = null;
            GameDataMgr.heroShopInfoDict.TryGetValue(this.m_heroData.heroCfgInfo.dwCfgID, out shop);
            return((shop == null) ? ((byte)0) : shop.bObtWayType);
        }
        if (this.m_skinData == null)
        {
            return(0);
        }
        ResHeroSkinShop shop2 = null;

        GameDataMgr.skinShopInfoDict.TryGetValue(this.m_skinData.dwID, out shop2);
        return((shop2 == null) ? ((byte)0) : shop2.bGetPathType);
    }
Esempio n. 4
0
        public static uint GetHeroCost(uint heroId, RES_SHOPBUY_COINTYPE costType)
        {
            ResHeroShop resHeroShop = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(heroId, ref resHeroShop);
            uint result = 0u;

            if (resHeroShop != null)
            {
                switch (costType)
                {
                case 2:
                    result = resHeroShop.dwBuyCoupons;
                    break;

                case 4:
                    result = resHeroShop.dwBuyCoin;
                    break;

                case 5:
                    result = resHeroShop.dwBuyBurnCoin;
                    break;

                case 6:
                    result = resHeroShop.dwBuyArenaCoin;
                    break;

                case 10:
                    result = resHeroShop.dwBuyDiamond;
                    break;
                }
            }
            return(result);
        }
        public CHeroItem(ulong objID, uint baseID, int stackCount = 0, int addTime = 0)
        {
            this.m_heroData = GameDataMgr.heroDatabin.GetDataByKey(baseID);
            if (this.m_heroData == null)
            {
                Debug.Log("not hero id" + baseID);
                return;
            }
            ResHeroShop resHeroShop = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(baseID, out resHeroShop);
            this.m_type              = COM_ITEM_TYPE.COM_OBJTYPE_HERO;
            this.m_objID             = objID;
            this.m_baseID            = baseID;
            this.m_name              = StringHelper.UTF8BytesToString(ref this.m_heroData.szName);
            this.m_description       = StringHelper.UTF8BytesToString(ref this.m_heroData.szHeroDesc);
            this.m_iconID            = uint.Parse(StringHelper.UTF8BytesToString(ref this.m_heroData.szImagePath));
            this.m_stackCount        = stackCount;
            this.m_stackMax          = 1;
            this.m_goldCoinBuy       = 0u;
            this.m_dianQuanBuy       = ((resHeroShop != null) ? resHeroShop.dwBuyCoupons : 1u);
            this.m_diamondBuy        = ((resHeroShop != null) ? resHeroShop.dwBuyDiamond : 1u);
            this.m_arenaCoinBuy      = ((resHeroShop != null) ? resHeroShop.dwBuyArenaCoin : 1u);
            this.m_burningCoinBuy    = ((resHeroShop != null) ? resHeroShop.dwBuyBurnCoin : 1u);
            this.m_dianQuanDirectBuy = 0u;
            this.m_coinSale          = 0u;
            this.m_grade             = 3;
            this.m_isSale            = 0;
            this.m_addTime           = 0;
            base.ResetTime();
        }
Esempio n. 6
0
        public static uint GetHeroCost(uint heroId, RES_SHOPBUY_COINTYPE costType)
        {
            ResHeroShop shop = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(heroId, out shop);
            uint num = 0;

            if (shop != null)
            {
                switch (costType)
                {
                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_COUPONS:
                    return(shop.dwBuyCoupons);

                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_ENCHANTPT:
                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_SKINCOIN:
                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_GUILDCOIN:
                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_SYMBOLCOIN:
                    return(num);

                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_PVPCOIN:
                    return(shop.dwBuyCoin);

                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_BURNINGCOIN:
                    return(shop.dwBuyBurnCoin);

                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_ARENACOIN:
                    return(shop.dwBuyArenaCoin);

                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_DIAMOND:
                    return(shop.dwBuyDiamond);
                }
            }
            return(num);
        }
Esempio n. 7
0
 public byte ObtWayType()
 {
     CMallItem.ItemType type = this.m_type;
     if (type != CMallItem.ItemType.Hero)
     {
         if (type != CMallItem.ItemType.Skin)
         {
             return(0);
         }
         if (this.m_skinData == null)
         {
             return(0);
         }
         ResHeroSkinShop resHeroSkinShop = null;
         GameDataMgr.skinShopInfoDict.TryGetValue(this.m_skinData.dwID, ref resHeroSkinShop);
         return((resHeroSkinShop == null) ? 0 : resHeroSkinShop.bGetPathType);
     }
     else
     {
         if (this.m_heroData == null)
         {
             return(0);
         }
         ResHeroShop resHeroShop = null;
         GameDataMgr.heroShopInfoDict.TryGetValue(this.m_heroData.heroCfgInfo.dwCfgID, ref resHeroShop);
         return((resHeroShop == null) ? 0 : resHeroShop.bObtWayType);
     }
 }
Esempio n. 8
0
        public static uint GetHeroCost(uint heroId, RES_SHOPBUY_COINTYPE costType)
        {
            ResHeroShop resHeroShop = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(heroId, out resHeroShop);
            uint result = 0u;

            if (resHeroShop != null)
            {
                switch (costType)
                {
                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_COUPONS:
                    result = resHeroShop.dwBuyCoupons;
                    break;

                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_PVPCOIN:
                    result = resHeroShop.dwBuyCoin;
                    break;

                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_BURNINGCOIN:
                    result = resHeroShop.dwBuyBurnCoin;
                    break;

                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_ARENACOIN:
                    result = resHeroShop.dwBuyArenaCoin;
                    break;

                case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_DIAMOND:
                    result = resHeroShop.dwBuyDiamond;
                    break;
                }
            }
            return(result);
        }
Esempio n. 9
0
        private int CompareDefault(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            bool flag  = this.m_roleInfo.IsHaveHero(l.dwCfgID, false);
            bool flag2 = this.m_roleInfo.IsHaveHero(r.dwCfgID, false);

            if (flag && !flag2)
            {
                return(1);
            }
            if (!flag && flag2)
            {
                return(-1);
            }
            ResHeroPromotion promotion  = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion();
            ResHeroPromotion promotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion();
            ResHeroShop      shop       = null;
            ResHeroShop      shop2      = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out shop);
            GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out shop2);
            uint dwSortIndex = (shop == null) ? uint.MaxValue : shop.dwSortId;
            uint num2        = (shop2 == null) ? uint.MaxValue : shop2.dwSortId;

            if (promotion != null)
            {
                dwSortIndex = promotion.dwSortIndex;
            }
            if (promotion2 != null)
            {
                num2 = promotion2.dwSortIndex;
            }
            if (dwSortIndex < num2)
            {
                return(1);
            }
            if (dwSortIndex > num2)
            {
                return(-1);
            }
            if (l.dwCfgID < r.dwCfgID)
            {
                return(-1);
            }
            if (l.dwCfgID > r.dwCfgID)
            {
                return(1);
            }
            return(0);
        }
Esempio n. 10
0
        private int CompareReleaseTime(IHeroData l, IHeroData r)
        {
            ResHeroShop resHeroShop  = null;
            ResHeroShop resHeroShop2 = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(l.cfgID, ref resHeroShop);
            GameDataMgr.heroShopInfoDict.TryGetValue(r.cfgID, ref resHeroShop2);
            if (resHeroShop == null)
            {
                return(1);
            }
            if (resHeroShop2 == null)
            {
                return(-1);
            }
            return(resHeroShop.dwReleaseId.CompareTo(resHeroShop2.dwReleaseId));
        }
Esempio n. 11
0
        private int CompareReleaseTime(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            ResHeroShop resHeroShop  = null;
            ResHeroShop resHeroShop2 = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out resHeroShop);
            GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out resHeroShop2);
            if (resHeroShop == null)
            {
                return(1);
            }
            if (resHeroShop2 == null)
            {
                return(-1);
            }
            return(resHeroShop.dwReleaseId.CompareTo(resHeroShop2.dwReleaseId));
        }
Esempio n. 12
0
        private int CompareCoin(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            ResHeroPromotion resPromotion  = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion();
            ResHeroPromotion resPromotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion();
            ResHeroShop      resHeroShop   = null;
            ResHeroShop      resHeroShop2  = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out resHeroShop);
            GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out resHeroShop2);
            stPayInfoSet payInfoSetOfGood  = CMallSystem.GetPayInfoSetOfGood(l, resPromotion);
            stPayInfoSet payInfoSetOfGood2 = CMallSystem.GetPayInfoSetOfGood(r, resPromotion2);
            uint         num  = 4294967295u;
            uint         num2 = 4294967295u;

            for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
            {
                if (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.GoldCoin && payInfoSetOfGood.m_payInfos[i].m_payValue <= num)
                {
                    num = payInfoSetOfGood.m_payInfos[i].m_payValue;
                }
            }
            for (int j = 0; j < payInfoSetOfGood2.m_payInfoCount; j++)
            {
                if (payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.GoldCoin && payInfoSetOfGood2.m_payInfos[j].m_payValue <= num2)
                {
                    num2 = payInfoSetOfGood2.m_payInfos[j].m_payValue;
                }
            }
            if (num == 4294967295u && this.IsDesc())
            {
                num = 0u;
            }
            if (num2 == 4294967295u && this.IsDesc())
            {
                num2 = 0u;
            }
            return(num.CompareTo(num2));
        }
Esempio n. 13
0
        private int CompareCoin(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            ResHeroPromotion resPromotion = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion();
            ResHeroPromotion promotion2   = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion();
            ResHeroShop      shop         = null;
            ResHeroShop      shop2        = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out shop);
            GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out shop2);
            stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, resPromotion);
            stPayInfoSet set2             = CMallSystem.GetPayInfoSetOfGood(r, promotion2);
            uint         maxValue         = uint.MaxValue;
            uint         payValue         = uint.MaxValue;

            for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
            {
                if ((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.GoldCoin) && (payInfoSetOfGood.m_payInfos[i].m_payValue <= maxValue))
                {
                    maxValue = payInfoSetOfGood.m_payInfos[i].m_payValue;
                }
            }
            for (int j = 0; j < set2.m_payInfoCount; j++)
            {
                if ((set2.m_payInfos[j].m_payType == enPayType.GoldCoin) && (set2.m_payInfos[j].m_payValue <= payValue))
                {
                    payValue = set2.m_payInfos[j].m_payValue;
                }
            }
            if ((maxValue == uint.MaxValue) && this.IsDesc())
            {
                maxValue = 0;
            }
            if ((payValue == uint.MaxValue) && this.IsDesc())
            {
                payValue = 0;
            }
            return(maxValue.CompareTo(payValue));
        }
        public static void OnReceiveDianQuanReward(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_COUPONS_REWARDINFO stCouponsRewardRsp = msg.stPkgData.stCouponsRewardRsp;
            bool       flag     = true;
            CPaySystem instance = Singleton <CPaySystem> .GetInstance();

            instance.rewardItems.Clear();
            int num = Mathf.Min((int)stCouponsRewardRsp.stRewardInfo.bNum, stCouponsRewardRsp.stRewardInfo.astRewardDetail.Length);

            for (int i = 0; i < num; i++)
            {
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 5)
                {
                    CUICommonSystem.ShowNewHeroOrSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stHero.dwHeroID, 0u, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, false, null, enFormPriority.Priority1, 0u, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 10)
                {
                    uint heroId;
                    uint skinId;
                    CSkinInfo.ResolveHeroSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stSkin.dwSkinID, out heroId, out skinId);
                    CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, false, null, enFormPriority.Priority1, 0u, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 1)
                {
                    if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 1)
                    {
                        uint           dwHeroID  = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stHeroInfo.dwHeroID;
                        ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwHeroID);
                        if (dataByKey != null)
                        {
                            ResHeroShop resHeroShop = null;
                            GameDataMgr.heroShopInfoDict.TryGetValue(dataByKey.dwCfgID, out resHeroShop);
                            CUICommonSystem.ShowNewHeroOrSkin(dwHeroID, 0u, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, (resHeroShop != null) ? resHeroShop.dwChgItemCnt : 1u, 0);
                        }
                    }
                    else if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 2)
                    {
                        uint dwSkinID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stSkinInfo.dwSkinID;
                        uint heroId2  = 0u;
                        uint skinId2  = 0u;
                        CSkinInfo.ResolveHeroSkin(dwSkinID, out heroId2, out skinId2);
                        ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId2, skinId2);
                        if (heroSkin != null)
                        {
                            ResHeroSkinShop resHeroSkinShop = null;
                            GameDataMgr.skinShopInfoDict.TryGetValue(heroSkin.dwID, out resHeroSkinShop);
                            CUICommonSystem.ShowNewHeroOrSkin(heroId2, skinId2, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, (resHeroSkinShop != null) ? resHeroSkinShop.dwChgItemCnt : 1u, 0);
                        }
                    }
                }
            }
            instance.rewardItems = CUseableManager.GetUseableListFromReward(stCouponsRewardRsp.stRewardInfo);
            if (flag)
            {
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(instance.rewardItems), null, false, enUIEventID.None, false, false, "Form_Award");
            }
        }
Esempio n. 15
0
        public static stPayInfoSet GetPayInfoSetOfGood(COM_ITEM_TYPE itemType, uint itemID)
        {
            CMallMysteryShop instance = Singleton <CMallMysteryShop> .GetInstance();

            stPayInfoSet        set       = new stPayInfoSet(2);
            long                doubleKey = GameDataMgr.GetDoubleKey((uint)itemType, itemID);
            CMallMysteryProduct product   = new CMallMysteryProduct();

            if (!instance.m_ProductDic.TryGetValue(doubleKey, out product))
            {
                return(set);
            }
            uint      index = (instance.Discount / 10) - 1;
            stPayInfo info  = new stPayInfo();

            switch (product.ItemType)
            {
            case COM_ITEM_TYPE.COM_OBJTYPE_HERO:
            {
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(itemID);
                DebugHelper.Assert(dataByKey != null, "神秘商店配置的英雄ID有错,英雄表里不存在");
                if (dataByKey != null)
                {
                    ResHeroShop shop2 = null;
                    GameDataMgr.heroShopInfoDict.TryGetValue(dataByKey.dwCfgID, out shop2);
                    info.m_payType = CMallSystem.ResBuyTypeToPayType(product.Cfg.bMoneyType);
                    switch (info.m_payType)
                    {
                    case enPayType.GoldCoin:
                        info.m_oriValue = (shop2 == null) ? 1 : shop2.dwBuyCoin;
                        goto Label_0207;

                    case enPayType.DianQuan:
                        info.m_oriValue = (shop2 == null) ? 1 : shop2.dwBuyCoupons;
                        goto Label_0207;

                    case enPayType.Diamond:
                    case enPayType.DiamondAndDianQuan:
                        info.m_oriValue = (shop2 == null) ? 1 : shop2.dwBuyDiamond;
                        goto Label_0207;
                    }
                    break;
                }
                return(set);
            }

            case COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN:
            {
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(itemID);
                DebugHelper.Assert(heroSkin != null, "神秘商店配置的皮肤ID有错,皮肤表里不存在");
                if (heroSkin != null)
                {
                    ResHeroSkinShop shop3 = null;
                    GameDataMgr.skinShopInfoDict.TryGetValue(heroSkin.dwID, out shop3);
                    info.m_payType = CMallSystem.ResBuyTypeToPayType(product.Cfg.bMoneyType);
                    switch (info.m_payType)
                    {
                    case enPayType.DianQuan:
                        info.m_oriValue = (shop3 == null) ? 1 : shop3.dwBuyCoupons;
                        goto Label_0207;

                    case enPayType.Diamond:
                    case enPayType.DiamondAndDianQuan:
                        info.m_oriValue = (shop3 == null) ? 1 : shop3.dwBuyDiamond;
                        goto Label_0207;
                    }
                    break;
                }
                return(set);
            }
            }
Label_0207:
            if (info.m_oriValue == 0)
            {
                info.m_oriValue = (uint)product.Cfg.RouZheKou[product.Cfg.RouZheKou.Length - 1];
            }
            if ((index < 0) || (index >= product.Cfg.RouZheKou.Length))
            {
                info.m_payValue           = info.m_oriValue;
                info.m_discountForDisplay = 0x2710;
            }
            else if (instance.IsRandomDiscount)
            {
                info.m_payValue           = (uint)product.Cfg.RouZheKou[index];
                info.m_discountForDisplay = instance.Discount * 100;
            }
            else
            {
                info.m_payValue           = (uint)product.Cfg.iConfirmZheKou;
                info.m_discountForDisplay = instance.Discount * 100;
            }
            set.m_payInfos[set.m_payInfoCount] = info;
            set.m_payInfoCount++;
            return(set);
        }
Esempio n. 16
0
        private void UpdateItem(CUIEvent uiEvent, COMDT_AKALISHOP_GOODS productInfo)
        {
            if (productInfo == null)
            {
                return;
            }
            CUIFormScript srcFormScript = uiEvent.m_srcFormScript;
            GameObject    srcWidget     = uiEvent.m_srcWidget;

            if (srcFormScript == null || srcWidget == null)
            {
                return;
            }
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "master roleInfo is null");
            if (masterRoleInfo == null)
            {
                return;
            }
            GameObject gameObject = Utility.FindChild(srcWidget, "heroItem");

            if (gameObject == null)
            {
                DebugHelper.Assert(gameObject != null, "hero item is null");
                return;
            }
            GameObject gameObject2 = Utility.FindChild(srcWidget, "defualtItem");

            if (gameObject2 != null)
            {
                gameObject2.CustomSetActive(false);
            }
            if (gameObject != null)
            {
                gameObject.CustomSetActive(true);
            }
            Text       componetInChild = Utility.GetComponetInChild <Text>(gameObject, "heroDataPanel/heroNamePanel/heroNameText");
            GameObject gameObject3     = Utility.FindChild(gameObject, "heroDataPanel/heroNamePanel/heroSkinText");

            if (gameObject3 == null)
            {
                return;
            }
            Text       component   = gameObject3.GetComponent <Text>();
            GameObject gameObject4 = Utility.FindChild(gameObject, "tag");

            if (gameObject4 == null)
            {
                return;
            }
            GameObject gameObject5 = Utility.FindChild(gameObject, "profession");

            if (gameObject5 == null)
            {
                return;
            }
            GameObject gameObject6 = Utility.FindChild(srcWidget, "imgExperienceMark");

            if (gameObject6 == null)
            {
                return;
            }
            if (gameObject6)
            {
                gameObject6.CustomSetActive(true);
            }
            GameObject gameObject7 = Utility.FindChild(gameObject, "skinLabelImage");

            if (gameObject7 == null)
            {
                return;
            }
            GameObject gameObject8 = Utility.FindChild(gameObject, "heroDataPanel/heroPricePanel");

            if (gameObject8 == null)
            {
                return;
            }
            gameObject8.CustomSetActive(false);
            GameObject gameObject9 = Utility.FindChild(srcWidget, "ButtonGroup/BuyBtn");

            if (gameObject9 == null)
            {
                return;
            }
            gameObject9.CustomSetActive(false);
            Text   componetInChild2 = Utility.GetComponetInChild <Text>(gameObject9, "Text");
            Button component2       = gameObject9.GetComponent <Button>();

            if (component2 == null)
            {
                return;
            }
            CUIEventScript component3 = gameObject9.GetComponent <CUIEventScript>();

            if (component3 == null)
            {
                return;
            }
            component3.enabled = false;
            component2.enabled = false;
            GameObject gameObject10 = Utility.FindChild(srcWidget, "ButtonGroup/LinkBtn");

            if (gameObject10 == null)
            {
                return;
            }
            gameObject10.CustomSetActive(false);
            Text   componetInChild3 = Utility.GetComponetInChild <Text>(gameObject10, "Text");
            Button component4       = gameObject10.GetComponent <Button>();

            if (component4 == null)
            {
                return;
            }
            CUIEventScript component5 = gameObject10.GetComponent <CUIEventScript>();

            if (component5 == null)
            {
                return;
            }
            component5.enabled = false;
            component4.enabled = false;
            COM_ITEM_TYPE wItemType = (COM_ITEM_TYPE)productInfo.wItemType;
            uint          dwItemID  = productInfo.dwItemID;

            switch (wItemType)
            {
            case COM_ITEM_TYPE.COM_OBJTYPE_HERO:
            {
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwItemID);
                DebugHelper.Assert(dataByKey != null, "神秘商店配置的英雄ID有错,英雄表里不存在");
                if (dataByKey == null)
                {
                    return;
                }
                ResHeroShop resHeroShop = null;
                GameDataMgr.heroShopInfoDict.TryGetValue(dataByKey.dwCfgID, out resHeroShop);
                CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, gameObject, StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), enHeroHeadType.enBust, false, true);
                gameObject5.CustomSetActive(false);
                gameObject7.CustomSetActive(false);
                gameObject3.CustomSetActive(false);
                if (componetInChild != null)
                {
                    componetInChild.set_text(StringHelper.UTF8BytesToString(ref dataByKey.szName));
                }
                if (masterRoleInfo.IsHaveHero(dataByKey.dwCfgID, false))
                {
                    gameObject9.CustomSetActive(true);
                    componetInChild2.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Hero_State_Own"));
                    gameObject4.CustomSetActive(false);
                    gameObject6.CustomSetActive(false);
                }
                else
                {
                    gameObject6.CustomSetActive(masterRoleInfo.IsValidExperienceHero(dataByKey.dwCfgID));
                    gameObject8.CustomSetActive(true);
                    gameObject9.CustomSetActive(true);
                    componetInChild2.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Buy"));
                    component3.enabled = true;
                    component2.enabled = true;
                    this.UpdateItemPricePnl(srcFormScript, gameObject8.transform, gameObject4.transform, productInfo);
                    component3.SetUIEvent(enUIEventType.Click, enUIEventID.Mall_Mystery_On_Open_Buy_Form, new stUIEventParams
                        {
                            tag = uiEvent.m_srcWidgetIndexInBelongedList
                        });
                }
                break;
            }

            case COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN:
            {
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(dwItemID);
                DebugHelper.Assert(heroSkin != null, "神秘商店配置的皮肤ID有错,皮肤表里不存在");
                if (heroSkin == null)
                {
                    return;
                }
                ResHeroSkinShop resHeroSkinShop = null;
                GameDataMgr.skinShopInfoDict.TryGetValue(heroSkin.dwSkinID, out resHeroSkinShop);
                ResHeroCfgInfo dataByKey2 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID);
                DebugHelper.Assert(dataByKey2 != null, "神秘商店配置的皮肤ID有错,皮肤对应的英雄不存在");
                if (dataByKey2 == null)
                {
                    return;
                }
                CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, gameObject.gameObject, heroSkin.szSkinPicID, enHeroHeadType.enBust, false, true);
                gameObject5.CustomSetActive(false);
                CUICommonSystem.SetHeroSkinLabelPic(uiEvent.m_srcFormScript, gameObject7, heroSkin.dwHeroID, heroSkin.dwSkinID);
                gameObject3.CustomSetActive(true);
                if (componetInChild != null)
                {
                    componetInChild.set_text(StringHelper.UTF8BytesToString(ref dataByKey2.szName));
                }
                if (component != null)
                {
                    component.set_text(StringHelper.UTF8BytesToString(ref heroSkin.szSkinName));
                }
                if (masterRoleInfo.IsHaveHeroSkin(heroSkin.dwHeroID, heroSkin.dwSkinID, false))
                {
                    gameObject9.CustomSetActive(true);
                    componetInChild2.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Skin_State_Own"));
                    gameObject4.CustomSetActive(false);
                    gameObject6.CustomSetActive(false);
                }
                else
                {
                    gameObject6.CustomSetActive(masterRoleInfo.IsValidExperienceSkin(heroSkin.dwHeroID, heroSkin.dwSkinID));
                    gameObject8.CustomSetActive(true);
                    gameObject10.CustomSetActive(false);
                    this.UpdateItemPricePnl(srcFormScript, gameObject8.transform, gameObject4.transform, productInfo);
                    if (masterRoleInfo.IsCanBuySkinButNotHaveHero(heroSkin.dwHeroID, heroSkin.dwSkinID))
                    {
                        gameObject9.CustomSetActive(true);
                        component3.enabled = true;
                        componetInChild2.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Skin_State_Buy_hero"));
                        component2.enabled = true;
                        stUIEventParams eventParams = default(stUIEventParams);
                        eventParams.openHeroFormPar.heroId  = heroSkin.dwHeroID;
                        eventParams.openHeroFormPar.skinId  = heroSkin.dwSkinID;
                        eventParams.openHeroFormPar.openSrc = enHeroFormOpenSrc.SkinBuyClick;
                        component3.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_OpenForm, eventParams);
                        this.UpdateItemPricePnl(srcFormScript, gameObject8.transform, gameObject4.transform, productInfo);
                    }
                    else
                    {
                        gameObject10.CustomSetActive(false);
                        gameObject9.CustomSetActive(true);
                        componetInChild2.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Buy"));
                        component3.enabled = true;
                        component2.enabled = true;
                        component3.SetUIEvent(enUIEventType.Click, enUIEventID.Mall_Mystery_On_Open_Buy_Form, new stUIEventParams
                            {
                                tag = uiEvent.m_srcWidgetIndexInBelongedList
                            });
                    }
                }
                break;
            }
            }
        }
Esempio n. 17
0
        public void UpdateView(CUIEvent uiEvent)
        {
            CUIFormScript srcFormScript = uiEvent.m_srcFormScript;
            GameObject    srcWidget     = uiEvent.m_srcWidget;

            if ((srcFormScript != null) && (srcWidget != null))
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                DebugHelper.Assert(masterRoleInfo != null, "master roleInfo is null");
                if (masterRoleInfo != null)
                {
                    GameObject p = Utility.FindChild(srcWidget, "heroItem");
                    if (p == null)
                    {
                        DebugHelper.Assert(p != null, "hero item is null");
                    }
                    else
                    {
                        Text       componetInChild = Utility.GetComponetInChild <Text>(p, "heroDataPanel/heroNamePanel/heroNameText");
                        GameObject obj4            = Utility.FindChild(p, "heroDataPanel/heroNamePanel/heroSkinText");
                        if (obj4 != null)
                        {
                            Text       component = obj4.GetComponent <Text>();
                            GameObject obj5      = Utility.FindChild(p, "tag");
                            if (obj5 != null)
                            {
                                GameObject obj6 = Utility.FindChild(p, "profession");
                                if (obj6 != null)
                                {
                                    GameObject obj7 = Utility.FindChild(srcWidget, "imgExperienceMark");
                                    if (obj7 != null)
                                    {
                                        GameObject obj8 = Utility.FindChild(p, "skinLabelImage");
                                        if (obj8 != null)
                                        {
                                            GameObject obj9 = Utility.FindChild(p, "heroDataPanel/heroPricePanel");
                                            if (obj9 != null)
                                            {
                                                obj9.CustomSetActive(false);
                                                GameObject obj10 = Utility.FindChild(srcWidget, "ButtonGroup/BuyBtn");
                                                if (obj10 != null)
                                                {
                                                    obj10.CustomSetActive(false);
                                                    Text   text3  = Utility.GetComponetInChild <Text>(obj10, "Text");
                                                    Button button = obj10.GetComponent <Button>();
                                                    if (button != null)
                                                    {
                                                        CUIEventScript script2 = obj10.GetComponent <CUIEventScript>();
                                                        if (script2 != null)
                                                        {
                                                            script2.enabled = false;
                                                            button.enabled  = false;
                                                            GameObject obj11 = Utility.FindChild(srcWidget, "ButtonGroup/LinkBtn");
                                                            if (obj11 != null)
                                                            {
                                                                obj11.CustomSetActive(false);
                                                                Text   text4   = Utility.GetComponetInChild <Text>(obj11, "Text");
                                                                Button button2 = obj11.GetComponent <Button>();
                                                                if (button2 != null)
                                                                {
                                                                    CUIEventScript script3 = obj11.GetComponent <CUIEventScript>();
                                                                    if (script3 != null)
                                                                    {
                                                                        script3.enabled = false;
                                                                        button2.enabled = false;
                                                                        switch (this.m_ItemType)
                                                                        {
                                                                        case COM_ITEM_TYPE.COM_OBJTYPE_HERO:
                                                                        {
                                                                            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(this.m_itemID);
                                                                            DebugHelper.Assert(dataByKey != null, "神秘商店配置的英雄ID有错,英雄表里不存在");
                                                                            if (dataByKey != null)
                                                                            {
                                                                                ResHeroShop shop = null;
                                                                                GameDataMgr.heroShopInfoDict.TryGetValue(dataByKey.dwCfgID, out shop);
                                                                                CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, p, StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), enHeroHeadType.enBust, false);
                                                                                obj6.CustomSetActive(false);
                                                                                obj8.CustomSetActive(false);
                                                                                obj4.CustomSetActive(false);
                                                                                if (componetInChild != null)
                                                                                {
                                                                                    componetInChild.text = StringHelper.UTF8BytesToString(ref dataByKey.szName);
                                                                                }
                                                                                if (masterRoleInfo.IsHaveHero(dataByKey.dwCfgID, false))
                                                                                {
                                                                                    obj10.CustomSetActive(true);
                                                                                    text3.text = Singleton <CTextManager> .GetInstance().GetText("Mall_Hero_State_Own");

                                                                                    obj5.CustomSetActive(false);
                                                                                    obj7.CustomSetActive(false);
                                                                                }
                                                                                else
                                                                                {
                                                                                    obj7.CustomSetActive(masterRoleInfo.IsValidExperienceHero(dataByKey.dwCfgID));
                                                                                    stPayInfoSet lowestPayInfoSetOfGood = CMallSystem.GetLowestPayInfoSetOfGood(dataByKey, CMallSystem.ResBuyTypeToPayType(this.Cfg.bMoneyType));
                                                                                    if (lowestPayInfoSetOfGood.m_payInfoCount == 0)
                                                                                    {
                                                                                        obj11.CustomSetActive(true);
                                                                                        if (shop != null)
                                                                                        {
                                                                                            text4.text = StringHelper.UTF8BytesToString(ref shop.szObtWay);
                                                                                        }
                                                                                        else
                                                                                        {
                                                                                            text4.text = null;
                                                                                        }
                                                                                        if ((shop != null) && (shop.bObtWayType > 0))
                                                                                        {
                                                                                            script3.enabled = true;
                                                                                            button2.enabled = true;
                                                                                            stUIEventParams eventParams = new stUIEventParams {
                                                                                                tag = shop.bObtWayType
                                                                                            };
                                                                                            script3.SetUIEvent(enUIEventType.Click, enUIEventID.Mall_Jump_Form, eventParams);
                                                                                        }
                                                                                        else
                                                                                        {
                                                                                            script3.enabled = false;
                                                                                            button2.enabled = false;
                                                                                        }
                                                                                    }
                                                                                    else
                                                                                    {
                                                                                        obj9.CustomSetActive(true);
                                                                                        obj10.CustomSetActive(true);
                                                                                        text3.text = Singleton <CTextManager> .GetInstance().GetText("Mall_Buy");

                                                                                        script2.enabled = true;
                                                                                        button.enabled  = true;
                                                                                        this.UpdateItemPricePnl(srcFormScript, obj9.transform, obj5.transform, ref lowestPayInfoSetOfGood);
                                                                                        stUIEventParams params2 = new stUIEventParams {
                                                                                            tag = uiEvent.m_srcWidgetIndexInBelongedList
                                                                                        };
                                                                                        script2.SetUIEvent(enUIEventType.Click, enUIEventID.Mall_Mystery_On_Open_Buy_Form, params2);
                                                                                    }
                                                                                }
                                                                                break;
                                                                            }
                                                                            return;
                                                                        }

                                                                        case COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN:
                                                                        {
                                                                            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(this.m_itemID);
                                                                            DebugHelper.Assert(heroSkin != null, "神秘商店配置的皮肤ID有错,皮肤表里不存在");
                                                                            if (heroSkin != null)
                                                                            {
                                                                                ResHeroSkinShop shop2 = null;
                                                                                GameDataMgr.skinShopInfoDict.TryGetValue(heroSkin.dwSkinID, out shop2);
                                                                                ResHeroCfgInfo info3 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID);
                                                                                DebugHelper.Assert(info3 != null, "神秘商店配置的皮肤ID有错,皮肤对应的英雄不存在");
                                                                                if (info3 == null)
                                                                                {
                                                                                    return;
                                                                                }
                                                                                CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, p.gameObject, heroSkin.szSkinPicID, enHeroHeadType.enBust, false);
                                                                                obj6.CustomSetActive(false);
                                                                                CUICommonSystem.SetHeroSkinLabelPic(uiEvent.m_srcFormScript, obj8, heroSkin.dwHeroID, heroSkin.dwSkinID);
                                                                                obj4.CustomSetActive(true);
                                                                                if (componetInChild != null)
                                                                                {
                                                                                    componetInChild.text = StringHelper.UTF8BytesToString(ref info3.szName);
                                                                                }
                                                                                if (component != null)
                                                                                {
                                                                                    component.text = StringHelper.UTF8BytesToString(ref heroSkin.szSkinName);
                                                                                }
                                                                                if (masterRoleInfo.IsHaveHeroSkin(heroSkin.dwHeroID, heroSkin.dwSkinID, false))
                                                                                {
                                                                                    obj10.CustomSetActive(true);
                                                                                    text3.text = Singleton <CTextManager> .GetInstance().GetText("Mall_Skin_State_Own");

                                                                                    obj5.CustomSetActive(false);
                                                                                    obj7.CustomSetActive(false);
                                                                                }
                                                                                else
                                                                                {
                                                                                    obj7.CustomSetActive(masterRoleInfo.IsValidExperienceSkin(heroSkin.dwHeroID, heroSkin.dwSkinID));
                                                                                    obj9.CustomSetActive(true);
                                                                                    stPayInfoSet payInfoSet = CMallSystem.GetLowestPayInfoSetOfGood(heroSkin, CMallSystem.ResBuyTypeToPayType(this.Cfg.bMoneyType));
                                                                                    if (payInfoSet.m_payInfoCount == 0)
                                                                                    {
                                                                                        obj11.CustomSetActive(true);
                                                                                        if (shop2 != null)
                                                                                        {
                                                                                            text4.text = StringHelper.UTF8BytesToString(ref shop2.szGetPath);
                                                                                        }
                                                                                    }
                                                                                    else
                                                                                    {
                                                                                        obj11.CustomSetActive(false);
                                                                                        this.UpdateItemPricePnl(srcFormScript, obj9.transform, obj5.transform, ref payInfoSet);
                                                                                    }
                                                                                    if (masterRoleInfo.IsCanBuySkinButNotHaveHero(heroSkin.dwHeroID, heroSkin.dwSkinID))
                                                                                    {
                                                                                        obj10.CustomSetActive(true);
                                                                                        script2.enabled = true;
                                                                                        text3.text      = Singleton <CTextManager> .GetInstance().GetText("Mall_Skin_State_Buy_hero");

                                                                                        button.enabled = true;
                                                                                        stUIEventParams params3 = new stUIEventParams();
                                                                                        params3.openHeroFormPar.heroId  = heroSkin.dwHeroID;
                                                                                        params3.openHeroFormPar.skinId  = heroSkin.dwSkinID;
                                                                                        params3.openHeroFormPar.openSrc = enHeroFormOpenSrc.SkinBuyClick;
                                                                                        script2.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_OpenForm, params3);
                                                                                        if (payInfoSet.m_payInfoCount > 0)
                                                                                        {
                                                                                            this.UpdateItemPricePnl(srcFormScript, obj9.transform, obj5.transform, ref payInfoSet);
                                                                                        }
                                                                                    }
                                                                                    else
                                                                                    {
                                                                                        obj11.CustomSetActive(false);
                                                                                        obj10.CustomSetActive(true);
                                                                                        text3.text = Singleton <CTextManager> .GetInstance().GetText("Mall_Buy");

                                                                                        script2.enabled = true;
                                                                                        button.enabled  = true;
                                                                                        stUIEventParams params4 = new stUIEventParams {
                                                                                            tag = uiEvent.m_srcWidgetIndexInBelongedList
                                                                                        };
                                                                                        script2.SetUIEvent(enUIEventType.Click, enUIEventID.Mall_Mystery_On_Open_Buy_Form, params4);
                                                                                    }
                                                                                }
                                                                                break;
                                                                            }
                                                                            return;
                                                                        }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 18
0
        private int CompareDefault(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            bool flag  = this.m_roleInfo.IsHaveHero(l.dwCfgID, false);
            bool flag2 = this.m_roleInfo.IsHaveHero(r.dwCfgID, false);

            if (flag && !flag2)
            {
                return(1);
            }
            if (!flag && flag2)
            {
                return(-1);
            }
            ResHeroPromotion resHeroPromotion  = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion();
            ResHeroPromotion resHeroPromotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion();
            ResHeroShop      resHeroShop       = null;
            ResHeroShop      resHeroShop2      = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out resHeroShop);
            GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out resHeroShop2);
            uint num  = (resHeroShop != null) ? resHeroShop.dwSortId : 4294967295u;
            uint num2 = (resHeroShop2 != null) ? resHeroShop2.dwSortId : 4294967295u;

            if (resHeroPromotion != null)
            {
                num = resHeroPromotion.dwSortIndex;
            }
            if (resHeroPromotion2 != null)
            {
                num2 = resHeroPromotion2.dwSortIndex;
            }
            if (resHeroShop != null)
            {
                ResDT_RegisterSale_Info stRegisterSale = resHeroShop.stRegisterSale;
                bool flag3 = CMallSystem.IsinRegisterSales(stRegisterSale);
                if (flag3)
                {
                    num = stRegisterSale.dwSortID;
                }
            }
            if (resHeroShop2 != null)
            {
                ResDT_RegisterSale_Info stRegisterSale2 = resHeroShop2.stRegisterSale;
                bool flag4 = CMallSystem.IsinRegisterSales(stRegisterSale2);
                if (flag4)
                {
                    num2 = stRegisterSale2.dwSortID;
                }
            }
            if (num < num2)
            {
                return(1);
            }
            if (num > num2)
            {
                return(-1);
            }
            if (l.dwCfgID < r.dwCfgID)
            {
                return(-1);
            }
            if (l.dwCfgID > r.dwCfgID)
            {
                return(1);
            }
            return(0);
        }
Esempio n. 19
0
    public bool TagInfo(ref string iconPath, ref string text, bool owned = false)
    {
        CTextManager instance = Singleton <CTextManager> .GetInstance();

        if (owned)
        {
            iconPath = "UGUI/Sprite/Common/Product_New.prefab";
            text     = instance.GetText("Mall_Hero_State_Own");
            return(true);
        }
        if (this.Owned(false))
        {
            iconPath = null;
            text     = null;
            return(false);
        }
        ResHeroPromotion      resHeroPromotion      = null;
        ResSkinPromotion      resSkinPromotion      = null;
        RES_LUCKYDRAW_ITEMTAG rES_LUCKYDRAW_ITEMTAG = this.TagType(ref resHeroPromotion, ref resSkinPromotion);
        string text2 = null;

        if (this.m_type == CMallItem.ItemType.Hero)
        {
            ResHeroShop heroShop = null;
            GameDataMgr.heroShopInfoDict.TryGetValue(this.m_heroData.heroCfgInfo.dwCfgID, ref heroShop);
            text2 = CMallSystem.GetRegisterSalesHeroDay(ref resHeroPromotion, heroShop);
        }
        else if (this.m_type == CMallItem.ItemType.Skin)
        {
            ResHeroSkinShop heroShop2 = null;
            GameDataMgr.skinShopInfoDict.TryGetValue(this.m_skinData.dwID, ref heroShop2);
            text2 = CMallSystem.GetRegisterSalesSkinDay(ref resSkinPromotion, heroShop2);
        }
        if (text2 != null)
        {
            iconPath = "UGUI/Sprite/Common/Product_Unusual.prefab";
            text     = text2;
            return(true);
        }
        switch (rES_LUCKYDRAW_ITEMTAG)
        {
        case 0:
            if (this.m_type == CMallItem.ItemType.Hero && this.m_heroData.heroCfgInfo.bTag == 1)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo == null)
                {
                    iconPath = null;
                    text     = null;
                    return(false);
                }
                if (GameDataMgr.svr2CltCfgDict.ContainsKey(24u))
                {
                    ResGlobalInfo resGlobalInfo = new ResGlobalInfo();
                    if (GameDataMgr.svr2CltCfgDict.TryGetValue(24u, ref resGlobalInfo))
                    {
                        uint dwConfValue = resGlobalInfo.dwConfValue;
                        if (masterRoleInfo.PvpLevel < dwConfValue)
                        {
                            iconPath = "UGUI/Sprite/Common/Hero_Newbie.prefab";
                            text     = Singleton <CTextManager> .GetInstance().GetText("Hero_Tag_Newbie");

                            return(true);
                        }
                    }
                }
            }
            iconPath = null;
            text     = null;
            return(false);

        case 1:
        {
            int  num                = 0;
            uint currentUTCTime     = (uint)CRoleInfo.GetCurrentUTCTime();
            CMallItem.ItemType type = this.m_type;
            if (type != CMallItem.ItemType.Hero)
            {
                if (type == CMallItem.ItemType.Skin)
                {
                    if (resSkinPromotion == null)
                    {
                        iconPath = null;
                        text     = null;
                        return(false);
                    }
                    if (resSkinPromotion.dwOnTimeGen > currentUTCTime)
                    {
                        num = (int)(resSkinPromotion.dwOffTimeGen - resSkinPromotion.dwOnTimeGen);
                    }
                    else
                    {
                        num = (int)(resSkinPromotion.dwOffTimeGen - currentUTCTime);
                    }
                }
            }
            else
            {
                if (resHeroPromotion == null)
                {
                    iconPath = null;
                    text     = null;
                    return(false);
                }
                if (resHeroPromotion.dwOnTimeGen > currentUTCTime)
                {
                    num = (int)(resHeroPromotion.dwOffTimeGen - resHeroPromotion.dwOnTimeGen);
                }
                else
                {
                    num = (int)(resHeroPromotion.dwOffTimeGen - currentUTCTime);
                }
            }
            if (num <= 0)
            {
                iconPath = null;
                text     = null;
                return(false);
            }
            int num2 = (int)Math.Ceiling((double)num / 86400.0);
            if (num2 > 0)
            {
                iconPath = "UGUI/Sprite/Common/Product_Unusual.prefab";
                text     = Singleton <CTextManager> .GetInstance().GetText("Mall_Promotion_Tag_1", new string[]
                    {
                        num2.ToString()
                    });

                return(true);
            }
            iconPath = null;
            text     = null;
            return(false);
        }

        case 2:
            iconPath = "UGUI/Sprite/Common/Product_New.prefab";
            text     = Singleton <CTextManager> .GetInstance().GetText("Common_Tag_New");

            return(true);

        case 3:
            iconPath = "UGUI/Sprite/Common/Product_Hot.prefab";
            text     = Singleton <CTextManager> .GetInstance().GetText("Common_Tag_Hot");

            return(true);

        case 4:
        {
            float num3 = 100f;
            switch (this.m_type)
            {
            case CMallItem.ItemType.Hero:
                if (resHeroPromotion == null)
                {
                    iconPath = null;
                    text     = null;
                    return(false);
                }
                num3 = resHeroPromotion.dwDiscount / 10f;
                break;

            case CMallItem.ItemType.Skin:
                if (resSkinPromotion == null)
                {
                    iconPath = null;
                    text     = null;
                    return(false);
                }
                num3 = resSkinPromotion.dwDiscount / 10f;
                break;
            }
            iconPath = "UGUI/Sprite/Common/Product_Discount.prefab";
            if (Math.Abs(num3 % 1f) < 1.401298E-45f)
            {
                text = string.Format("{0}折", ((int)num3).ToString("D"));
            }
            else
            {
                text = string.Format("{0}折", num3.ToString("0.0"));
            }
            return(true);
        }

        default:
            iconPath = null;
            text     = null;
            return(false);
        }
    }