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;
        }
        }
    }
    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;
        }
        }
    }
Пример #3
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 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);
    }
    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);
    }
Пример #6
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);
    }