예제 #1
0
 public RES_LUCKYDRAW_ITEMTAG TagType(ref ResHeroPromotion heroPromotion, ref ResSkinPromotion skinPromotion)
 {
     CMallItem.ItemType type = this.m_type;
     if (type != CMallItem.ItemType.Hero)
     {
         if (type == CMallItem.ItemType.Skin)
         {
             if (this.m_skinData != null)
             {
                 skinPromotion = CSkinInfo.GetSkinPromotion(this.m_skinData.dwID);
                 if (skinPromotion == null)
                 {
                     return(0);
                 }
                 return(skinPromotion.bTag);
             }
         }
     }
     else if (this.m_heroData != null)
     {
         heroPromotion = this.m_heroData.promotion();
         if (heroPromotion == null)
         {
             return(0);
         }
         return(heroPromotion.bTag);
     }
     return(0);
 }
예제 #2
0
 public void AnalyseSoundBanks(ref ActorPreloadTab loadInfo, ref CActorInfo charInfo, ref ActorServerData serverData)
 {
     if (charInfo.SoundBanks != null && charInfo.SoundBanks.Length > 0)
     {
         for (int i = 0; i < charInfo.SoundBanks.Length; i++)
         {
             AssetLoadBase assetLoadBase = default(AssetLoadBase);
             assetLoadBase.assetPath = charInfo.SoundBanks[i];
             loadInfo.soundBanks.Add(assetLoadBase);
         }
     }
     if (serverData.SkinId != 0u)
     {
         ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)loadInfo.theActor.ConfigId, serverData.SkinId);
         if (heroSkin != null && !string.IsNullOrEmpty(heroSkin.szSkinSoundResPack))
         {
             AssetLoadBase assetLoadBase2 = default(AssetLoadBase);
             assetLoadBase2.assetPath = heroSkin.szSkinSoundResPack + "_SFX";
             loadInfo.soundBanks.Add(assetLoadBase2);
             assetLoadBase2           = default(AssetLoadBase);
             assetLoadBase2.assetPath = heroSkin.szSkinSoundResPack + "_VO";
             loadInfo.soundBanks.Add(assetLoadBase2);
         }
     }
 }
예제 #3
0
        public override void Fight()
        {
            base.Fight();
            if (ActorHelper.IsCaptainActor(ref this.actorPtr))
            {
                base.m_isControledByMan = true;
                base.m_isAutoAI         = false;
            }
            else
            {
                base.m_isControledByMan = false;
                base.m_isAutoAI         = true;
            }
            IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

            ActorServerData actorData = new ActorServerData();

            if ((actorDataProvider != null) && actorDataProvider.GetActorServerData(ref base.actor.TheActorMeta, ref actorData))
            {
                this.m_skinId    = actorData.SkinId;
                this.m_skinCfgId = CSkinInfo.GetSkinCfgId((uint)base.actor.TheActorMeta.ConfigId, this.m_skinId);
                if (this.m_skinId != 0)
                {
                    ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)base.actor.TheActorMeta.ConfigId, this.m_skinId);
                    if ((heroSkin != null) && !string.IsNullOrEmpty(heroSkin.szSoundSwitchEvent))
                    {
                        Singleton <CSoundManager> .instance.PostEvent(heroSkin.szSoundSwitchEvent, base.actor.gameObject);
                    }
                }
            }
            base.EnableRVO(false);
        }
예제 #4
0
    public RES_LUCKYDRAW_ITEMTAG TagType(ref ResHeroPromotion heroPromotion, ref ResSkinPromotion skinPromotion)
    {
        ItemType type = this.m_type;

        if (type != ItemType.Hero)
        {
            if ((type == ItemType.Skin) && (this.m_skinData != null))
            {
                skinPromotion = CSkinInfo.GetSkinPromotion(this.m_skinData.dwID);
                if (skinPromotion == null)
                {
                    return(RES_LUCKYDRAW_ITEMTAG.RES_LUCKYDRAW_ITEMTAG_NONE);
                }
                return((RES_LUCKYDRAW_ITEMTAG)skinPromotion.bTag);
            }
        }
        else if (this.m_heroData != null)
        {
            heroPromotion = this.m_heroData.promotion();
            if (heroPromotion == null)
            {
                return(RES_LUCKYDRAW_ITEMTAG.RES_LUCKYDRAW_ITEMTAG_NONE);
            }
            return((RES_LUCKYDRAW_ITEMTAG)heroPromotion.bTag);
        }
        return(RES_LUCKYDRAW_ITEMTAG.RES_LUCKYDRAW_ITEMTAG_NONE);
    }
