public void On_List_ElementEnable(CUIEvent uievent) { int srcWidgetIndexInBelongedList = uievent.m_srcWidgetIndexInBelongedList; CTask task = this._get_current_info((RES_TASK_TYPE)this.m_tabIndex, srcWidgetIndexInBelongedList); CTaskShower component = uievent.m_srcWidget.GetComponent <CTaskShower>(); if ((component != null) && (task != null)) { component.ShowTask(task, this.m_CUIForm); } }
private void _refresh_list(CUIListScript listScript, ListView <CTask> data_list) { if (listScript != null) { int count = data_list.Count; listScript.SetElementAmount(count); for (int i = 0; i < count; i++) { CUIListElementScript elemenet = listScript.GetElemenet(i); if ((elemenet != null) && listScript.IsElementInScrollArea(i)) { CTaskShower component = elemenet.GetComponent <CTaskShower>(); CTask task = data_list[i]; if ((component != null) && (task != null)) { component.ShowTask(task, this.m_CUIForm); } } } } }
private void _refresh_list(CUIListScript listScript, ListView <CTask> data_list) { if (listScript == null) { return; } int count = data_list.get_Count(); listScript.SetElementAmount(count); for (int i = 0; i < count; i++) { CUIListElementScript elemenet = listScript.GetElemenet(i); if (elemenet != null && listScript.IsElementInScrollArea(i)) { CTaskShower component = elemenet.GetComponent <CTaskShower>(); CTask cTask = data_list.get_Item(i); if (component != null && cTask != null) { component.ShowTask(cTask, this.m_CUIForm); } } } }
private void ShowLevelTask(LevelRewardData levelRewardData) { if (levelRewardData != null) { bool flag = levelRewardData.IsConfigTaskAllEmpty(); bool flag2 = levelRewardData.GetValidTaskCount() > 0; bool flag3 = levelRewardData.IsAllLevelTask(); if ((flag || !flag2) || flag3) { this.m_emptyTaskNode.CustomSetActive(true); this.m_normalTaskNode.CustomSetActive(false); Text component = this.m_CUIForm.transform.Find("node/list_node_main/task_node/noTask/Text").GetComponent <Text>(); if (component != null) { string text = string.Empty; if (flag) { text = Singleton <CTextManager> .instance.GetText("Task_LevelRewardInfo_None"); } if (!flag2) { text = Singleton <CTextManager> .instance.GetText("Task_LevelRewardInfo_NoGetTask"); } if (flag3) { if (levelRewardData.m_level >= LevelValue) { text = Singleton <CTextManager> .instance.GetText("Task_LevelRewardInfo_Up21"); } else { text = Singleton <CTextManager> .instance.GetText("Task_LevelRewardInfo_AllLevelTask"); } } component.text = text; } } else { this.m_emptyTaskNode.CustomSetActive(false); this.m_normalTaskNode.CustomSetActive(true); Text text2 = this.m_CUIForm.transform.Find("node/list_node_main/task_node/normal/Text").GetComponent <Text>(); if (text2 != null) { string[] args = new string[] { levelRewardData.m_level.ToString() }; text2.text = Singleton <CTextManager> .instance.GetText("Task_LevelRewardInfo_Normal", args); } int num = 0; for (int i = 0; i < levelRewardData.task_ids.Length; i++) { ResTask task = levelRewardData.task_ids[i]; if (task != null) { CTask task2 = Singleton <CTaskSys> .instance.model.GetTask(task.dwTaskID); bool flag4 = (task2 != null) && (task2.m_resTask.bTaskSubType == 0); bool flag5 = task2 != null; bool flag6 = false; if (!flag5 && (task != null)) { flag6 = Singleton <CTaskSys> .instance.model.IsInCltCalcCompletedTasks(task.dwTaskID); flag4 = task.bTaskSubType == 0; } GameObject obj2 = null; switch (num) { case 0: obj2 = this.m_taskNode0; break; case 1: obj2 = this.m_taskNode1; break; } if (((obj2 != null) && (flag5 || flag6)) && !flag4) { CTaskShower shower = obj2.GetComponent <CTaskShower>(); if (shower == null) { return; } if (flag5) { obj2.CustomSetActive(true); shower.ShowTask(task2, this.m_CUIForm); } else if (flag6) { obj2.CustomSetActive(true); ResTask task3 = levelRewardData.task_ids[i]; if (task3 != null) { shower.ShowTask(task3, this.m_CUIForm); } } num++; } } } for (int j = num; j < LevelRewardData.TASK_MAX_COUNT; j++) { GameObject obj3 = null; switch (j) { case 0: obj3 = this.m_taskNode0; break; case 1: obj3 = this.m_taskNode1; break; } if (obj3 != null) { obj3.CustomSetActive(false); } } } } }
private void ShowLevelTask(LevelRewardData levelRewardData) { if (levelRewardData == null) { return; } bool flag = levelRewardData.IsConfigTaskAllEmpty(); bool flag2 = levelRewardData.GetValidTaskCount() > 0; bool flag3 = levelRewardData.IsAllLevelTask(); if (flag || (!flag2 && !levelRewardData.IsHasCltCalcCompeletedTask()) || flag3) { this.m_emptyTaskNode.CustomSetActive(true); this.m_normalTaskNode.CustomSetActive(false); Text component = this.m_CUIForm.transform.Find("node/list_node_main/task_node/noTask/Text").GetComponent <Text>(); if (component != null) { string text = string.Empty; if (flag) { text = Singleton <CTextManager> .instance.GetText("Task_LevelRewardInfo_None"); } if (!flag2 && !levelRewardData.IsHasCltCalcCompeletedTask()) { text = Singleton <CTextManager> .instance.GetText("Task_LevelRewardInfo_NoGetTask"); } if (flag3) { if (levelRewardData.m_level >= CTaskView.LevelValue) { text = Singleton <CTextManager> .instance.GetText("Task_LevelRewardInfo_Up21"); } else { text = Singleton <CTextManager> .instance.GetText("Task_LevelRewardInfo_AllLevelTask"); } } component.set_text(text); } } else { this.m_emptyTaskNode.CustomSetActive(false); this.m_normalTaskNode.CustomSetActive(true); Text component2 = this.m_CUIForm.transform.Find("node/list_node_main/task_node/normal/Text").GetComponent <Text>(); if (component2 != null) { component2.set_text(Singleton <CTextManager> .instance.GetText("Task_LevelRewardInfo_Normal", new string[] { levelRewardData.m_level.ToString() })); } int num = 0; for (int i = 0; i < levelRewardData.task_ids.Length; i++) { ResTask resTask = levelRewardData.task_ids[i]; if (resTask != null) { CTask task = Singleton <CTaskSys> .instance.model.GetTask(resTask.dwTaskID); bool flag4 = task != null && task.m_resTask.bTaskSubType == 0; bool flag5 = task != null; bool flag6 = false; if (!flag5 && resTask != null) { flag6 = Singleton <CTaskSys> .instance.model.IsInCltCalcCompletedTasks(resTask.dwTaskID); flag4 = (resTask.bTaskSubType == 0); } GameObject gameObject = null; if (num == 0) { gameObject = this.m_taskNode0; } else if (num == 1) { gameObject = this.m_taskNode1; } if (gameObject != null && (flag5 || flag6) && !flag4) { CTaskShower component3 = gameObject.GetComponent <CTaskShower>(); if (component3 == null) { return; } if (flag5) { gameObject.CustomSetActive(true); component3.ShowTask(task, this.m_CUIForm); } else if (flag6) { gameObject.CustomSetActive(true); ResTask resTask2 = levelRewardData.task_ids[i]; if (resTask2 != null) { component3.ShowTask(resTask2, this.m_CUIForm); } } num++; } } } for (int j = num; j < LevelRewardData.TASK_MAX_COUNT; j++) { GameObject gameObject2 = null; if (j == 0) { gameObject2 = this.m_taskNode0; } else if (j == 1) { gameObject2 = this.m_taskNode1; } if (gameObject2 != null) { gameObject2.CustomSetActive(false); } } } }