private void AddMissionLibraryMissionBehaviors(MissionView entranceView) { //MissionStartingManager.AddMissionBehaviour(entranceView, // Global.GetProvider<AInputControllerFactory>().CreateInputController(entranceView.Mission)); MissionStartingManager.AddMissionBehaviour(entranceView, AMenuManager.Get().CreateMenuView()); MissionStartingManager.AddMissionBehaviour(entranceView, AMenuManager.Get().CreateGameKeyConfigView()); }
public HttpResponseMessage EmployMission(int missionId, int employeeId) { var mission = this._context.missions.FirstOrDefault(m => m.id == missionId); var employee = this._context.employees.FirstOrDefault(e => e.id == employeeId); if (mission != null && employee != null) { try { mission.employee = employee; this._context.SaveChanges(); var view = new MissionView(mission); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, view); //response.Headers.Location = new Uri(Url.Link("Default", new { id = performer.performerID })); return(response); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex)); } } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } }
protected void ManualControl() { MissionView missionView = (MissionView)_mission?.MissionBehaviors.Where(mb => mb is MissionView && (mb as MissionView).MissionScreen?.LastFollowedAgent != null).FirstOrDefault(); if (missionView != null) { var lastFollowedAgent = missionView.MissionScreen.LastFollowedAgent; if (lastFollowedAgent.Health > 0.0f && lastFollowedAgent.Team != null) { if (lastFollowedAgent.Team.IsPlayerTeam) { // take control of party soldier TakeControlOfFriendlyAgent(lastFollowedAgent); } else if (lastFollowedAgent.Team.IsFriendOf(_playerTeam)) { // attempt to take control of ally soldier if (_allowControlAllies) { TakeControlOfFriendlyAgent(lastFollowedAgent); } else { PrintInformation($"You can't take control of ally '{ lastFollowedAgent.Name }'"); } } else if (lastFollowedAgent.Team.IsEnemyOf(_playerTeam)) { // inform player that they can't take control of enemy soldiers PrintInformation($"You can't take control of enemy '{ lastFollowedAgent.Name }'"); } } } }
public IQueryable <MissionView> Disabled() { var models = repo.getAllMissions().Where(m => !m.enabled); var views = MissionView.getViews(models); return(views.AsQueryable()); }
public static MissionView[] OpenCustomSiegeBattleMission(Mission mission) { List <MissionView> missionViewList = new List <MissionView>(); mission.GetMissionBehaviour <SiegeDeploymentHandler>(); missionViewList.Add(ViewCreator.CreateMissionSingleplayerEscapeMenu()); missionViewList.Add(ViewCreator.CreateMissionAgentLabelUIHandler(mission)); missionViewList.Add(ViewCreator.CreateMissionBattleScoreUIHandler(mission, (ScoreboardVM) new CustomBattleScoreboardVM())); missionViewList.Add(ViewCreator.CreateOptionsUIHandler()); MissionView missionOrderUiHandler = ViewCreator.CreateMissionOrderUIHandler((Mission)null); missionViewList.Add(missionOrderUiHandler); missionViewList.Add((MissionView) new OrderTroopPlacer()); missionViewList.Add(ViewCreator.CreateMissionAgentStatusUIHandler(mission)); missionViewList.Add(ViewCreator.CreateMissionMainAgentEquipmentController(mission)); missionViewList.Add((MissionView) new MusicBattleMissionView(true)); missionViewList.Add((MissionView) new SiegeMissionView()); ISiegeDeploymentView isiegeDeploymentView = missionOrderUiHandler as ISiegeDeploymentView; missionViewList.Add((MissionView) new MissionEntitySelectionUIHandler(new Action <GameEntity>(isiegeDeploymentView.OnEntitySelection), new Action <GameEntity>(isiegeDeploymentView.OnEntityHover))); missionViewList.Add(ViewCreator.CreateMissionBoundaryCrossingView()); missionViewList.Add(ViewCreator.CreateSingleplayerMissionKillNotificationUIHandler()); missionViewList.Add((MissionView) new MissionBoundaryMarker((IEntityFactory) new FlagFactory("swallowtail_banner"), 2f)); missionViewList.Add(ViewCreator.CreateMissionFormationMarkerUIHandler(mission)); missionViewList.Add(ViewCreator.CreateMissionSpectatorControlView(mission)); missionViewList.Add((MissionView) new SiegeDeploymentVisualizationMissionView()); missionViewList.Add((MissionView) new MissionAgentContourControllerView()); missionViewList.Add((MissionView) new MissionCustomBattlePreloadView()); return(missionViewList.ToArray()); }
public static MissionView[] OpenSiegeBattleMission(Mission mission) { MissionView missionOrderUiHandler = ViewCreator.CreateMissionOrderUIHandler(); ISiegeDeploymentView siegeDeploymentView = missionOrderUiHandler as ISiegeDeploymentView; List <MissionView> missionViewList = new List <MissionView> { ViewCreator.CreateMissionSingleplayerEscapeMenu(), ViewCreator.CreateMissionAgentLabelUIHandler(mission), ViewCreator.CreateMissionBattleScoreUIHandler(mission, new EnhancedBattleTestScoreBoardVM()), ViewCreator.CreateOptionsUIHandler(), missionOrderUiHandler, new OrderTroopPlacer(), new MissionSingleplayerUIHandler(), ViewCreator.CreateMissionAgentStatusUIHandler(mission), ViewCreator.CreateMissionMainAgentEquipmentController(mission), ViewCreator.CreateMissionMainAgentCheerControllerView(mission), new MusicBattleMissionView(true), new SiegeMissionView(), new MissionEntitySelectionUIHandler(siegeDeploymentView.OnEntitySelection, siegeDeploymentView.OnEntityHover), ViewCreator.CreateMissionBoundaryCrossingView(), ViewCreator.CreateSingleplayerMissionKillNotificationUIHandler(), new MissionBoundaryMarker(new FlagFactory("swallowtail_banner")), ViewCreator.CreateMissionFormationMarkerUIHandler(mission), ViewCreator.CreateMissionSpectatorControlView(mission), new SiegeDeploymentVisualizationMissionView(), ViewCreator.CreatePlayerRoleSelectionUIHandler(), new MissionItemContourControllerView(), new MissionAgentContourControllerView(), new EnhancedBattleTestPreloadView() }; return(missionViewList.ToArray()); }
public void CheckMissionTag(MissionView misView) { if (e_CheckTagMission != null) { e_CheckTagMission(misView); } }
public override void OnCreated(MissionView entranceView) { foreach (var handler in _handlers) { handler.OnCreated(entranceView); } }
public override void OnPreMissionTick(MissionView entranceView, float dt) { foreach (var handler in _handlers) { handler.OnPreMissionTick(entranceView, dt); } }
public IQueryable <MissionView> Unemployed() { var models = repo.getAllMissions().Where(m => m.employee == null && m.enabled); var views = MissionView.getViews(models); return(views.AsQueryable()); }
public IQueryable <MissionView> All() { var models = repo.getAllMissions(); var views = MissionView.getViews(models); return(views.AsQueryable()); }
public override void OnCreated(MissionView entranceView) { List <MissionBehaviour> list = new List <MissionBehaviour> { new RTSCameraSelectCharacterView(), new RTSCameraLogic(), new HideHUDView(), new FlyCameraMissionView() }; foreach (var missionBehaviour in list) { MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour); } foreach (var extension in RTSCameraExtension.Extensions) { foreach (var missionBehaviour in extension.CreateMissionBehaviours(entranceView.Mission)) { MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour); } } foreach (var extension in MissionExtensionCollection.Extensions) { foreach (var missionBehaviour in extension.CreateMissionBehaviours(entranceView.Mission)) { MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour); } } }
public HttpResponseMessage PostAndContact(MissionView view) { var response = this.Post(view); if (response.StatusCode != HttpStatusCode.OK) { return(response); } var employees = repo.getAllEmployees() .Where(e => e.enabled == true) .Where(e => view.categoryIds.All(c => e.categories.Select(c2 => c2.id).Contains(c))); var models = new List <TextMessageView>(); foreach (var employee in employees) { var messageView = new TextMessageView() { from = "Jobsystems", message = "Hej " + employee.firstName + "!" + "\r\nVi har ett nytt uppdrag till dig:" + "\r\n" + "\r\nDatum: " + view.date.Split('T')[0] + "\r\nTid: " + view.date.Split('T')[1].Substring(0, 5) + "\r\nPlats: " + view.address.street + ", " + view.address.postalCode + " " + view.address.postalTown + "\r\n" + "\r\nLåter detta intressant?", to = employee.phoneNumber, }; var elkResponse = ElkTextMessage.send(messageView); var model = messageView.getModel(); model.created = DateTime.UtcNow; if (elkResponse.StatusCode == HttpStatusCode.OK) { var body = elkResponse.DynamicBody; model.apiId = body.id; model.error = false; model = repo.createTextMessage(model); } else { var message = elkResponse.RawText.Replace("\"", String.Empty); model.error = true; model.errorMessage = message; model = repo.createTextMessage(model); } models.Add(new TextMessageView(model)); } return(response); }
public override void OnCreated(MissionView entranceView) { AddMissionLibraryMissionBehaviors(entranceView); foreach (var handler in _handlers) { handler.OnCreated(entranceView); } }
public void Put(int id, MissionView view) { view.id = id; var model = view.getModel(repo); model.updated = DateTime.UtcNow; repo.update(model); }
public override void OnPreMissionTick(MissionView entranceView, float dt) { var orderTroopPlacer = entranceView.Mission.GetMissionBehaviour <OrderTroopPlacer>(); if (orderTroopPlacer != null) { entranceView.Mission.RemoveMissionBehaviour(orderTroopPlacer); } }
private static void DisableNextCharacterSpectatorUiPostfix(MissionView __instance, ref MissionSpectatorControlVM ____dataSource) { if (____dataSource.IsEnabled && (!__instance?.Mission?.IsOrderMenuOpen ?? false)) { return; } ____dataSource.IsEnabled = false; }
public bool DeleteMission(MissionView misView) { //lz-2017.01.03 crash bug 错误 #8204 if (null == misView) { return(false); } return(DeleteMission(misView.mMissionID)); }
public override void OnCreated(MissionView entranceView) { var list = new List <MissionBehaviour> { new BattleMiniMapView() }; foreach (var missionBehaviour in list) { MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour); } }
public HttpResponseMessage Get(int id) { var model = repo.getMission(id); if (model == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } else { var view = new MissionView(model); return(Request.CreateResponse(HttpStatusCode.OK, view)); } }
public override void OnCreated(MissionView entranceView) { List <MissionBehaviour> list = new List <MissionBehaviour> { new SetPlayerHealthLogic(), new CinematicCameraMenuView() }; foreach (var missionBehaviour in list) { MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour); } }
public override void OnCreated(MissionView entranceView) { var config = RTSCameraConfig.Get(); if (config.AttackSpecificFormation) { PatchChargeToFormation.Patch(); } if (config.FixCircularArrangement) { PatchCircularFormation.Patch(); } List <MissionBehaviour> list = new List <MissionBehaviour> { new RTSCameraSelectCharacterView(), new RTSCameraLogic(), new HideHUDView(), new RTSCameraMenuView(), new FlyCameraMissionView(), new RTSCameraGameKeyConfigView(), new FormationColorMissionView(), new RTSCameraOrderTroopPlacer() }; foreach (var missionBehaviour in list) { MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour); } foreach (var extension in RTSCameraExtension.Extensions) { foreach (var missionBehaviour in extension.CreateMissionBehaviours(entranceView.Mission)) { MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour); } } foreach (var extension in MissionExtensionCollection.Extensions) { foreach (var missionBehaviour in extension.CreateMissionBehaviours(entranceView.Mission)) { MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour); } } }
public HttpResponseMessage Missions(int id) { var model = repo.getCategory(id); if (model == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } else { var missions = model.missions; var views = MissionView.getViews(missions); return(Request.CreateResponse(HttpStatusCode.OK, views)); } }
public HttpResponseMessage Post(MissionView view) { var model = view.getModel(repo); model.created = DateTime.UtcNow; model.updated = DateTime.UtcNow; model.enabled = true; model.fakeId = Guid.NewGuid(); model = repo.createMission(model); view = new MissionView(model); var response = Request.CreateResponse <MissionView>(HttpStatusCode.Created, view); string uri = Url.Route(null, new { id = view.id }); response.Headers.Location = new Uri(Request.RequestUri, uri); return(response); }
public bool AddMission(MissionView misView, bool isIgnoreHadCreate = false) { if (!isIgnoreHadCreate) { if (m_MissonMap.ContainsKey(misView.mMissionID)) { return(false); } m_MissonMap[misView.mMissionID] = misView; } if (e_AddMission != null) { e_AddMission(misView); } return(true); }
public static void OnMissionScreenTickPostfixPatch(MissionView __instance, float dt) { // Stay in sync with any changes to the setting made in the game settings bool currentOptionState = ManagedOptions.GetConfig(ManagedOptions.ManagedOptionsType.ShowBannersOnFriendlyTroops) == 1f; if (currentOptionState != lastOptionState) { initialOptionState = lastOptionState = newOptionState = currentOptionState; } // Handle sticky toggle key bool stickyToggleKeyState = Input.IsKeyDown(FriendlyTroopBannerHotkeysModSettings.Settings.StickyBannerToggleHotkey); if (stickyToggleKeyState == true && lastPermToggleKeyState == false) { lastPermToggleKeyState = true; initialOptionState = !initialOptionState; newOptionState = !lastOptionState; } else if (stickyToggleKeyState == false && lastPermToggleKeyState == true) { lastPermToggleKeyState = false; } // Handle momentary toggle key bool momentaryToggleKeyState = FriendlyTroopBannerHotkeysModSettings.Settings.UseGameShowIndicatorsBindingForMomentary ? __instance.Input.IsGameKeyDown(GenericGameKeyContext.ShowIndicators) : Input.IsKeyDown(FriendlyTroopBannerHotkeysModSettings.Settings.MomentaryBannerToggleHotkey); if (momentaryToggleKeyState != lastTempToggleKeyState) { lastTempToggleKeyState = momentaryToggleKeyState; newOptionState = initialOptionState ? !momentaryToggleKeyState : momentaryToggleKeyState; } // Update game settings with current option state if (newOptionState != lastOptionState) { lastOptionState = newOptionState; ManagedOptions.SetConfig(ManagedOptions.ManagedOptionsType.ShowBannersOnFriendlyTroops, newOptionState ? 1f : 0f); } }
public override void OnCreated(MissionView entranceView) { var config = CommandSystemConfig.Get(); if (config.AttackSpecificFormation) { PatchChargeToFormation.Patch(); } List <MissionBehaviour> list = new List <MissionBehaviour> { new CommandSystemLogic(), new CommandSystemOrderTroopPlacer(), new DragWhenCommandView() }; foreach (var missionBehaviour in list) { MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour); } }
public override void OnPreMissionTick(MissionView entranceView, float dt) { }
public static void AddMissionBehaviour(MissionView entranceView, MissionBehaviour behaviour) { behaviour.OnAfterMissionCreated(); entranceView.Mission.AddMissionBehaviour(behaviour); }
private void AddMissionLibraryMissionBehaviors(MissionView entranceView) { AddMissionBehaviour(entranceView, Global.GetProvider <AInputControllerFactory>().CreateInputController(entranceView.Mission)); AddMissionBehaviour(entranceView, new OptionView(24, new Version(1, 0, 0))); }