예제 #5
0
 public void AnalyseSoundBanks(ref ActorPreloadTab loadInfo, ref CActorInfo charInfo, ref ActorServerData serverData)
 {
     if ((charInfo.SoundBanks != null) && (charInfo.SoundBanks.Length > 0))
     {
         for (int i = 0; i < charInfo.SoundBanks.Length; i++)
         {
             AssetLoadBase item = new AssetLoadBase {
                 assetPath = charInfo.SoundBanks[i]
             };
             loadInfo.soundBanks.Add(item);
         }
     }
     if (serverData.SkinId != 0)
     {
         ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)loadInfo.theActor.ConfigId, serverData.SkinId);
         if ((heroSkin != null) && !string.IsNullOrEmpty(heroSkin.szSkinSoundResPack))
         {
             AssetLoadBase base3 = new AssetLoadBase {
                 assetPath = heroSkin.szSkinSoundResPack + "_SFX"
             };
             loadInfo.soundBanks.Add(base3);
             base3 = new AssetLoadBase {
                 assetPath = heroSkin.szSkinSoundResPack + "_VO"
             };
             loadInfo.soundBanks.Add(base3);
         }
     }
 }
예제 #6
0
        public void LoadSkinSoundBank(uint heroId, uint skinId, GameObject obj, bool bLobby)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if ((heroSkin == null) && (skinId != 0))
            {
                heroSkin = CSkinInfo.GetHeroSkin(heroId, 0);
            }
            if (heroSkin != null)
            {
                if (!string.IsNullOrEmpty(heroSkin.szSkinSoundResPack))
                {
                    if (bLobby)
                    {
                        this.LoadHeroSoundBank(heroSkin.szSkinSoundResPack + "_Show");
                    }
                    else
                    {
                        this.LoadBank(heroSkin.szSkinSoundResPack + "_SFX", BankType.Battle);
                        this.LoadBank(heroSkin.szSkinSoundResPack + "_VO", BankType.Battle);
                    }
                }
                if (!string.IsNullOrEmpty(heroSkin.szSoundSwitchEvent))
                {
                    this.PostEvent(heroSkin.szSoundSwitchEvent, obj);
                }
            }
            else
            {
                object[] inParameters = new object[] { heroId, skinId };
                DebugHelper.Assert(false, "Default sound resource can not find heroId = {0}skinId ={1}", inParameters);
            }
        }
예제 #7
0
        public void SetSkinProp(uint heroId, uint skinId, bool bWear)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            DebugHelper.Assert(heroSkin != null, "Skin==null");
            ushort wType    = 0;
            byte   bValType = 0;
            int    val      = 0;

            for (int i = 0; i < 15; i++)
            {
                wType    = heroSkin.astAttr[i].wType;
                bValType = heroSkin.astAttr[i].bValType;
                val      = heroSkin.astAttr[i].iValue;
                if ((wType != 0) && (val != 0))
                {
                    if (bWear)
                    {
                        this.ChangeFuncEft((RES_FUNCEFT_TYPE)wType, (RES_VALUE_TYPE)bValType, val, true);
                    }
                    else
                    {
                        this.ChangeFuncEft((RES_FUNCEFT_TYPE)wType, (RES_VALUE_TYPE)bValType, -val, true);
                    }
                }
            }
        }
