Exemplo n.º 1
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);
     }
 }
Exemplo n.º 2
0
        public static uint GetHeroSkinCost(uint heroId, uint skinId, RES_SHOPBUY_COINTYPE costType)
        {
            ResHeroSkinShop shop      = null;
            uint            skinCfgId = GetSkinCfgId(heroId, skinId);

            GameDataMgr.skinShopInfoDict.TryGetValue(skinCfgId, out shop);
            uint num2 = 0;

            if (shop == null)
            {
                return(num2);
            }
            RES_SHOPBUY_COINTYPE res_shopbuy_cointype = costType;

            switch (res_shopbuy_cointype)
            {
            case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_SKINCOIN:
                return(shop.dwBuySkinCoin);

            case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_DIAMOND:
                return(shop.dwBuyDiamond);
            }
            if (res_shopbuy_cointype != RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_COUPONS)
            {
                return(num2);
            }
            return(shop.dwBuyCoupons);
        }
Exemplo n.º 3
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);
    }
Exemplo n.º 4
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);
    }
Exemplo n.º 5
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);
     }
 }
Exemplo n.º 6
0
        public CHeroSkin(ulong objID, uint baseID, int stackCount = 0, int addTime = 0)
        {
            ResHeroSkin dataByKey = GameDataMgr.heroSkinDatabin.GetDataByKey(baseID);

            if (dataByKey != null)
            {
                ResHeroSkinShop shop = null;
                GameDataMgr.skinShopInfoDict.TryGetValue(baseID, out shop);
                this.m_heroId = dataByKey.dwHeroID;
                this.m_skinId = dataByKey.dwSkinID;
                base.m_type   = COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN;
                base.m_objID  = objID;
                base.m_baseID = baseID;
                base.m_name   = StringHelper.UTF8BytesToString(ref dataByKey.szSkinName);
                if (shop != null)
                {
                    base.m_description = StringHelper.UTF8BytesToString(ref shop.szSkinDesc);
                }
                else
                {
                    base.m_description = string.Empty;
                }
                base.m_iconID      = uint.Parse(StringHelper.UTF8BytesToString(ref dataByKey.szSkinPicID));
                base.m_stackCount  = stackCount;
                base.m_stackMax    = 1;
                base.m_skinCoinBuy = (shop == null) ? 1 : shop.dwChgItemCnt;
                base.m_dianQuanBuy = (shop == null) ? 1 : shop.dwBuyCoupons;
                base.m_diamondBuy  = (shop == null) ? 1 : shop.dwBuyDiamond;
                base.m_coinSale    = 0;
                base.m_grade       = 3;
                base.m_isSale      = 0;
                base.m_addTime     = 0;
                base.ResetTime();
            }
        }
Exemplo n.º 7
0
        public static uint GetHeroSkinCost(uint heroId, uint skinId, RES_SHOPBUY_COINTYPE costType)
        {
            ResHeroSkinShop resHeroSkinShop = null;
            uint            skinCfgId       = CSkinInfo.GetSkinCfgId(heroId, skinId);

            GameDataMgr.skinShopInfoDict.TryGetValue(skinCfgId, ref resHeroSkinShop);
            uint result = 0u;

            if (resHeroSkinShop != null)
            {
                switch (costType)
                {
                case 7:
                    result = resHeroSkinShop.dwBuySkinCoin;
                    return(result);

                case 8:
                case 9:
IL_3A:
                    if (costType != 2)
                    {
                        return(result);
                    }
                    result = resHeroSkinShop.dwBuyCoupons;
                    return(result);

                case 10:
                    result = resHeroSkinShop.dwBuyDiamond;
                    return(result);
                }
                goto IL_3A;
            }
            return(result);
        }
Exemplo n.º 8
0
        public static ResSkinPromotion GetSkinPromotion(uint uniSkinId)
        {
            ResHeroSkinShop resHeroSkinShop = null;

            GameDataMgr.skinShopInfoDict.TryGetValue(uniSkinId, ref resHeroSkinShop);
            if (resHeroSkinShop == null)
            {
                return(null);
            }
            for (int i = 0; i < 5; i++)
            {
                uint num = resHeroSkinShop.PromotionID[i];
                if (num != 0u)
                {
                    if (GameDataMgr.skinPromotionDict.ContainsKey(num))
                    {
                        ResSkinPromotion resSkinPromotion = new ResSkinPromotion();
                        if (GameDataMgr.skinPromotionDict.TryGetValue(num, ref resSkinPromotion) && (ulong)resSkinPromotion.dwOnTimeGen <= (ulong)((long)CRoleInfo.GetCurrentUTCTime()) && (ulong)resSkinPromotion.dwOffTimeGen >= (ulong)((long)CRoleInfo.GetCurrentUTCTime()))
                        {
                            return(resSkinPromotion);
                        }
                    }
                }
            }
            return(null);
        }
