Example #1
0
        private void BannerImage_OnClickItem(CUIEvent uiEvent)
        {
            if (this.m_BannerImage == null || uiEvent.m_srcWidgetBelongedListScript != this.m_UIListScript)
            {
                return;
            }
            if (this.m_AllLoadImageInfo == null)
            {
                return;
            }
            int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;
            int num = this.m_AllLoadImageInfo.Length;

            if (srcWidgetIndexInBelongedList >= num)
            {
                return;
            }
            BannerImageSys.BannerImageInfo bannerImageInfo = this.m_AllLoadImageInfo[srcWidgetIndexInBelongedList];
            if (bannerImageInfo != null)
            {
                if (bannerImageInfo.resImgInfo.dwBannerType == 1u)
                {
                    CUICommonSystem.OpenUrl(bannerImageInfo.resImgInfo.szHttpUrl, true, 0);
                }
                else if (bannerImageInfo.resImgInfo.dwBannerType == 2u)
                {
                    CUICommonSystem.JumpForm(bannerImageInfo.resImgInfo.dwJumpEntrance, bannerImageInfo.resImgInfo.iTargetID, bannerImageInfo.resImgInfo.iTargetID2);
                }
            }
        }
 public static int ComparebyShowIdx(BannerImageSys.BannerImageInfo info1, BannerImageSys.BannerImageInfo info2)
 {
     if (info1.resImgInfo.dwShowID > info2.resImgInfo.dwShowID)
     {
         return(1);
     }
     if (info1.resImgInfo.dwShowID == info2.resImgInfo.dwShowID)
     {
         return(0);
     }
     return(-1);
 }
Example #3
0
        public bool InitSys()
        {
            this.m_BannerImage = MonoSingleton <BannerImageSys> .GetInstance().GetCurBannerImage();

            if (this.m_BannerImage == null)
            {
                return(false);
            }
            long num  = (long)CRoleInfo.GetCurrentUTCTime();
            int  num2 = 0;
            ListView <BannerImageSys.BannerImageInfo> listView = new ListView <BannerImageSys.BannerImageInfo>();

            for (int i = 0; i < this.m_BannerImage.ImageListCount; i++)
            {
                BannerImageSys.BannerImageInfo bannerImageInfo = this.m_BannerImage.m_ImageInfoList[i];
                if (bannerImageInfo != null && bannerImageInfo.imgLoadSucc && this.checkImageType((BannerImageSys.BannerType)bannerImageInfo.resImgInfo.dwBannerType) && bannerImageInfo.resImgInfo.dwLocation == (uint)this.m_DisplayPosition && (ulong)bannerImageInfo.resImgInfo.dwStartTime < (ulong)num && (ulong)bannerImageInfo.resImgInfo.dwEndTime >= (ulong)num)
                {
                    listView.Add(bannerImageInfo);
                    num2++;
                }
            }
            if (num2 > 0)
            {
                if (listView != null)
                {
                    this.m_AllLoadImageInfo = new BannerImageSys.BannerImageInfo[listView.get_Count()];
                    for (int j = 0; j < listView.get_Count(); j++)
                    {
                        this.m_AllLoadImageInfo[j] = listView.get_Item(j);
                    }
                }
                Array.Sort <BannerImageSys.BannerImageInfo>(this.m_AllLoadImageInfo, new Comparison <BannerImageSys.BannerImageInfo>(BannerImageSys.ComparebyShowIdx));
                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_HoldStart, new CUIEventManager.OnUIEventHandler(this.OnHoldStart_Item));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_HoldEnd, new CUIEventManager.OnUIEventHandler(this.OnHoldEnd_Item));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_ClickItem, new CUIEventManager.OnUIEventHandler(this.BannerImage_OnClickItem));

                CUIStepListScript uIListScript = this.m_UIListScript;
                uIListScript.SetDontUpdate(true);
                uIListScript.SetElementAmount(num2);
                this.m_PickIdxList = new int[num2];
                this.InitPickObjElement(num2);
                this.EnablePickObj(0);
                this.LoadBannerImage();
                this.m_bUpdateStart = true;
                this.m_fBeginTime   = Time.time;
                return(true);
            }
            Debug.Log("not valide bannerImage");
            return(false);
        }