예제 #8
0
        private static int GetHeroCombatEft(PoolObjHandle <ActorRoot> actor)
        {
            if (actor == 0)
            {
                return(0);
            }
            int num = 0;
            IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

            ActorServerData actorData = new ActorServerData();

            if (actorDataProvider.GetActorServerData(ref actor.handle.TheActorMeta, ref actorData))
            {
                num += CHeroInfo.GetCombatEftByStarLevel((int)actorData.Level, (int)actorData.Star);
                num += CSkinInfo.GetCombatEft((uint)actorData.TheActorMeta.ConfigId, actorData.SkinId);
                ActorServerRuneData runeData = new ActorServerRuneData();
                for (int i = 0; i < 30; i++)
                {
                    if (actorDataProvider.GetActorServerRuneData(ref actor.handle.TheActorMeta, (ActorRunelSlot)i, ref runeData))
                    {
                        ResSymbolInfo dataByKey = GameDataMgr.symbolInfoDatabin.GetDataByKey(runeData.RuneId);
                        if (dataByKey != null)
                        {
                            num += dataByKey.iCombatEft;
                        }
                    }
                }
            }
            return(num);
        }
    private void OnHotSaleEnable(CUIEvent uiEvent)
    {
        int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;

        if (srcWidgetIndexInBelongedList < 0 || srcWidgetIndexInBelongedList >= this.m_HotSaleListView.Count)
        {
            return;
        }
        GameObject srcWidget = uiEvent.m_srcWidget;

        if (srcWidget == null)
        {
            return;
        }
        CMallItemWidget component = srcWidget.GetComponent <CMallItemWidget>();

        if (component == null)
        {
            return;
        }
        ResBoutiqueConf resBoutiqueConf = this.m_HotSaleListView[srcWidgetIndexInBelongedList];

        DebugHelper.Assert(resBoutiqueConf != null, "hot sale cfg is null");
        if (resBoutiqueConf == null)
        {
            return;
        }
        switch (resBoutiqueConf.wItemType)
        {
        case 2:
        {
            CMallFactoryShopController.ShopProduct product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(resBoutiqueConf.dwItemID);

            CMallItem item = new CMallItem(product, CMallItem.IconType.Small);
            Singleton <CMallSystem> .GetInstance().SetMallItem(component, item);

            break;
        }

        case 4:
        {
            CMallItem item2 = new CMallItem(resBoutiqueConf.dwItemID, CMallItem.IconType.Small);
            Singleton <CMallSystem> .GetInstance().SetMallItem(component, item2);

            break;
        }

        case 7:
        {
            uint heroID = 0u;
            uint skinID = 0u;
            CSkinInfo.ResolveHeroSkin(resBoutiqueConf.dwItemID, out heroID, out skinID);
            CMallItem item3 = new CMallItem(heroID, skinID, CMallItem.IconType.Small);
            Singleton <CMallSystem> .GetInstance().SetMallItem(component, item3);

            break;
        }
        }
    }
예제 #10
0
        public void Init(HeroHeadHud hudOwner, PoolObjHandle <ActorRoot> myHero)
        {
            if (!myHero)
            {
                return;
            }
            this._hudOwner = hudOwner;
            this._myHero   = myHero;
            this.SetState(PlayerHead.HeadState.Normal);
            uint configId = (uint)myHero.handle.TheActorMeta.ConfigId;

            this.HeroHeadImg.SetSprite(CUIUtility.s_Sprite_Dynamic_BustCircle_Dir + CSkinInfo.GetHeroSkinPic(configId, 0u), Singleton <CBattleSystem> .GetInstance().FightFormScript, true, false, false, false);
            this.OnHeroHpChange(myHero.handle.ValueComponent.actorHp, myHero.handle.ValueComponent.actorHpTotal);
        }
    private void OnNewArrivalEnable(CUIEvent uiEvent)
    {
        int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;

        if (srcWidgetIndexInBelongedList < 0 || srcWidgetIndexInBelongedList >= this.m_NewArrivalListView.Count)
        {
            return;
        }
        GameObject srcWidget = uiEvent.m_srcWidget;

        if (srcWidget == null)
        {
            return;
        }
        CMallItemWidget component = srcWidget.GetComponent <CMallItemWidget>();

        if (component == null)
        {
            return;
        }
        ResBoutiqueConf resBoutiqueConf = this.m_NewArrivalListView[srcWidgetIndexInBelongedList];

        DebugHelper.Assert(resBoutiqueConf != null, "new arrival cfg is null");
        if (resBoutiqueConf == null)
        {
            return;
        }
        switch (resBoutiqueConf.wItemType)
        {
        case 4:
        {
            CMallItem item = new CMallItem(resBoutiqueConf.dwItemID, CMallItem.IconType.Normal);
            Singleton <CMallSystem> .GetInstance().SetMallItem(component, item);

            break;
        }

        case 7:
        {
            uint heroID = 0u;
            uint skinID = 0u;
            CSkinInfo.ResolveHeroSkin(resBoutiqueConf.dwItemID, out heroID, out skinID);
            CMallItem item2 = new CMallItem(heroID, skinID, CMallItem.IconType.Normal);
            Singleton <CMallSystem> .GetInstance().SetMallItem(component, item2);

            break;
        }
        }
    }