Exemplo n.º 9
0
        public static uint GetHeroSkinCost(uint heroId, uint skinId, RES_SHOPBUY_COINTYPE costType)
        {
            ResHeroSkinShop resHeroSkinShop = null;
            uint            skinCfgId       = CSkinInfo.GetSkinCfgId(heroId, skinId);

            GameDataMgr.skinShopInfoDict.TryGetValue(skinCfgId, out resHeroSkinShop);
            uint result = 0u;

            if (resHeroSkinShop == null)
            {
                return(result);
            }
            switch (costType)
            {
            case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_SKINCOIN:
                return(resHeroSkinShop.dwBuySkinCoin);

            case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_DIAMOND:
                return(resHeroSkinShop.dwBuyDiamond);
            }
            if (costType != RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_COUPONS)
            {
                return(result);
            }
            return(resHeroSkinShop.dwBuyCoupons);
        }
Exemplo n.º 10
0
        private int CompareReleaseTime(ResHeroSkin l, ResHeroSkin r)
        {
            ResHeroSkinShop shop  = null;
            ResHeroSkinShop shop2 = null;

            GameDataMgr.skinShopInfoDict.TryGetValue(l.dwID, out shop);
            GameDataMgr.skinShopInfoDict.TryGetValue(r.dwID, out shop2);
            if (shop == null)
            {
                return(1);
            }
            if (shop2 == null)
            {
                return(-1);
            }
            return(shop.dwReleaseId.CompareTo(shop2.dwReleaseId));
        }
Exemplo n.º 11
0
        public static ResSkinPromotion GetSkinPromotion(uint uniSkinId)
        {
            ResHeroSkinShop shop = null;

            GameDataMgr.skinShopInfoDict.TryGetValue(uniSkinId, out shop);
            if (shop != null)
            {
                for (int i = 0; i < 5; i++)
                {
                    uint key = shop.PromotionID[i];
                    if ((key != 0) && GameDataMgr.skinPromotionDict.ContainsKey(key))
                    {
                        ResSkinPromotion promotion = new ResSkinPromotion();
                        if ((GameDataMgr.skinPromotionDict.TryGetValue(key, out promotion) && (promotion.dwOnTimeGen <= CRoleInfo.GetCurrentUTCTime())) && (promotion.dwOffTimeGen >= CRoleInfo.GetCurrentUTCTime()))
                        {
                            return(promotion);
                        }
                    }
                }
            }
            return(null);
        }
Exemplo n.º 12
0
        public int CompareQuality(ResHeroSkin l, ResHeroSkin r)
        {
            ResHeroSkinShop resHeroSkinShop  = null;
            ResHeroSkinShop resHeroSkinShop2 = null;

            GameDataMgr.skinShopInfoDict.TryGetValue(l.dwID, out resHeroSkinShop);
            GameDataMgr.skinShopInfoDict.TryGetValue(r.dwID, out resHeroSkinShop2);
            if (resHeroSkinShop == null)
            {
                return(1);
            }
            if (resHeroSkinShop2 == null)
            {
                return(-1);
            }
            int num = resHeroSkinShop2.bSkinQuality.CompareTo(resHeroSkinShop.bSkinQuality);

            if (num == 0)
            {
                return(this.CompareReleaseTime(l, r));
            }
            return(num);
        }
Exemplo n.º 13
0
        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");
            }
        }
Exemplo n.º 14
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;
            }
            }
        }
Exemplo 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);
        }