Example #4
0
        public bool InitSys()
        {
            this.m_BannerImage = MonoSingleton <BannerImageSys> .GetInstance().GetCurBannerImage();

            if (this.m_BannerImage != null)
            {
                long currentUTCTime = CRoleInfo.GetCurrentUTCTime();
                int  amount         = 0;
                ListView <BannerImageSys.BannerImageInfo> view = new ListView <BannerImageSys.BannerImageInfo>();
                for (int i = 0; i < this.m_BannerImage.ImageListCount; i++)
                {
                    BannerImageSys.BannerImageInfo item = this.m_BannerImage.m_ImageInfoList[i];
                    if ((((item != null) && item.imgLoadSucc) && (this.checkImageType((BannerImageSys.BannerType)item.resImgInfo.dwBannerType) && (((BannerImageSys.BannerPosition)item.resImgInfo.dwLocation) == this.m_DisplayPosition))) && ((item.resImgInfo.dwStartTime < currentUTCTime) && (item.resImgInfo.dwEndTime >= currentUTCTime)))
                    {
                        view.Add(item);
                        amount++;
                    }
                }
                if (amount > 0)
                {
                    if (view != null)
                    {
                        this.m_AllLoadImageInfo = new BannerImageSys.BannerImageInfo[view.Count];
                        for (int j = 0; j < view.Count; j++)
                        {
                            this.m_AllLoadImageInfo[j] = view[j];
                        }
                    }
                    Array.Sort <BannerImageSys.BannerImageInfo>(this.m_AllLoadImageInfo, new Comparison <BannerImageSys.BannerImageInfo>(BannerImageSys.ComparebyShowIdx));
                    Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_HoldStart, new CUIEventManager.OnUIEventHandler(this.OnHoldStart_Item));

                    Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_HoldEnd, new CUIEventManager.OnUIEventHandler(this.OnHoldEnd_Item));

                    Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_ClickItem, new CUIEventManager.OnUIEventHandler(this.BannerImage_OnClickItem));

                    CUIStepListScript uIListScript = this.m_UIListScript;
                    uIListScript.SetDontUpdate(true);
                    uIListScript.SetElementAmount(amount);
                    this.m_PickIdxList = new int[amount];
                    this.InitPickObjElement(amount);
                    this.EnablePickObj(0);
                    this.LoadBannerImage();
                    this.m_bUpdateStart = true;
                    this.m_fBeginTime   = Time.time;
                    return(true);
                }
                Debug.Log("not valide bannerImage");
            }
            return(false);
        }