예제 #12
0
    public int GetActorMarkID(ActorMeta actorMeta)
    {
        int skinCfgId = 0;
        IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

        ActorServerData actorData = new ActorServerData();

        if ((actorDataProvider != null) && actorDataProvider.GetActorServerData(ref actorMeta, ref actorData))
        {
            int skinId = (int)actorData.SkinId;
            if (skinId != 0)
            {
                skinCfgId = (int)CSkinInfo.GetSkinCfgId((uint)actorMeta.ConfigId, (uint)skinId);
            }
        }
        return(skinCfgId);
    }
예제 #13
0
 public CMallItem(uint heroID, uint skinID, IconType iconType = 0)
 {
     this.m_type     = ItemType.Skin;
     this.m_iconType = iconType;
     this.m_heroData = CHeroDataFactory.CreateHeroData(heroID);
     this.m_skinData = CSkinInfo.GetHeroSkin(heroID, skinID);
     if ((this.m_heroData != null) && (this.m_skinData != null))
     {
         this.m_firstName  = this.m_heroData.heroName;
         this.m_secondName = this.m_skinData.szSkinName;
         if (iconType == IconType.Small)
         {
             this.m_useable = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN, this.m_skinData.dwID, 1);
             if (this.m_useable != null)
             {
                 this.m_iconPath = this.m_useable.GetIconPath();
             }
             else
             {
                 this.m_iconPath = null;
             }
         }
         else
         {
             this.m_iconPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + this.m_skinData.szSkinPicID;
         }
         ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(heroID, skinID);
         this.m_payInfoSet = CMallSystem.GetPayInfoSetOfGood(this.m_skinData, skinPromotion);
     }
     else
     {
         this.m_useable    = null;
         this.m_firstName  = null;
         this.m_secondName = null;
         this.m_iconPath   = null;
         this.m_payInfoSet = new stPayInfoSet();
     }
 }
예제 #14
0
 public CMallItem(uint heroID, uint skinID, CMallItem.IconType iconType = CMallItem.IconType.Normal)
 {
     this.m_type     = CMallItem.ItemType.Skin;
     this.m_iconType = iconType;
     this.m_heroData = CHeroDataFactory.CreateHeroData(heroID);
     this.m_skinData = CSkinInfo.GetHeroSkin(heroID, skinID);
     if (this.m_heroData != null && this.m_skinData != null)
     {
         this.m_firstName  = this.m_heroData.heroName;
         this.m_secondName = this.m_skinData.szSkinName;
         if (iconType == CMallItem.IconType.Small)
         {
             this.m_useable = CUseableManager.CreateUseable(7, this.m_skinData.dwID, 1);
             if (this.m_useable != null)
             {
                 this.m_iconPath = this.m_useable.GetIconPath();
             }
             else
             {
                 this.m_iconPath = null;
             }
         }
         else
         {
             this.m_iconPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + this.m_skinData.szSkinPicID;
         }
         ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(heroID, skinID);
         this.m_payInfoSet = CMallSystem.GetPayInfoSetOfGood(this.m_skinData, skinPromotion);
     }
     else
     {
         this.m_useable    = null;
         this.m_firstName  = null;
         this.m_secondName = null;
         this.m_iconPath   = null;
         this.m_payInfoSet = default(stPayInfoSet);
     }
 }
예제 #15
0
        public void SetSkinProp(uint heroId, uint skinId, bool bWear)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            DebugHelper.Assert(heroSkin != null, "Skin==null");
            for (int i = 0; i < 15; i++)
            {
                ushort wType    = heroSkin.astAttr[i].wType;
                byte   bValType = heroSkin.astAttr[i].bValType;
                int    iValue   = heroSkin.astAttr[i].iValue;
                if (wType != 0 && iValue != 0)
                {
                    if (bWear)
                    {
                        this.ChangeFuncEft(wType, bValType, iValue, true);
                    }
                    else
                    {
                        this.ChangeFuncEft(wType, bValType, -iValue, true);
                    }
                }
            }
        }
