private void Awake()
        {
            this.listItemID    = new List <int>();
            this.dicComs       = new Dictionary <int, Activity_activityMenu>();
            this.dicNoticeData = new Dictionary <int, NoticeBoardData>();
            Dictionary <string, object> dicByType = BaseDataMgr.instance.GetDicByType <SysActivityVo>();

            this.config = new Dictionary <int, SysActivityVo>();
            DateTime serverCurrentTime = ToolsFacade.ServerCurrentTime;

            foreach (KeyValuePair <string, object> current in dicByType)
            {
                SysActivityVo sysActivityVo = current.Value as SysActivityVo;
                if (sysActivityVo != null)
                {
                    DateTime dateTime  = ActivityTools.GetDateTime(sysActivityVo.show_start_time, true);
                    DateTime dateTime2 = ActivityTools.GetDateTime(sysActivityVo.show_end_time, false);
                    if (string.IsNullOrEmpty(sysActivityVo.show_start_time) || !(serverCurrentTime < dateTime))
                    {
                        if (string.IsNullOrEmpty(sysActivityVo.show_end_time) || !(serverCurrentTime > dateTime2))
                        {
                            this.config.Add(int.Parse(current.Key), sysActivityVo);
                        }
                    }
                }
            }
            if (this.config == null)
            {
                this.valid = false;
                ClientLogger.Error("SysActivityVo 读取失败");
            }
        }
Beispiel #2
0
        public static void RefreshBannerActivityList()
        {
            Dictionary <string, SysActivityVo> typeDicByType = BaseDataMgr.instance.GetTypeDicByType <SysActivityVo>();

            ActivityTools.listBannerActivity = new List <BannerInfo>();
            foreach (KeyValuePair <string, SysActivityVo> current in typeDicByType)
            {
                if (current.Value.banner_type == 1)
                {
                    if (!string.IsNullOrEmpty(current.Value.module))
                    {
                        DateTime serverCurrentTime = ToolsFacade.ServerCurrentTime;
                        DateTime dateTime          = ActivityTools.GetDateTime(current.Value.show_end_time, false);
                        DateTime dateTime2         = ActivityTools.GetDateTime(current.Value.show_start_time, true);
                        if (!(serverCurrentTime > dateTime) && !(serverCurrentTime < dateTime2))
                        {
                            string[] array = current.Value.module.Split(new char[]
                            {
                                ','
                            });
                            SysActivityModuleVo sysActivityModuleVo = null;
                            for (int i = 0; i < array.Length; i++)
                            {
                                SysActivityModuleVo dataById = BaseDataMgr.instance.GetDataById <SysActivityModuleVo>(array[i]);
                                if (dataById != null)
                                {
                                    if (dataById.type == 3)
                                    {
                                        sysActivityModuleVo = dataById;
                                        break;
                                    }
                                }
                            }
                            if (sysActivityModuleVo != null)
                            {
                                BannerInfo item = new BannerInfo
                                {
                                    activityConfig  = current.Value,
                                    showEndTime     = dateTime,
                                    id              = current.Value.id,
                                    picModuleConfig = sysActivityModuleVo
                                };
                                ActivityTools.listBannerActivity.Add(item);
                            }
                        }
                    }
                }
            }
            ActivityTools.listBannerActivity.Sort(new Comparison <BannerInfo>(ActivityTools.Comparision_SysActivityVo));
            if (ActivityTools.listBannerActivity.Count > 0 && ActivityTools.listBannerActivity.Count < 4)
            {
                int num = 0;
                do
                {
                    ActivityTools.listBannerActivity.Add(ActivityTools.listBannerActivity[num++]);
                }while (ActivityTools.listBannerActivity.Count < 4);
            }
        }
 private void Awake()
 {
     this.info = ActivityTools.GetBannerActivityByID(this.id - 1);
     if (this.info != null)
     {
         UIEventListener.Get(this.downTex.uiTex.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickBannerItem);
         this.bannerName.text = LanguageManager.Instance.GetStringById(this.info.activityConfig.banner_title);
         this.CheckTexUrl();
     }
 }
Beispiel #4
0
 public static BannerInfo GetBannerActivityByID(int id)
 {
     if (ActivityTools.listBannerActivity == null)
     {
         ActivityTools.RefreshBannerActivityList();
     }
     if (ActivityTools.listBannerActivity != null && id >= 0 && id < ActivityTools.listBannerActivity.Count)
     {
         return(ActivityTools.listBannerActivity[id]);
     }
     return(null);
 }
        private void UpdatePortraitFrame(List <SysSummonersPictureframeVo> Lst)
        {
            bool isOwn      = true;
            bool isNew      = true;
            bool isVisiable = true;

            GridHelper.FillGrid <ChangeAvatarItem>(this.CenterGrid, this._avatarItem, Lst.Count, delegate(int idx, ChangeAvatarItem comp)
            {
                if (this.FrameStateLst.Find((string[] item) => item[0] == Lst[idx].pictureframe_id.ToString()) != null)
                {
                    isOwn          = true;
                    string[] array = this.FrameStateLst.Find((string[] item) => item[0] == Lst[idx].pictureframe_id.ToString());
                    if (array[1] == "0")
                    {
                        isNew = false;
                    }
                    else
                    {
                        isNew = true;
                    }
                }
                else
                {
                    isOwn = false;
                    isNew = false;
                }
                if (Lst[idx].pictureframe_classify == 3)
                {
                    string[] array2 = Lst[idx].pictureframe_skip.Split(new char[]
                    {
                        '|'
                    });
                    if (array2 != null && array2.Length == 3)
                    {
                        string unikey          = array2[1];
                        SysActivityVo dataById = BaseDataMgr.instance.GetDataById <SysActivityVo>(unikey);
                        DateTime dateTime      = ActivityTools.GetDateTime(dataById.start_time, true);
                        DateTime dateTime2     = ActivityTools.GetDateTime(dataById.end_time, true);
                        isVisiable             = ToolsFacade.Instance.IsInTimeInterval(dateTime, dateTime2);
                    }
                }
                if ((Lst[idx].is_hidden == 1 && isVisiable) || isOwn)
                {
                    comp.UpdateAvatarItem(Lst[idx], isOwn, isNew);
                    comp.transform.name = Lst[idx].pictureframe_id.ToString();
                    comp.transform.gameObject.SetActive(true);
                    if (Lst[idx].pictureframe_id.ToString() == this.selectPortraitName)
                    {
                        comp.transform.Find("Click").gameObject.SetActive(true);
                    }
                    else
                    {
                        comp.transform.Find("Click").gameObject.SetActive(false);
                    }
                }
                else
                {
                    comp.gameObject.SetActive(false);
                }
            });
            this.CenterGrid.Reposition();
        }