Exemplo n.º 16
0
        private int CompareDefault(ResHeroSkin l, ResHeroSkin r)
        {
            int result = 0;
            ResSkinPromotion skinPromotion   = CSkinInfo.GetSkinPromotion(l.dwHeroID, l.dwSkinID);
            ResSkinPromotion skinPromotion2  = CSkinInfo.GetSkinPromotion(r.dwHeroID, r.dwSkinID);
            ResHeroSkinShop  resHeroSkinShop = null;

            GameDataMgr.skinShopInfoDict.TryGetValue(l.dwID, ref resHeroSkinShop);
            ResHeroSkinShop resHeroSkinShop2 = null;

            GameDataMgr.skinShopInfoDict.TryGetValue(r.dwID, ref resHeroSkinShop2);
            uint num  = (resHeroSkinShop == null) ? 4294967295u : resHeroSkinShop.dwSortId;
            uint num2 = (resHeroSkinShop2 == null) ? 4294967295u : resHeroSkinShop2.dwSortId;

            if (skinPromotion != null)
            {
                num = skinPromotion.dwSortIndex;
            }
            if (skinPromotion2 != null)
            {
                num2 = skinPromotion2.dwSortIndex;
            }
            if (resHeroSkinShop != null)
            {
                ResDT_RegisterSale_Info stRegisterSale = resHeroSkinShop.stRegisterSale;
                bool flag = CMallSystem.IsinRegisterSales(stRegisterSale);
                if (flag)
                {
                    num = stRegisterSale.dwSortID;
                }
            }
            if (resHeroSkinShop2 != null)
            {
                ResDT_RegisterSale_Info stRegisterSale2 = resHeroSkinShop2.stRegisterSale;
                bool flag2 = CMallSystem.IsinRegisterSales(stRegisterSale2);
                if (flag2)
                {
                    num2 = stRegisterSale2.dwSortID;
                }
            }
            if (num < num2)
            {
                result = 1;
            }
            if (num > num2)
            {
                result = -1;
            }
            bool flag3 = this.m_roleInfo.IsHaveHeroSkin(l.dwHeroID, l.dwSkinID, false);
            bool flag4 = this.m_roleInfo.IsHaveHeroSkin(r.dwHeroID, r.dwSkinID, false);

            if (flag3 && !flag4)
            {
                return(1);
            }
            if (!flag3 && flag4)
            {
                return(-1);
            }
            if ((skinPromotion != null && skinPromotion.bSortIndexOnly > 0) || (skinPromotion2 != null && skinPromotion2.bSortIndexOnly > 0))
            {
                return(result);
            }
            if (CSkinInfo.IsCanBuy(l.dwHeroID, l.dwSkinID) && !CSkinInfo.IsCanBuy(r.dwHeroID, r.dwSkinID))
            {
                return(-1);
            }
            if (!CSkinInfo.IsCanBuy(l.dwHeroID, l.dwSkinID) && CSkinInfo.IsCanBuy(r.dwHeroID, r.dwSkinID))
            {
                return(1);
            }
            if (this.m_roleInfo.IsHaveHero(l.dwHeroID, false) && !this.m_roleInfo.IsHaveHero(r.dwHeroID, false))
            {
                return(-1);
            }
            if (!this.m_roleInfo.IsHaveHero(l.dwHeroID, false) && this.m_roleInfo.IsHaveHero(r.dwHeroID, false))
            {
                return(1);
            }
            return(result);
        }
Exemplo n.º 17
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);
        }
    }
Exemplo n.º 18
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;
                                                                        }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 19
0
        private int CompareDefault(ResHeroSkin l, ResHeroSkin r)
        {
            int num = 0;
            ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(l.dwHeroID, l.dwSkinID);
            ResSkinPromotion promotion2    = CSkinInfo.GetSkinPromotion(r.dwHeroID, r.dwSkinID);
            ResHeroSkinShop  shop          = null;

            GameDataMgr.skinShopInfoDict.TryGetValue(l.dwID, out shop);
            ResHeroSkinShop shop2 = null;

            GameDataMgr.skinShopInfoDict.TryGetValue(r.dwID, out shop2);
            uint dwSortIndex = (shop == null) ? uint.MaxValue : shop.dwSortId;
            uint num3        = (shop2 == null) ? uint.MaxValue : shop2.dwSortId;

            if (skinPromotion != null)
            {
                dwSortIndex = skinPromotion.dwSortIndex;
            }
            if (promotion2 != null)
            {
                num3 = promotion2.dwSortIndex;
            }
            if (dwSortIndex < num3)
            {
                num = 1;
            }
            if (dwSortIndex > num3)
            {
                num = -1;
            }
            bool flag  = this.m_roleInfo.IsHaveHeroSkin(l.dwHeroID, l.dwSkinID, false);
            bool flag2 = this.m_roleInfo.IsHaveHeroSkin(r.dwHeroID, r.dwSkinID, false);

            if (flag && !flag2)
            {
                return(1);
            }
            if (!flag && flag2)
            {
                return(-1);
            }
            if ((skinPromotion == null) || (skinPromotion.bSortIndexOnly <= 0))
            {
                if ((promotion2 != null) && (promotion2.bSortIndexOnly > 0))
                {
                    return(num);
                }
                if (CSkinInfo.IsCanBuy(l.dwHeroID, l.dwSkinID) && !CSkinInfo.IsCanBuy(r.dwHeroID, r.dwSkinID))
                {
                    return(-1);
                }
                if (!CSkinInfo.IsCanBuy(l.dwHeroID, l.dwSkinID) && CSkinInfo.IsCanBuy(r.dwHeroID, r.dwSkinID))
                {
                    return(1);
                }
                if (this.m_roleInfo.IsHaveHero(l.dwHeroID, false) && !this.m_roleInfo.IsHaveHero(r.dwHeroID, false))
                {
                    return(-1);
                }
                if (!this.m_roleInfo.IsHaveHero(l.dwHeroID, false) && this.m_roleInfo.IsHaveHero(r.dwHeroID, false))
                {
                    return(1);
                }
            }
            return(num);
        }