예제 #16
0
        public override void Fight()
        {
            base.Fight();
            if (ActorHelper.IsCaptainActor(ref this.actorPtr))
            {
                this.m_isControledByMan = true;
                this.m_isAutoAI         = false;
            }
            else
            {
                this.m_isControledByMan = false;
                this.m_isAutoAI         = true;
            }
            IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

            ActorServerData actorServerData = default(ActorServerData);

            if (actorDataProvider != null && actorDataProvider.GetActorServerData(ref this.actor.TheActorMeta, ref actorServerData))
            {
                this.m_skinId    = actorServerData.SkinId;
                this.m_skinCfgId = CSkinInfo.GetSkinCfgId((uint)this.actor.TheActorMeta.ConfigId, this.m_skinId);
                if (this.m_skinId != 0u)
                {
                    ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)this.actor.TheActorMeta.ConfigId, this.m_skinId);
                    if (heroSkin != null && !string.IsNullOrEmpty(heroSkin.szSoundSwitchEvent))
                    {
                        Singleton <CSoundManager> .instance.PostEvent(heroSkin.szSoundSwitchEvent, this.actor.gameObject);
                    }
                }
            }
            this.SetSkillEffectPath();
            base.EnableRVO(false);
            if (this.actor.HorizonMarker != null && FogOfWar.enable)
            {
                this.actor.HorizonMarker.SightRadius = Horizon.QueryGlobalSight();
            }
        }