Example #5
0
 private void BannerImage_OnClickItem(CUIEvent uiEvent)
 {
     if (((this.m_BannerImage != null) && (uiEvent.m_srcWidgetBelongedListScript == this.m_UIListScript)) && (this.m_AllLoadImageInfo != null))
     {
         int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;
         int length = this.m_AllLoadImageInfo.Length;
         if (srcWidgetIndexInBelongedList < length)
         {
             BannerImageSys.BannerImageInfo info = this.m_AllLoadImageInfo[srcWidgetIndexInBelongedList];
             if (info != null)
             {
                 if (info.resImgInfo.dwBannerType == 1)
                 {
                     CUICommonSystem.OpenUrl(info.resImgInfo.szHttpUrl, true);
                 }
                 else if (info.resImgInfo.dwBannerType == 2)
                 {
                     CUICommonSystem.JumpForm((RES_GAME_ENTRANCE_TYPE)info.resImgInfo.dwJumpEntrance);
                 }
             }
         }
     }
 }
        private void PreloadBannerImage()
        {
            if (this.m_BannerImage == null)
            {
                return;
            }
            int imageListCount = this.m_BannerImage.ImageListCount;

            for (int i = 0; i < imageListCount; i++)
            {
                BannerImageSys.BannerImageInfo bannerImageInfo = this.m_BannerImage.m_ImageInfoList[i];
                if (bannerImageInfo != null)
                {
                    string text = bannerImageInfo.resImgInfo.szImgUrl;
                    if (this.isPreloadImageType((BannerImageSys.BannerType)bannerImageInfo.resImgInfo.dwBannerType))
                    {
                        this.m_BannerImage.m_ImageInfoList[i].imgLoadSucc = false;
                        text = string.Format("{0}{1}", BannerImageSys.GlobalLoadPath, text);
                        base.StartCoroutine(MonoSingleton <IDIPSys> .GetInstance().DownloadImageByTag(text, i, delegate(Texture2D text2, int imageIDX)
                        {
                            if (this.m_BannerImage != null && this.m_BannerImage.m_ImageInfoList != null && imageIDX < this.m_BannerImage.m_ImageInfoList.Length)
                            {
                                this.m_BannerImage.m_ImageInfoList[imageIDX].imgLoadSucc = true;
                            }
                        }, this.GlobalBannerImagePath, 0));
                    }
                    else if (bannerImageInfo.resImgInfo.dwBannerType == 3u)
                    {
                        this.m_DeepLinkInfo.linkType  = (int)bannerImageInfo.resImgInfo.dwJumpEntrance;
                        this.m_DeepLinkInfo.linkUrl   = bannerImageInfo.resImgInfo.szHttpUrl;
                        this.m_DeepLinkInfo.startTime = bannerImageInfo.resImgInfo.ullStartTime;
                        this.m_DeepLinkInfo.endTime   = bannerImageInfo.resImgInfo.ullEndTime;
                        this.m_DeepLinkInfo.bLoadSucc = true;
                    }
                    else if (bannerImageInfo.resImgInfo.dwBannerType == 7u)
                    {
                        this.m_QQBoxInfo.linkUrl   = bannerImageInfo.resImgInfo.szHttpUrl;
                        this.m_QQBoxInfo.startTime = bannerImageInfo.resImgInfo.ullStartTime;
                        this.m_QQBoxInfo.endTime   = bannerImageInfo.resImgInfo.ullEndTime;
                        this.m_QQBoxInfo.bLoadSucc = true;
                    }
                    else if (bannerImageInfo.resImgInfo.dwBannerType == 8u)
                    {
                        if (bannerImageInfo.resImgInfo.iTargetID > 0)
                        {
                            MonoSingleton <PandroaSys> .GetInstance().InitSys();
                        }
                    }
                    else if (bannerImageInfo.resImgInfo.dwBannerType == 13u)
                    {
                        this.ProcessNetACC(bannerImageInfo.resImgInfo);
                    }
                    else if (bannerImageInfo.resImgInfo.dwBannerType == 9u)
                    {
                        if (!string.IsNullOrEmpty(bannerImageInfo.resImgInfo.szHttpUrl) && Application.platform == RuntimePlatform.Android)
                        {
                            string   szHttpUrl = bannerImageInfo.resImgInfo.szHttpUrl;
                            string[] array     = szHttpUrl.Split(new char[]
                            {
                                ';'
                            });
                            if (array.Length > 0)
                            {
                                this.m_WaifaBlockPlatformChannel           = new BannerImageSys.WaiFaBlockPlatformChannel(array.Length);
                                this.m_WaifaBlockPlatformChannel.m_SrcInfo = szHttpUrl;
                                for (int j = 0; j < array.Length; j++)
                                {
                                    this.m_WaifaBlockPlatformChannel.m_ChannelList[j] = array[j];
                                }
                            }
                        }
                    }
                    else if (bannerImageInfo.resImgInfo.dwBannerType == 10u)
                    {
                        BannerImageSys.CDNUrl cDNUrl = default(BannerImageSys.CDNUrl);
                        cDNUrl.id  = bannerImageInfo.resImgInfo.dwID;
                        cDNUrl.url = bannerImageInfo.resImgInfo.szHttpUrl;
                        this.m_CDNUrlMgr.Add(cDNUrl);
                    }
                }
            }
        }