public SetupWizardWindowViewModel(MainModel mainModel) : base(mainModel) { Localization = mainModel.Localization.CurrentLanguage.SetupWizardWindow; currentPage = null; isBackButtonVisible = false; isNextButtonVisible = false; isFinishButtonVisible = false; isCancelButtonVisible = true; isWindowCloseButtonVisible = true; pages = new Dictionary <SetupWizardStep, SetupStepViewModel>(); sharedSetupContext = new SharedSetupContext(); LanguagePageViewModel = RegisterPage <LanguagePageViewModel>(); SetupModePageViewModel = RegisterPage <SetupModePageViewModel>(); DatabaseOperationPageViewModel = RegisterPage <DatabaseOperationPageViewModel>(); StepListPageViewModel = RegisterPage <StepListPageViewModel>(); DownloadModePageViewModel = RegisterPage <DownloadModePageViewModel>(); DownloadDumpInfoPageViewModel = RegisterPage <DownloadDumpInfoPageViewModel>(); CollectionsPageViewModel = RegisterPage <CollectionsPageViewModel>(); DownloadDumpsPageViewModel = RegisterPage <DownloadDumpsPageViewModel>(); DownloadDumpLinksPageViewModel = RegisterPage <DownloadDumpLinksPageViewModel>(); CreateDatabasePageViewModel = RegisterPage <CreateDatabasePageViewModel>(); ImportDumpsPageViewModel = RegisterPage <ImportDumpsPageViewModel>(); ConfirmationPageViewModel = RegisterPage <ConfirmationPageViewModel>(); BackCommand = new Command(BackButtonClick); NextCommand = new Command(NextButtonClick); FinishCommand = new Command(FinishButtonClick); WindowClosingCommand = new FuncCommand <bool?, bool>(WindowClosing); MainModel.Localization.LanguageChanged += LocalizationLanguageChanged; MoveToPage(LanguagePageViewModel.Step); }
public PipelineViewModel(IServiceManager serviceManager) { this.serviceManager = serviceManager; Pipelines = new ObservableCollection <UiPipeline>(); SortCommand = new FuncCommand <PipelineSortOrder>(Sort); this.serviceManager.OnStatusChange += Update; }
public SettingsWindowViewModel(MainModel mainModel) { this.mainModel = mainModel; errors = new Dictionary <string, string>(); OkCommand = new Command(OkButtonClick); CancelCommand = new Command(CancelButtonClick); WindowClosingCommand = new FuncCommand <bool>(WindowClosing); Initialize(); }
public DatabaseWindowViewModel(MainModel mainModel) : base(mainModel) { Localization = mainModel.Localization.CurrentLanguage.Database; formatter = mainModel.Localization.CurrentLanguage.Formatter; WindowClosingCommand = new FuncCommand <bool>(WindowClosing); ChangeDatabaseCommand = new Command(ChangeDatabase); CloseButtonCommand = new Command(CloseButtonClick); GetStats(); }
public SettingsWindowViewModel(MainModel mainModel) : base(mainModel) { errors = new Dictionary <string, string>(); Localization = mainModel.Localization.CurrentLanguage.Settings; DownloadSelectDirectoryCommand = new Command(DownloadSelectDirectory); OkCommand = new Command(OkButtonClick); CancelCommand = new Command(CancelButtonClick); WindowClosingCommand = new FuncCommand <bool>(WindowClosing); Initialize(); }
public void FunctionCallsAHandlerAndReturns() { var commanBus = new CommandBus(); commanBus.RegisterHandlers<FuncCommand>("Commandos.Specs.Samples"); var command = new FuncCommand(); var result = commanBus.Publish<FuncCommand>((object) command); Assert.That(command, Is.SameAs(result)); }
protected override void OnClosing(CancelEventArgs e) { FuncCommand <bool> closingCommand = ClosingCommand; if (closingCommand != null) { e.Cancel = !closingCommand.Execute(); } if (!e.Cancel) { base.OnClosing(e); } }
protected override void OnClosing(CancelEventArgs e) { FuncCommand <bool?, bool> closingCommand = ClosingCommand; if (closingCommand != null) { e.Cancel = !closingCommand.ExecuteWithTypedParameter(DialogResult); } if (!e.Cancel) { base.OnClosing(e); } }
public ApplicationUpdateWindowViewModel(MainModel mainModel, Updater.UpdateCheckResult updateCheckResult) : base(mainModel) { this.updateCheckResult = updateCheckResult; cancellationTokenSource = new CancellationTokenSource(); Localization = mainModel.Localization.CurrentLanguage.ApplicationUpdate; WindowClosingCommand = new FuncCommand <bool>(WindowClosing); SkipVersionCommand = new Command(SkipVersion); DownloadCommand = new Command(DownloadAsync); CancelCommand = new Command(Cancel); InterruptDownloadCommand = new Command(InterruptDownload); CloseCommand = new Command(Close); Initialize(); }
public SqlDebuggerWindowViewModel(MainModel mainModel) { this.mainModel = mainModel; Events = new EventProvider(); SqlQuery = String.Empty; isSqlQueryTextBoxEnabled = true; result = String.Empty; isCopyButtonEnabled = false; isCloseButtonEnabled = true; isQueryInProgress = false; Localization = mainModel.Localization.CurrentLanguage.SqlDebugger; WindowClosingCommand = new FuncCommand <bool?, bool>(WindowClosing); RunSqlCommand = new Command(RunSqlAsync); CopyResultCommand = new Command(CopyResultToClipboard); Events.RaiseEvent(ViewModelEvent.RegisteredEventId.FOCUS_SQL_QUERY_TEXT_BOX); }
public void OnGetBookClick(IEvent ievent) { if (mHandBookDataModel.BookInfoShow == 1) { var itemData = mHandBookDataModel.SelectedBook[0]; //21去打怪获取 if (21 == itemData.TrackType) { ObjManager.Instance.MyPlayer.LeaveAutoCombat(); GameControl.Executer.Stop(); var command = GameControl.GoToCommand(itemData.TrackParam[0], itemData.TrackParam[1], itemData.TrackParam[2]); var command1 = new FuncCommand(() => { GameControl.Instance.TargetObj = null; ObjManager.Instance.MyPlayer.EnterAutoCombat(); }); GameControl.Executer.PushCommand(command); GameControl.Executer.PushCommand(command1); EventDispatcher.Instance.DispatchEvent(new Close_UI_Event(UIConfig.HandBook)); } else if (22 == itemData.TrackType) { var e = new Show_UI_Event(UIConfig.DungeonUI); EventDispatcher.Instance.DispatchEvent(e); GameUtils.GotoUiTab(25, itemData.TrackParam[0]); } else if (23 == itemData.TrackType) { var dicid = itemData.TrackParam[0]; if (dicid > 0) { var ee = new ShowUIHintBoard(dicid); EventDispatcher.Instance.DispatchEvent(ee); } } else if (23 == itemData.TrackType) { var ee = new ShowUIHintBoard(itemData.TrackParam[1]); EventDispatcher.Instance.DispatchEvent(ee); } } }
private void OnMapSceneClickCellEvent(IEvent ievent) { var _e = ievent as MapSceneClickCell; var _itemData = _e.Data; ObjManager.Instance.MyPlayer.LeaveAutoCombat(); var _tbVip = PlayerDataManager.Instance.TbVip; if (mSceneRecord.Type == 0) { if (_tbVip.AreaLimitTrans == 1) { FlyTo(_itemData.SceneLoction.x, _itemData.SceneLoction.z); return; } do { _tbVip = Table.GetVIP(_tbVip.Id + 1); } while (0 == _tbVip.AreaLimitTrans); GameUtils.GuideToBuyVip(_tbVip.Id, 270254); } mIsDrawPath = true; DrawTargetWayLoction(_itemData.SceneLoction, 1.0f); GameControl.Executer.Stop(); var _command = new MoveCommand(ObjManager.Instance.MyPlayer, _itemData.SceneLoction, 1.0f); GameControl.Executer.PushCommand(_command); if (_itemData.CharType == 2) { var _command1 = new FuncCommand(() => { ObjManager.Instance.MyPlayer.EnterAutoCombat(); }); GameControl.Executer.PushCommand(_command1); } else if (_itemData.CharType == 1) { var _command1 = new FuncCommand(() => { MissionManager.Instance.OpenMissionByNpcId(_itemData.NpcId); }); GameControl.Executer.PushCommand(_command1); } }
public bool SelectTarget(GameObject gameObject, int skill = -1) { //null鍒ゆ柇 if (null == gameObject) { return(false); } //鑾峰緱涓昏鑷繁 var myself = ObjManager.Instance.MyPlayer; if (null == myself) { return(false); } //鐩爣寰楁槸涓猳bj var obj = gameObject.GetComponent <ObjBase>(); if (null == obj) { return(false); } if (skill == -1) { TargetCharacter(obj); } //鍋滄褰撳墠鐨勬寚浠? //Executer.Stop(); //璁$畻鑷繁璺濈鐩爣鐨勮窛绂? var distance = Vector3.Distance(obj.Position, myself.Position); //榛樿鎶€鑳? var skillId = skill; if (skillId == -1) { skillId = PlayerDataManager.Instance.GetNormalSkill(); } if (obj.IsCharacter() && myself.IsMyEnemy(obj as ObjCharacter)) { if (obj.GetObjType() == OBJ.TYPE.NPC || obj.GetObjType() == OBJ.TYPE.RETINUE) { //濡傛灉鏄痭pc var npc = obj as ObjNPC; if (npc == null) { return(false); } if (!npc.CanBeInteractive()) { return(false); } } var character = obj as ObjCharacter; if (character.Dead) { return(false); } //瀵瑰叾閲婃斁鎶€鑳? var data = Table.GetSkill(skillId); //鐩爣绫诲瀷 var targetType = (SkillTargetType)ObjMyPlayer.GetSkillData_Data(data, eModifySkillType.TargetType); //涓嶉渶瑕佺洰鏍囩殑鎶€鑳? if (targetType == SkillTargetType.SELF || targetType == SkillTargetType.CIRCLE || targetType == SkillTargetType.SECTOR || targetType == SkillTargetType.RECT) { //浣跨敤鎶€鑳? return(UseSkill(myself.GetObjId(), skillId, character.GetObjId())); } //闇€瑕佺洰鏍囩殑鎶€鑳? if (targetType == SkillTargetType.SINGLE || targetType == SkillTargetType.TARGET_CIRCLE || targetType == SkillTargetType.TARGET_RECT || targetType == SkillTargetType.TARGET_SECTOR) { var maxSkillDistance = GetSkillReleaseDistance(data); if (maxSkillDistance - 0.5 < 0.0f) { maxSkillDistance = 0.5f; } if (distance > maxSkillDistance - 0.5) { //璺濈涓嶅 var offset = maxSkillDistance - 1.0f; if (offset < 0.0f) { offset = 0.1f; } Executer.PushCommand(new MoveCommand(myself, character.Position, offset)); Executer.PushCommand(new AttackCommand(myself.GetObjId(), skillId, character.GetObjId())); } else { TargetObj = character; PlayerDataManager.Instance.SetSelectTargetData(TargetObj, 3); ObjManager.Instance.MyPlayer.FaceTo(character.Position); return(UseSkill(myself.GetObjId(), skillId, character.GetObjId())); } } else { Logger.Error("Unknow skill target type = {0}", targetType); } } else if (obj.GetObjType() == OBJ.TYPE.NPC) { var npc = obj as ObjNPC; if (!npc.CanBeInteractive()) { return(false); } if (npc.TableNPC.NpcType == (int)eNpcType.PickUpNpc) { if (distance > GameSetting.Instance.MaxDistance_NPC) { var command = new MoveCommand(myself, npc.Position, GameSetting.Instance.MaxDistance_NPC); Executer.PushCommand(command); return(false); } else { { if (!IsInit) { Table.ForeachWarFlag(tb => { WarFlagDic.Add(tb.Id, tb.FlagModel); return(true); }); Table.ForeachLode(tb => { if (tb.Id < 100000) { LodeDic.Add(tb.Id, tb.NpcId); } else if (tb.Id >= 100000 && tb.Id <= 100020)//策划指定墓碑使用此区间 { MonumentDic.Add(tb.Id, tb.NpcId); } return(true); }); IsInit = true; } var npcId = npc.TableNPC.Id; if (WarFlagDic.ContainsValue(npcId)) { //战旗 PlayerDataManager.Instance.HoldLode(npcId); return(false); } else if (LodeDic.ContainsValue(npcId)) { //采矿 PlayerDataManager.Instance.CollectLode(npcId); return(false); } else if (MonumentDic.ContainsValue(npcId)) { //祭拜 PlayerDataManager.Instance.WorshipMonument(npcId); return(false); } } EventDispatcher.Instance.DispatchEvent(new PickUpNpc_Event(npc.GetDataId(), npc.GetObjId())); return(false); } } var npcDataId = npc.GetDataId(); if (npcDataId >= 108 && npcDataId <= 110)//判断是否是排行NPC { EventDispatcher.Instance.DispatchEvent(new OnRankNpcClick_Event(npcDataId)); } myself.StopMove(); if (distance <= GameSetting.Instance.MaxDistance_NPC) { if (MissionManager.Instance.OpenMissionByNpcId(npc.GetDataId(), npc.GetObjId())) { npc.DoDialogue(); //TODO if (myself.IsAutoFight()) { myself.LeaveAutoCombat(); } } } else { var command = new MoveCommand(myself, npc.Position, GameSetting.Instance.MaxDistance_NPC); Executer.PushCommand(command); var command1 = new FuncCommand(() => { if (MissionManager.Instance.OpenMissionByNpcId(npc.GetDataId(), npc.GetObjId())) { npc.DoDialogue(); //TODO if (myself.IsAutoFight()) { myself.LeaveAutoCombat(); } } }); Executer.PushCommand(command1); } } else if (obj.GetObjType() == OBJ.TYPE.DROPITEM) { //濡傛灉鏄帀钀界墿鍝? var dropItem = obj as ObjDropItem; myself.StopMove(); var dis = GameSetting.Instance.MaxDistance_DropItem; if (dropItem.mTableData != null && dropItem.mTableData.Type == 300) { dis = GameUtils.AutoPickUpBuffDistance; } if (distance <= dis) { dropItem.Pickup(); } else { var command = new MoveCommand(myself, dropItem.Position, dis); Executer.PushCommand(command); var command1 = new FuncCommand(() => { if (null != dropItem) { dropItem.Pickup(); } }); Executer.PushCommand(command1); } } else if (obj.GetObjType() == OBJ.TYPE.FAKE_CHARACTER) { if (((ObjFakeCharacter)obj).iType == (int)eFakeCharacterTypeDefine.MieShiFakeCharacterType) { EventDispatcher.Instance.DispatchEvent(new ApplyPortraitAward_Event(obj.GetDataId())); } else { if (((ObjFakeCharacter)obj).iType == (int)OBJ.TYPE.FAKE_FIGHTLEADER) { if (GuideTrigger.IsFunctionOpen("BtnRank")) { var e = new Show_UI_Event(UIConfig.RankUI, new RankArguments { RankId = obj.GetObjId() }); EventDispatcher.Instance.DispatchEvent(e); } else { EventDispatcher.Instance.DispatchEvent(new ShowUIHintBoard(1736)); } } else { EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.WorshipFrame)); } } } return(false); }
public bool SelectTarget(GameObject gameObject, int skill = -1) { //null判断 if (null == gameObject) { return(false); } //获得主角自己 var myself = ObjManager.Instance.MyPlayer; if (null == myself) { return(false); } //目标得是个obj var obj = gameObject.GetComponent <ObjBase>(); if (null == obj) { return(false); } if (skill == -1) { TargetCharacter(obj); } //停止当前的指�? //Executer.Stop(); //计算自己距离目标的距�? var distance = Vector3.Distance(obj.Position, myself.Position); //默认技�? var skillId = skill; if (skillId == -1) { skillId = PlayerDataManager.Instance.GetNormalSkill(); } if (obj.IsCharacter() && myself.IsMyEnemy(obj as ObjCharacter)) { if (obj.GetObjType() == OBJ.TYPE.NPC || obj.GetObjType() == OBJ.TYPE.RETINUE) { //如果是npc var npc = obj as ObjNPC; if (npc == null) { return(false); } if (!npc.CanBeInteractive()) { return(false); } } var character = obj as ObjCharacter; if (character.Dead) { return(false); } //对其释放技�? var data = Table.GetSkill(skillId); //目标类型 var targetType = (SkillTargetType)ObjMyPlayer.GetSkillData_Data(data, eModifySkillType.TargetType); //不需要目标的技�? if (targetType == SkillTargetType.SELF || targetType == SkillTargetType.CIRCLE || targetType == SkillTargetType.SECTOR || targetType == SkillTargetType.RECT) { //使用技�? return(UseSkill(myself.GetObjId(), skillId, character.GetObjId())); } //需要目标的技�? if (targetType == SkillTargetType.SINGLE || targetType == SkillTargetType.TARGET_CIRCLE || targetType == SkillTargetType.TARGET_RECT || targetType == SkillTargetType.TARGET_SECTOR) { var maxSkillDistance = GetSkillReleaseDistance(data); if (maxSkillDistance - 0.5 < 0.0f) { maxSkillDistance = 0.5f; } if (distance > maxSkillDistance - 0.5) { //距离不够 var offset = maxSkillDistance - 1.0f; if (offset < 0.0f) { offset = 0.1f; } Executer.PushCommand(new MoveCommand(myself, character.Position, offset)); Executer.PushCommand(new AttackCommand(myself.GetObjId(), skillId, character.GetObjId())); } else { TargetObj = character; PlayerDataManager.Instance.SetSelectTargetData(TargetObj, 3); ObjManager.Instance.MyPlayer.FaceTo(character.Position); return(UseSkill(myself.GetObjId(), skillId, character.GetObjId())); } } else { Logger.Error("Unknow skill target type = {0}", targetType); } } else if (obj.GetObjType() == OBJ.TYPE.NPC) { var npc = obj as ObjNPC; if (!npc.CanBeInteractive()) { return(false); } if (npc.TableNPC.NpcType == (int)eNpcType.PickUpNpc) { EventDispatcher.Instance.DispatchEvent(new PickUpNpc_Event(npc.GetDataId(), npc.GetObjId())); return(false); } myself.StopMove(); if (distance <= GameSetting.Instance.MaxDistance_NPC) { if (MissionManager.Instance.OpenMissionByNpcId(npc.GetDataId(), npc.GetObjId())) { npc.DoDialogue(); //TODO if (myself.IsAutoFight()) { myself.LeaveAutoCombat(); } } } else { var command = new MoveCommand(myself, npc.Position, GameSetting.Instance.MaxDistance_NPC); Executer.PushCommand(command); var command1 = new FuncCommand(() => { if (MissionManager.Instance.OpenMissionByNpcId(npc.GetDataId(), npc.GetObjId())) { npc.DoDialogue(); //TODO if (myself.IsAutoFight()) { myself.LeaveAutoCombat(); } } }); Executer.PushCommand(command1); } } else if (obj.GetObjType() == OBJ.TYPE.DROPITEM) { //如果是掉落物�? var dropItem = obj as ObjDropItem; myself.StopMove(); if (distance <= GameSetting.Instance.MaxDistance_DropItem) { dropItem.Pickup(); } else { var command = new MoveCommand(myself, dropItem.Position, GameSetting.Instance.MaxDistance_DropItem); Executer.PushCommand(command); var command1 = new FuncCommand(() => { if (null != dropItem) { dropItem.Pickup(); } }); Executer.PushCommand(command1); } } else if (obj.GetObjType() == OBJ.TYPE.FAKE_CHARACTER) { if (((ObjFakeCharacter)obj).iType == (int)eFakeCharacterTypeDefine.MieShiFakeCharacterType) { EventDispatcher.Instance.DispatchEvent(new ApplyPortraitAward_Event(obj.GetDataId())); } else { EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.WorshipFrame)); } } return(false); }
//根据任务状态去往任务所需地点 public void GoToMissionPlace(int id) { MissionBaseModel data = null; if (!MissionData.Datas.TryGetValue(id, out data)) { return; } GameControl.Executer.Stop(); var table = Table.GetMissionBase(id); if (null == table) { Logger.Error("GoToMissionPlace({0}) null == table", id); return; } var type = (eMissionMainType)table.ViewType; var state = (eMissionState)data.Exdata[0]; if (eMissionState.Acceptable == state) { if (-1 == table.NpcStart) { var arg = new MissionListArguments(); arg.Tab = 2; arg.MissionId = id; EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.MissionList, arg)); //GameLogic.Instance.StartCoroutine(ShowMissionById(2,id)); return; } ObjManager.Instance.MyPlayer.LeaveAutoCombat(); var e = new MapSceneDrawPath(new Vector3(table.PosX, 0, table.PosY), 1.0f); EventDispatcher.Instance.DispatchEvent(e); var command = GameControl.GoToCommand(table.NpcScene, table.PosX, table.PosY, 1.0f); GameControl.Executer.PushCommand(command); var command1 = new FuncCommand(() => { Instance.OpenMissionById(id, table.NpcStart); }); GameControl.Executer.PushCommand(command1); } else if (eMissionState.Finished == state) { //如果是日常任务就直接弹界面 if (eMissionMainType.Daily == type || eMissionMainType.Circle == type) { var arg = new MissionListArguments(); arg.Tab = 3; arg.MissionId = id; EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.MissionList, arg)); //GameLogic.Instance.StartCoroutine(ShowMissionById(3,id)); return; } if (eMissionMainType.SubStoryLine == type && -1 == table.FinishNpcId) { var arg = new MissionListArguments(); arg.Tab = 2; arg.MissionId = id; EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.MissionList, arg)); return; } ObjManager.Instance.MyPlayer.LeaveAutoCombat(); var e = new MapSceneDrawPath(new Vector3(table.FinishPosX, 0, table.FinishPosY), 1.0f); EventDispatcher.Instance.DispatchEvent(e); var command = GameControl.GoToCommand(table.FinishSceneId, table.FinishPosX, table.FinishPosY, 1.0f); GameControl.Executer.PushCommand(command); var command1 = new FuncCommand(() => { Instance.OpenMissionById(id, table.FinishNpcId); }); GameControl.Executer.PushCommand(command1); } else if (eMissionState.Unfinished == state) { if (eMissionMainType.Circle == type) { //记录一下当前正在做的环任务 CurrentDoingCircleMission = id; } else { CurrentDoingCircleMission = -1; } EventDispatcher.Instance.DispatchEvent(new UIEvent_DoMissionGoTo()); if (0 == table.TrackType) { //到地图某一地方 ObjManager.Instance.MyPlayer.LeaveAutoCombat(); var e = new MapSceneDrawPath(new Vector3(table.TrackParam[1], 0, table.TrackParam[2]), 1.0f); EventDispatcher.Instance.DispatchEvent(e); var command = GameControl.GoToCommand(table.TrackParam[0], table.TrackParam[1], table.TrackParam[2]); GameControl.Executer.ExeCommand(command); } else if (1 == table.TrackType) { //直接开某个界面 if (13 == table.TrackParam[0]) { var arg = new MissionListArguments(); arg.IsFromMisson = true; arg.Tab = table.TrackParam[1]; var e = new Show_UI_Event(UIConfig.MissionList, arg); EventDispatcher.Instance.DispatchEvent(e); } else { GameUtils.GotoUiTab(table.TrackParam[0], table.TrackParam[1], table.TrackParam[2]); } return; } switch ((eMissionType)table.FinishCondition) { case eMissionType.KillMonster: case eMissionType.CheckItem: { //计算下和该任务完成地点相同的其他任务 var missionList = new List <int>(); missionList.Add(id); { // foreach(var tempData in MissionData.Datas) var __enumerator3 = (MissionData.Datas).GetEnumerator(); while (__enumerator3.MoveNext()) { var tempData = __enumerator3.Current; { var missionData = tempData.Value; if (missionData.MissionId == id) { continue; } //正在做的任务 if (eMissionState.Unfinished != (eMissionState)missionData.Exdata[0]) { continue; } //只检查杀怪和获得物品的任务 var tableTemp = Table.GetMissionBase(missionData.MissionId); var typeTemp = (eMissionType)tableTemp.FinishCondition; if (eMissionType.KillMonster != typeTemp && eMissionType.CheckItem != typeTemp) { continue; } //检查任务完成地点 if (tableTemp.TrackParam[0] != table.TrackParam[0] || tableTemp.TrackParam[1] != table.TrackParam[1] || tableTemp.TrackParam[2] != table.TrackParam[2]) { continue; } missionList.Add(missionData.MissionId); } } } var command1 = new FuncCommand(() => { GameControl.Instance.TargetObj = null; ObjManager.Instance.MyPlayer.EnterAutoCombat(missionList); }); GameControl.Executer.PushCommand(command1); } break; case eMissionType.AcceptProgressBar: case eMissionType.AreaProgressBar: { var command1 = new FuncCommand(() => { if (OBJ.CHARACTER_STATE.IDLE != ObjManager.Instance.MyPlayer.GetCurrentStateName()) { return; } var dicId = table.FinishParam[1]; var e = new ShowMissionProgressEvent(GameUtils.GetDictionaryText(dicId)); EventDispatcher.Instance.DispatchEvent(e); Logger.Info("FuncCommand CallBackFun.......................1"); Action endCallback = () => { ObjManager.Instance.MyPlayer.PlayAnimation(OBJ.CHARACTER_ANI.STAND); CompleteMission(id); if (-1 != table.FinishParam[2]) { GameLogic.Instance.SceneEffect.StopEffect(table.FinishParam[2]); } var e1 = new HideMissionProgressEvent(id); EventDispatcher.Instance.DispatchEvent(e1); }; Action interruptCallback = () => { if (-1 != table.FinishParam[2]) { GameLogic.Instance.SceneEffect.StopEffect(table.FinishParam[2]); } var e1 = new HideMissionProgressEvent(id); EventDispatcher.Instance.DispatchEvent(e1); }; GameLogic.Instance.StopCoroutine("LaunchAction"); var animationId = -1; if (!int.TryParse(table.PlayCollectionAct, out animationId)) { Logger.Error("int.TryParse(table.PlayCollectionAct) failed [{0}]", table.Id); } if (-1 == animationId) { animationId = 11; } GameLogic.Instance.StartCoroutine(GameUtils.LaunchAction(animationId, table.FinishParam[0], endCallback, interruptCallback)); if (-1 != table.FinishParam[2]) { GameLogic.Instance.SceneEffect.PlayEffect(table.FinishParam[2]); } }); GameControl.Executer.PushCommand(command1); } break; case eMissionType.EquipItem: case eMissionType.EnhanceEquip: { } break; case eMissionType.AreaStroy: { //播放剧情 if (-1 != CurrentMissionTableData.FinishParam[0]) { var storyId = CurrentMissionTableData.FinishParam[0]; Action endCallback = () => { CompleteMission(id); }; PlayCG.PlayById(storyId, endCallback); } } break; case eMissionType.BuyItem: case eMissionType.DepotTakeOut: { var command1 = new FuncCommand(() => { OpenMissionByNpcId(table.FinishParam[2]); }); GameControl.Executer.PushCommand(command1); } break; case eMissionType.Dungeon: { var sceneId = table.FinishParam[0]; var currentSceneId = GameLogic.Instance.Scene.SceneTypeId; if (sceneId != currentSceneId) { UIManager.Instance.ShowMessage(MessageBoxType.OkCancel, GameUtils.GetDictionaryText(220507), GameUtils.GetDictionaryText(1503), () => { ChangedSceneByMission(sceneId, id); }); } else { var player = ObjManager.Instance.MyPlayer; if (null != player) { player.EnterAutoCombat(); } } } break; default: { EventDispatcher.Instance.DispatchEvent(new ShowUIHintBoard(210118)); } break; } } EventDispatcher.Instance.DispatchEvent(new Close_UI_Event(UIConfig.MissionList)); }