//接任务 交任务 private void PopTaskIntactMenu(GameObject player, GameObject interactable) { NpcTaskDataLookup task_datalookup = interactable.transform.GetDataLookupILRComponentInChildren <NpcTaskDataLookup>("Hotfix_LT.UI.NpcTaskDataLookup", true, false); if (task_datalookup != null && task_datalookup.mDL.DefaultDataID != null) { Hashtable data = new Hashtable() { { "taskid", task_datalookup.mDL.DefaultDataID } }; GlobalMenuManager.Instance.Open("TaskChase", data); } }
//交互处理函数 private void NpcIntactProcess(GameObject player, GameObject interactable) { //play Audio PostAudioMessage(player, interactable); //有任务优先显示任务 -修改为有主线任务优先显示 NpcTaskDataLookup task_datalookup = interactable.transform.GetDataLookupILRComponentInChildren <NpcTaskDataLookup>("Hotfix_LT.UI.NpcTaskDataLookup", true, false); //老江需求,正在进行的任务不弹框 if (task_datalookup != null && task_datalookup.mDL.DefaultDataID != null && task_datalookup.IsMainTask() && !task_datalookup.IsRunning()) { string task_state = TaskSystem.ACCEPTABLE; DataLookupsCache.Instance.SearchDataByID <string>(task_datalookup.mDL.DefaultDataID + ".state", out task_state); if (task_state.Equals(TaskSystem.UNACCEPTABLE)) { PopFuncitonIntactMenu(player, interactable); return; } if (IsNpcFuncMenu(player, interactable)) { string npc_id = interactable.name; string scene_name = MainLandLogic.GetInstance().CurrentSceneName; Hotfix_LT.Data.MainLandEncounterTemplate met = Hotfix_LT.Data.SceneTemplateManager.GetMainLandsNPCData(scene_name, npc_id); if (IsFunctionNPC(npc_id, scene_name) && met != null && met.func_id_1 > 0) { if (IsOnlyHaveDeliveryDart(met) && AlliancesManager.Instance.DartData.State != eAllianceDartCurrentState.Transfering) { PopTaskIntactMenu(player, interactable); return; } int m_taskId; if (int.TryParse(task_datalookup.mDL.DefaultDataID.Replace(TaskStaticData.TaskPrefix, ""), out m_taskId)) { TaskTemplate taskTpl = TaskTemplateManager.Instance.GetTask(m_taskId); string taskName = taskTpl.task_name; System.Action callBack = delegate() { PopTaskIntactMenu(player, interactable); }; Hashtable taskData = new Hashtable() { { "taskName", taskName }, { "callback", callBack } }; Hashtable data = new Hashtable() { { "npc", npc_id }, { "scene", scene_name }, { "task", taskData } }; GlobalMenuManager.Instance.Open("NpcFuncMenu", data); return; } else { EB.Debug.LogError("parse taskId fail taskId=" + task_datalookup.mDL.DefaultDataID); } } } PopTaskIntactMenu(player, interactable); return; } //普通功能 PopFuncitonIntactMenu(player, interactable); }
private void OpenFunc(Hotfix_LT.Data.FuncTemplate func) { if (func.ui_model == "SpecialActivity") { if (func.parameter == "9001") { if (!ActivityUtil.IsTimeOk(9001)) { MessageTemplateManager.ShowMessage(902139); return; } } else if (func.parameter == "9002") { if (!ActivityUtil.IsTimeOk(9002)) { MessageTemplateManager.ShowMessage(902140); return; } } } //Close(); if (func.ui_model.Equals("TaskChase")) { EnemyController ec = MainLandLogic.GetInstance().GetEnemyController(npc); if (ec != null) { NpcTaskDataLookup task_datalookup = ec.GetComponentInChildren <NpcTaskDataLookup>(); if (task_datalookup != null && task_datalookup.mDL.DefaultDataID != null) { var ht = Johny.HashtablePool.Claim(); ht.Add("taskid", task_datalookup.mDL.DefaultDataID); Hotfix_LT.Data.FuncTemplateManager.OpenFunc(func.id, ht); } else { MessageTemplateManager.ShowMessage(902015, null, null); } } } else if (func.ui_model.Equals("task")) { System.Action callback = taskData["callback"] as System.Action; if (callback != null) { callback(); } } else if (func.ui_model.Equals("DeliveryDart")) { DeliveryDart(); } else { if (string.IsNullOrEmpty(func.parameter)) { Hotfix_LT.Data.FuncTemplateManager.OpenFunc(func.id, null); } else { Hotfix_LT.Data.FuncTemplateManager.OpenFunc(func.id, func.parameter); } } }