예제 #17
0
    private bool RefreshData()
    {
        this.m_HotSaleListView.Clear();
        this.m_NewArrivalListView.Clear();
        DictionaryView <uint, ResBoutiqueConf> .Enumerator enumerator = GameDataMgr.boutiqueDict.GetEnumerator();
        int currentUTCTime = CRoleInfo.GetCurrentUTCTime();

        while (enumerator.MoveNext())
        {
            ListView <ResBoutiqueConf> newArrivalListView;
            ResHeroCfgInfo             dataByKey;
            ResHeroSkin    heroSkin;
            ResHeroCfgInfo info2;
            KeyValuePair <uint, ResBoutiqueConf> current = enumerator.Current;
            ResBoutiqueConf item = current.Value;
            if ((item.dwOnTimeGen <= currentUTCTime) && (item.dwOffTimeGen >= currentUTCTime))
            {
                RES_BOUTIQUE_TYPE bBoutiqueType = (RES_BOUTIQUE_TYPE)item.bBoutiqueType;
                newArrivalListView = null;
                switch (bBoutiqueType)
                {
                case RES_BOUTIQUE_TYPE.RES_BOUTIQUE_TYPE_NEW_ARRIVAL:
                    newArrivalListView = this.m_NewArrivalListView;
                    break;

                case RES_BOUTIQUE_TYPE.RES_BOUTIQUE_TYPE_HOT_SALE:
                    newArrivalListView = this.m_HotSaleListView;
                    break;
                }
                switch (item.wItemType)
                {
                case 2:
                case 5:
                {
                    CMallFactoryShopController.ShopProduct product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(item.dwItemID);

                    if (((product != null) && (product.IsOnSale == 1)) && (newArrivalListView != null))
                    {
                        newArrivalListView.Add(item);
                    }
                    break;
                }

                case 4:
                    dataByKey = GameDataMgr.heroDatabin.GetDataByKey(item.dwItemID);
                    if (dataByKey != null)
                    {
                        goto Label_011F;
                    }
                    break;

                case 7:
                    heroSkin = CSkinInfo.GetHeroSkin(item.dwItemID);
                    if (heroSkin != null)
                    {
                        goto Label_015D;
                    }
                    break;
                }
            }
            continue;
Label_011F:
            if (GameDataMgr.IsHeroAvailable(dataByKey.dwCfgID) && (newArrivalListView != null))
            {
                newArrivalListView.Add(item);
            }
            continue;
Label_015D:
            info2 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID);
            if ((info2 != null) && ((GameDataMgr.IsSkinAvailable(heroSkin.dwID) && GameDataMgr.IsHeroAvailable(info2.dwCfgID)) && (newArrivalListView != null)))
            {
                newArrivalListView.Add(item);
            }
        }
        return(true);
    }
    private void Draw(CMail mail)
    {
        if (this.form != null)
        {
            Text componetInChild  = Utility.GetComponetInChild <Text>(this.form.gameObject, "Panel/msgContainer/name");
            Text componetInChild2 = Utility.GetComponetInChild <Text>(this.form.gameObject, "Panel/msgContainer/msg");
            Text componetInChild3 = Utility.GetComponetInChild <Text>(this.form.gameObject, "Panel/msgContainer/from");
            if (componetInChild == null || componetInChild2 == null || componetInChild3 == null)
            {
                return;
            }
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                DebugHelper.Assert(false, "Master Role Info is null");
                return;
            }
            componetInChild.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Mail_Ask_For_Myself"), masterRoleInfo.Name));
            componetInChild2.set_text(mail.mailContent);
            componetInChild3.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Mail_Ask_For_From", new string[]
            {
                mail.from
            }), new object[0]));
            if (mail.accessUseable == null || mail.accessUseable.Count == 0)
            {
                return;
            }
            CUseable cUseable = mail.accessUseable[0];
            switch (cUseable.m_type)
            {
            case COM_ITEM_TYPE.COM_OBJTYPE_HERO:
            {
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(cUseable.m_baseID);
                DebugHelper.Assert(dataByKey != null);
                if (dataByKey != null)
                {
                    Text component = this.form.transform.Find("Panel/Title/titleText").GetComponent <Text>();
                    component.set_text(Singleton <CTextManager> .GetInstance().GetText("Ask_For_Hero_Friend_Title"));
                    Text component2 = this.form.transform.Find("Panel/skinBgImage/skinNameText").GetComponent <Text>();
                    component2.set_text(StringHelper.UTF8BytesToString(ref dataByKey.szName));
                    Image component3 = this.form.transform.Find("Panel/skinBgImage/skinIconImage").GetComponent <Image>();
                    component3.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), this.form, false, true, true, true);
                    this.form.transform.Find("Panel/Panel_Prop").gameObject.CustomSetActive(false);
                    Transform transform = this.form.transform.Find("Panel/skinPricePanel");
                    Transform costIcon  = transform.Find("costImage");
                    CHeroSkinBuyManager.SetPayCostIcon(this.form, costIcon, enPayType.DianQuan);
                    Transform costTypeText = transform.Find("costTypeText");
                    CHeroSkinBuyManager.SetPayCostTypeText(costTypeText, enPayType.DianQuan);
                    uint             payValue         = 0u;
                    IHeroData        heroData         = CHeroDataFactory.CreateHeroData(cUseable.m_baseID);
                    ResHeroPromotion resPromotion     = heroData.promotion();
                    stPayInfoSet     payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(dataByKey, resPromotion);
                    for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
                    {
                        if (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan)
                        {
                            payValue = payInfoSetOfGood.m_payInfos[i].m_payValue;
                            break;
                        }
                    }
                    Transform transform2 = transform.Find("costPanel");
                    if (transform2)
                    {
                        Transform currentPrice = transform2.Find("costText");
                        CHeroSkinBuyManager.SetPayCurrentPrice(currentPrice, payValue);
                    }
                }
                break;
            }

            case COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN:
            {
                uint heroId = 0u;
                uint skinId = 0u;
                CSkinInfo.ResolveHeroSkin(cUseable.m_baseID, out heroId, out skinId);
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(cUseable.m_baseID);
                DebugHelper.Assert(heroSkin != null, "heroSkin is null");
                if (heroSkin != null)
                {
                    Text component4 = this.form.transform.Find("Panel/Title/titleText").GetComponent <Text>();
                    component4.set_text(Singleton <CTextManager> .GetInstance().GetText("Ask_For_Skin_Friend_Title"));
                    Image  component5 = this.form.transform.Find("Panel/skinBgImage/skinIconImage").GetComponent <Image>();
                    string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, StringHelper.UTF8BytesToString(ref heroSkin.szSkinPicID));
                    component5.SetSprite(prefabPath, this.form, false, true, true, true);
                    Text component6 = this.form.transform.Find("Panel/skinBgImage/skinNameText").GetComponent <Text>();
                    component6.set_text(StringHelper.UTF8BytesToString(ref heroSkin.szSkinName));
                    this.form.transform.Find("Panel/Panel_Prop").gameObject.CustomSetActive(true);
                    GameObject gameObject = this.form.transform.Find("Panel/Panel_Prop/List_Prop").gameObject;
                    CSkinInfo.GetHeroSkinProp(heroId, skinId, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr, ref CHeroInfoSystem2.s_propImgArr);
                    CUICommonSystem.SetListProp(gameObject, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr);
                    Transform transform3 = this.form.transform.Find("Panel/skinPricePanel");
                    Transform costIcon2  = transform3.Find("costImage");
                    CHeroSkinBuyManager.SetPayCostIcon(this.form, costIcon2, enPayType.DianQuan);
                    Transform costTypeText2 = transform3.Find("costTypeText");
                    CHeroSkinBuyManager.SetPayCostTypeText(costTypeText2, enPayType.DianQuan);
                    uint         payValue2      = 0u;
                    stPayInfoSet skinPayInfoSet = CSkinInfo.GetSkinPayInfoSet(heroId, skinId);
                    for (int j = 0; j < skinPayInfoSet.m_payInfoCount; j++)
                    {
                        if (skinPayInfoSet.m_payInfos[j].m_payType == enPayType.Diamond || skinPayInfoSet.m_payInfos[j].m_payType == enPayType.DianQuan || skinPayInfoSet.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan)
                        {
                            payValue2 = skinPayInfoSet.m_payInfos[j].m_payValue;
                            break;
                        }
                    }
                    Transform transform4 = transform3.Find("costPanel");
                    if (transform4 != null)
                    {
                        Transform currentPrice2 = transform4.Find("costText");
                        CHeroSkinBuyManager.SetPayCurrentPrice(currentPrice2, payValue2);
                    }
                }
                break;
            }
            }
        }
    }
    private bool RefreshData()
    {
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

        DebugHelper.Assert(masterRoleInfo != null, "Owned::Master Role Info Is Null");
        this.m_HotSaleListView.Clear();
        this.m_NewArrivalListView.Clear();
        DictionaryView <uint, ResBoutiqueConf> .Enumerator enumerator = GameDataMgr.boutiqueDict.GetEnumerator();
        int currentUTCTime = CRoleInfo.GetCurrentUTCTime();

        while (enumerator.MoveNext())
        {
            KeyValuePair <uint, ResBoutiqueConf> current = enumerator.Current;
            ResBoutiqueConf value = current.get_Value();
            if ((ulong)value.dwOnTimeGen <= (ulong)((long)currentUTCTime) && (ulong)value.dwOffTimeGen >= (ulong)((long)currentUTCTime))
            {
                RES_BOUTIQUE_TYPE          bBoutiqueType     = (RES_BOUTIQUE_TYPE)value.bBoutiqueType;
                ListView <ResBoutiqueConf> listView          = null;
                RES_BOUTIQUE_TYPE          rES_BOUTIQUE_TYPE = bBoutiqueType;
                if (rES_BOUTIQUE_TYPE != RES_BOUTIQUE_TYPE.RES_BOUTIQUE_TYPE_NEW_ARRIVAL)
                {
                    if (rES_BOUTIQUE_TYPE == RES_BOUTIQUE_TYPE.RES_BOUTIQUE_TYPE_HOT_SALE)
                    {
                        listView = this.m_HotSaleListView;
                    }
                }
                else
                {
                    listView = this.m_NewArrivalListView;
                }
                switch (value.wItemType)
                {
                case 2:
                case 5:
                {
                    CMallFactoryShopController.ShopProduct product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(value.dwItemID);

                    if (product != null && product.IsOnSale == 1 && listView != null)
                    {
                        listView.Add(value);
                    }
                    break;
                }

                case 4:
                {
                    ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(value.dwItemID);
                    if (dataByKey != null && GameDataMgr.IsHeroAvailable(dataByKey.dwCfgID) && listView != null)
                    {
                        listView.Add(value);
                    }
                    break;
                }

                case 7:
                {
                    ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(value.dwItemID);
                    if (heroSkin != null)
                    {
                        ResHeroCfgInfo dataByKey2 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID);
                        if (dataByKey2 != null)
                        {
                            bool flag = true;
                            if (masterRoleInfo != null)
                            {
                                flag = masterRoleInfo.IsHaveHeroSkin(heroSkin.dwHeroID, heroSkin.dwSkinID, false);
                            }
                            if (GameDataMgr.IsSkinAvailable(heroSkin.dwID) && !flag && GameDataMgr.IsHeroAvailable(dataByKey2.dwCfgID) && listView != null)
                            {
                                listView.Add(value);
                            }
                        }
                    }
                    break;
                }
                }
            }
        }
        return(true);
    }
    private bool RefreshData()
    {
        this.m_HotSaleListView.Clear();
        this.m_NewArrivalListView.Clear();
        DictionaryView <uint, ResBoutiqueConf> .Enumerator enumerator = GameDataMgr.boutiqueDict.GetEnumerator();
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

        if (masterRoleInfo == null)
        {
            DebugHelper.Assert(false, "Master RoleInfo is null");
            return(false);
        }
        int num = masterRoleInfo.getCurrentTimeSinceLogin();

        while (enumerator.MoveNext())
        {
            ListView <ResBoutiqueConf> newArrivalListView;
            ResHeroCfgInfo             dataByKey;
            ResHeroSkin    heroSkin;
            ResHeroCfgInfo info3;
            KeyValuePair <uint, ResBoutiqueConf> current = enumerator.Current;
            ResBoutiqueConf item = current.Value;
            if ((item.dwOnTimeGen <= num) && (item.dwOffTimeGen >= num))
            {
                RES_BOUTIQUE_TYPE bBoutiqueType = (RES_BOUTIQUE_TYPE)item.bBoutiqueType;
                newArrivalListView = null;
                switch (bBoutiqueType)
                {
                case RES_BOUTIQUE_TYPE.RES_BOUTIQUE_TYPE_NEW_ARRIVAL:
                    newArrivalListView = this.m_NewArrivalListView;
                    break;

                case RES_BOUTIQUE_TYPE.RES_BOUTIQUE_TYPE_HOT_SALE:
                    newArrivalListView = this.m_HotSaleListView;
                    break;
                }
                switch (item.wItemType)
                {
                case 2:
                case 5:
                {
                    CMallFactoryShopController.ShopProduct product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(item.dwItemID);

                    if (((product != null) && product.IsOnSale) && (newArrivalListView != null))
                    {
                        newArrivalListView.Add(item);
                    }
                    break;
                }

                case 4:
                    dataByKey = GameDataMgr.heroDatabin.GetDataByKey(item.dwItemID);
                    if (dataByKey != null)
                    {
                        goto Label_013F;
                    }
                    break;

                case 7:
                    heroSkin = CSkinInfo.GetHeroSkin(item.dwItemID);
                    if (heroSkin != null)
                    {
                        goto Label_0179;
                    }
                    break;
                }
            }
            continue;
Label_013F:
            if ((dataByKey.bIsPlayerUse > 0) && (newArrivalListView != null))
            {
                newArrivalListView.Add(item);
            }
            continue;
Label_0179:
            info3 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID);
            if ((info3 != null) && (((heroSkin.bIsShow > 0) && (info3.bIsPlayerUse > 0)) && (newArrivalListView != null)))
            {
                newArrivalListView.Add(item);
            }
        }
        return(true);
    }
