public void OnOpen(MeiRiMuBiao daily) { SystemOpen systemOpen = DataReader <SystemOpen> .Get(daily.sysId); string text = (systemOpen.level <= 0) ? string.Empty : (systemOpen.level + GameDataUtils.GetChineseContent(301042, false)); if (systemOpen.taskId > 0) { RenWuPeiZhi renWuPeiZhi = DataReader <RenWuPeiZhi> .Get(systemOpen.taskId); if (renWuPeiZhi != null) { text += string.Format(GameDataUtils.GetChineseContent(301043, false), GameDataUtils.GetChineseContent(renWuPeiZhi.dramaIntroduce, false)); } } this.mTxTitle.set_text(GameDataUtils.GetChineseContent(daily.introduction1, false)); string text2 = string.Format(GameDataUtils.GetChineseContent(301044, false), GameDataUtils.GetChineseContent(daily.introduction4, false)); text2 += string.Format(GameDataUtils.GetChineseContent(301045, false), GameDataUtils.GetChineseContent(daily.introduction1, false)); text2 += string.Format(GameDataUtils.GetChineseContent(301046, false), text); text2 += string.Format(GameDataUtils.GetChineseContent(301047, false), GameDataUtils.GetChineseContent(daily.introduction3, false)); this.mTxContent.set_text(text2); this.ClearRewards(); for (int i = 0; i < daily.rewardIntroductionIcon.get_Count(); i++) { this.CreateReward(daily.rewardIntroductionIcon.get_Item(i)); } }
private void SetDailyData(MeiRiMuBiao dailyData) { this.SetTypeVisable(true, this.mTask.count >= dailyData.completeTime); this.mTxDesc.set_text(string.Format(GameDataUtils.GetChineseContent(dailyData.introduction2, false), dailyData.completeTime, this.mTask.count, dailyData.completeTime)); this.mTxLiveness.set_text(string.Format(GameDataUtils.GetChineseContent(301048, false), Utils.SwitchChineseNumber((long)dailyData.vitality, 0))); SystemOpen systemOpen = DataReader <SystemOpen> .Get(dailyData.sysId); if (EntityWorld.Instance.EntSelf.Lv < systemOpen.level) { this.mGoGoto.get_gameObject().SetActive(false); this.mTxLvTips.get_transform().get_parent().get_gameObject().SetActive(true); this.mTxLvTips.set_text(string.Format(GameDataUtils.GetChineseContent(301034, false), systemOpen.level)); } else if (systemOpen.taskId > 0 && !MainTaskManager.Instance.IsFinishedTask(systemOpen.taskId)) { string text = GameDataUtils.GetChineseContent(301035, false); RenWuPeiZhi renWuPeiZhi = DataReader <RenWuPeiZhi> .Get(systemOpen.taskId); if (renWuPeiZhi != null) { text = string.Format(GameDataUtils.GetChineseContent(301036, false), GameDataUtils.GetChineseContent(renWuPeiZhi.dramaIntroduce, false)); } this.mGoGoto.get_gameObject().SetActive(false); this.mTxLvTips.get_transform().get_parent().get_gameObject().SetActive(true); this.mTxLvTips.set_text(text); } else if (dailyData.id == 12040 && !GuildManager.Instance.IsJoinInGuild()) { this.mGoGoto.get_gameObject().SetActive(false); this.mTxLvTips.get_transform().get_parent().get_gameObject().SetActive(true); this.mTxLvTips.set_text(GameDataUtils.GetChineseContent(301049, false)); } }
private void RefreshList() { bool flag = true; bool flag2 = false; bool flag3 = false; this.ClearAllList(); List <DailyTask> list = DailyTaskManager.Instance.SortDailyList(this.mCurTaskType); for (int i = 0; i < list.get_Count(); i++) { MeiRiMuBiao meiRiMuBiao = DataReader <MeiRiMuBiao> .Get(list.get_Item(i).taskId); if (meiRiMuBiao.Retrieve == 1) { SystemOpen systemOpen = DataReader <SystemOpen> .Get(meiRiMuBiao.sysId); flag3 = (EntityWorld.Instance.EntSelf.Lv >= systemOpen.level && MainTaskManager.Instance.IsFinishedTask(systemOpen.taskId)); } if (this.mCurTaskType == DailyTaskType.DAILY && meiRiMuBiao.activity == 2) { flag = false; this.CreateItem(list.get_Item(i), this.mCurTaskType); } else if (this.mCurTaskType == DailyTaskType.FIND && flag3 && list.get_Item(i).canFindTimes >= 0) { flag = false; this.CreateItem(list.get_Item(i), this.mCurTaskType); } else if (this.mCurTaskType == DailyTaskType.LIMIT && meiRiMuBiao.activity == 1) { flag = false; this.CreateItem(list.get_Item(i), this.mCurTaskType); } if (!flag2 && list.get_Item(i).canFindTimes > 0 && flag3) { flag2 = true; } } this.mTxTips.get_gameObject().SetActive(flag); if (flag) { this.mTxTips.set_text(GameDataUtils.GetChineseContent((this.mCurTaskType != DailyTaskType.DAILY) ? 300022 : 300023, false)); } this.mFindTaskPoint.SetActive(flag2); this.mLimitTaskPoint.SetActive(DailyTaskManager.Instance.HasLimitTaskOpen); }
private bool HasDailyTaskPoint() { DailyTaskManager.< HasDailyTaskPoint > c__AnonStoreyE6 <HasDailyTaskPoint> c__AnonStoreyE = new DailyTaskManager.< HasDailyTaskPoint > c__AnonStoreyE6(); int lv = EntityWorld.Instance.EntSelf.Lv; for (int k = 0; k < this.mDailyList.get_Count(); k++) { MeiRiMuBiao meiRiMuBiao = DataReader <MeiRiMuBiao> .Get(this.mDailyList.get_Item(k).taskId); if (meiRiMuBiao != null && meiRiMuBiao.Retrieve == 1) { SystemOpen systemOpen = DataReader <SystemOpen> .Get(meiRiMuBiao.sysId); if (systemOpen != null && lv >= systemOpen.level && MainTaskManager.Instance.IsFinishedTask(systemOpen.taskId) && this.mDailyList.get_Item(k).canFindTimes > 0) { return(true); } } }
private int SortDailyByPoint(DailyTask a, DailyTask b) { MeiRiMuBiao meiRiMuBiao = DataReader <MeiRiMuBiao> .Get(a.taskId); MeiRiMuBiao meiRiMuBiao2 = DataReader <MeiRiMuBiao> .Get(b.taskId); if (meiRiMuBiao == null || meiRiMuBiao2 == null) { return(0); } if (meiRiMuBiao.priority < meiRiMuBiao2.priority) { return(1); } if (meiRiMuBiao.priority > meiRiMuBiao2.priority) { return(-1); } return(0); }
public void SetData(DailyTask task, DailyTaskType type, bool isGoldBuy, Action <DailyTaskItem> clickCallBack = null) { this.mTask = task; this.mType = type; this.mEventHandler = clickCallBack; this.mDailyData = DataReader <MeiRiMuBiao> .Get(this.mTask.taskId); if (this.mDailyData != null) { if (this.mFxId > 0) { FXSpineManager.Instance.DeleteSpine(this.mFxId, true); this.mFxId = 0; } if (this.mDailyData.Retrieve == 1) { this.mFindData = DataReader <MZhaoHui> .Get(this.mTask.taskId); } ResourceManager.SetSprite(this.mIcon, GameDataUtils.GetIcon(this.mDailyData.iconId)); this.mTxName.set_text(GameDataUtils.GetChineseContent(this.mDailyData.introduction1, false)); switch (this.mType) { case DailyTaskType.DAILY: this.SetDailyData(this.mDailyData); break; case DailyTaskType.FIND: this.SetFindData(this.mFindData, isGoldBuy); break; case DailyTaskType.LIMIT: this.SetTimeData(this.mDailyData); break; } } }
public List <DailyTask> SortDailyList(DailyTaskType type) { if (EntityWorld.Instance.EntSelf == null) { return(null); } List <List <DailyTask> > list = new List <List <DailyTask> >(); for (int i = 0; i < 6; i++) { list.Add(new List <DailyTask>()); } int lv = EntityWorld.Instance.EntSelf.Lv; for (int j = 0; j < this.mDailyList.get_Count(); j++) { MeiRiMuBiao meiRiMuBiao = DataReader <MeiRiMuBiao> .Get(this.mDailyList.get_Item(j).taskId); if (meiRiMuBiao != null) { SystemOpen systemOpen = DataReader <SystemOpen> .Get(meiRiMuBiao.sysId); if (systemOpen != null) { switch (type) { case DailyTaskType.DAILY: case DailyTaskType.LIMIT: if (lv < systemOpen.level || (systemOpen.taskId > 0 && !MainTaskManager.Instance.IsFinishedTask(systemOpen.taskId))) { list.get_Item(0).Add(this.mDailyList.get_Item(j)); } else if (this.mDailyList.get_Item(j).count == meiRiMuBiao.completeTime) { if ((meiRiMuBiao.buyTime == 1 && this.IsCanBuy(meiRiMuBiao.system)) || meiRiMuBiao.buyTime == 3) { list.get_Item(2).Add(this.mDailyList.get_Item(j)); } else { list.get_Item(1).Add(this.mDailyList.get_Item(j)); } } else if ((meiRiMuBiao.id == 12030 || meiRiMuBiao.id == 12040 || meiRiMuBiao.id == 12050) && !GuildManager.Instance.IsJoinInGuild()) { list.get_Item(0).Add(this.mDailyList.get_Item(j)); } else if (this.mDailyList.get_Item(j).count < meiRiMuBiao.completeTime) { list.get_Item(3).Add(this.mDailyList.get_Item(j)); } break; case DailyTaskType.FIND: if (this.mDailyList.get_Item(j).canFindTimes == 0) { list.get_Item(4).Add(this.mDailyList.get_Item(j)); } else if (this.mDailyList.get_Item(j).canFindTimes > 0) { list.get_Item(5).Add(this.mDailyList.get_Item(j)); } break; } } else { list.get_Item(5).Add(this.mDailyList.get_Item(j)); } } } for (int k = 0; k < 6; k++) { list.get_Item(k).Sort(new Comparison <DailyTask>(this.SortDailyByPoint)); } List <DailyTask> list2 = new List <DailyTask>(); for (int l = 5; l >= 0; l--) { for (int m = list.get_Item(l).get_Count() - 1; m >= 0; m--) { list2.Add(list.get_Item(l).get_Item(m)); } } return(list2); }
private void SetTimeData(MeiRiMuBiao dailyData) { this.SetDailyData(dailyData); this.mTxLiveness.get_gameObject().SetActive(false); this.mGoGoto.SetActive(false); this.GuildWarOpen = false; int id = dailyData.id; if (id != 12030) { if (id != 12050) { this.CurrentLimit = this.GetActiveIdByDailyId(dailyData.id); HuoDongZhongXin huoDongZhongXin = DataReader <HuoDongZhongXin> .Get(this.CurrentLimit); if (huoDongZhongXin != null) { this.mTxDesc.set_text(GameDataUtils.GetChineseContent(513518, false) + " " + ActivityCenterManager.Instance.GetFormatOpenTime(huoDongZhongXin, true, true, "\n")); } if (!this.mTxLvTips.get_transform().get_parent().get_gameObject().get_activeSelf()) { ActiveCenterInfo activeCenterInfo = null; if (this.CurrentLimit > 0 && ActivityCenterManager.infoDict.TryGetValue(this.CurrentLimit, ref activeCenterInfo) && activeCenterInfo.status == ActiveCenterInfo.ActiveStatus.AS.Start) { this.ShowGotoButton(); } } } else if (!GuildManager.Instance.IsJoinInGuild()) { this.mTxLvTips.get_transform().get_parent().get_gameObject().SetActive(true); this.mTxLvTips.set_text(GameDataUtils.GetChineseContent(301049, false)); } else if (!this.mTxLvTips.get_transform().get_parent().get_gameObject().get_activeSelf()) { string[] guildWarOpenTime; if (GuildWarManager.Instance.GuildWarTimeStep >= GuildWarTimeStep.GWTS.HALF_MATCH2_END && GuildWarManager.Instance.GuildWarTimeStep < GuildWarTimeStep.GWTS.FINAL_MATCH_END) { guildWarOpenTime = GuildWarManager.Instance.GetGuildWarOpenTime(4); } else if (GuildWarManager.Instance.GuildWarTimeStep >= GuildWarTimeStep.GWTS.HALF_MATCH1_END && GuildWarManager.Instance.GuildWarTimeStep < GuildWarTimeStep.GWTS.HALF_MATCH2_END) { guildWarOpenTime = GuildWarManager.Instance.GetGuildWarOpenTime(3); } else { guildWarOpenTime = GuildWarManager.Instance.GetGuildWarOpenTime(2); } this.mTxDesc.set_text(string.Concat(new string[] { GameDataUtils.GetChineseContent(513518, false), " ", GameDataUtils.GetChineseContent(513518 + int.Parse(guildWarOpenTime[0]), false), "\n", guildWarOpenTime[1], "-", guildWarOpenTime[3] })); if (GuildWarManager.Instance.GuildWarTimeStep == GuildWarTimeStep.GWTS.HALF_MATCH2_BEG || GuildWarManager.Instance.GuildWarTimeStep == GuildWarTimeStep.GWTS.FINAL_MATCH_BEG || GuildWarManager.Instance.GuildWarTimeStep == GuildWarTimeStep.GWTS.HALF_MATCH1_BEG) { this.GuildWarOpen = true; this.ShowGotoButton(); } } } else if (!GuildManager.Instance.IsJoinInGuild()) { this.mTxLvTips.get_transform().get_parent().get_gameObject().SetActive(true); this.mTxLvTips.set_text(GameDataUtils.GetChineseContent(301049, false)); } else if (!this.mTxLvTips.get_transform().get_parent().get_gameObject().get_activeSelf()) { string[] array = DataReader <GongHuiXinXi> .Get("ExpTime").value.Split(new char[] { ',' }); if (array != null && array.Length == 2) { this.mTxDesc.set_text(string.Concat(new string[] { GameDataUtils.GetChineseContent(513518, false), " 每天\n", array[0], "-", array[1] })); if (GuildManager.Instance.IsGuildFieldOpen) { this.ShowGotoButton(); } } } }