예제 #21
0
    private bool RefreshData()
    {
        this.m_HotSaleListView.Clear();
        this.m_NewArrivalListView.Clear();
        DictionaryView <uint, ResBoutiqueConf> .Enumerator enumerator = GameDataMgr.boutiqueDict.GetEnumerator();
        int currentUTCTime = CRoleInfo.GetCurrentUTCTime();

        while (enumerator.MoveNext())
        {
            KeyValuePair <uint, ResBoutiqueConf> current = enumerator.get_Current();
            ResBoutiqueConf value = current.get_Value();
            if ((ulong)value.dwOnTimeGen <= (ulong)((long)currentUTCTime) && (ulong)value.dwOffTimeGen >= (ulong)((long)currentUTCTime))
            {
                RES_BOUTIQUE_TYPE          bBoutiqueType     = value.bBoutiqueType;
                ListView <ResBoutiqueConf> listView          = null;
                RES_BOUTIQUE_TYPE          rES_BOUTIQUE_TYPE = bBoutiqueType;
                if (rES_BOUTIQUE_TYPE != 1)
                {
                    if (rES_BOUTIQUE_TYPE == 2)
                    {
                        listView = this.m_HotSaleListView;
                    }
                }
                else
                {
                    listView = this.m_NewArrivalListView;
                }
                switch (value.wItemType)
                {
                case 2:
                case 5:
                {
                    CMallFactoryShopController.ShopProduct product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(value.dwItemID);

                    if (product != null && product.IsOnSale == 1 && listView != null)
                    {
                        listView.Add(value);
                    }
                    break;
                }

                case 4:
                {
                    ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(value.dwItemID);
                    if (dataByKey != null)
                    {
                        if (GameDataMgr.IsHeroAvailable(dataByKey.dwCfgID) && listView != null)
                        {
                            listView.Add(value);
                        }
                    }
                    break;
                }

                case 7:
                {
                    ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(value.dwItemID);
                    if (heroSkin != null)
                    {
                        ResHeroCfgInfo dataByKey2 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID);
                        if (dataByKey2 != null)
                        {
                            if (GameDataMgr.IsSkinAvailable(heroSkin.dwID) && GameDataMgr.IsHeroAvailable(dataByKey2.dwCfgID) && listView != null)
                            {
                                listView.Add(value);
                            }
                        }
                    }
                    break;
                }
                }
            }
        }
        return(true);
    }