public void ChangeActiveController(ActiveController ac) { controller = ac; Control_WeekView.Hide(); Control_Search.Hide(); Control_AccountSettings.Hide(); Control_ManageCourses.Hide(); if (controller == ActiveController.WeekView) { Control_WeekView.ResetToDefault(); Control_WeekView.Show(); } if (controller == ActiveController.Search) { Control_Search.ResetToDefault(); Control_Search.Show(); } if (controller == ActiveController.AccountSettings) { Control_AccountSettings.ResetToDefault(); Control_AccountSettings.Show(); } if (controller == ActiveController.ManageCourses) { Control_ManageCourses.ResetToDefault(); Control_ManageCourses.Show(); } }
private void CloseApplication() { Hide(); notify.Visible = false; ActiveController.SoftKill(true); Environment.Exit(0); }
public void RewireInputChain() { ControllerInputCoalescer.Clear(); ControllerInputCoalescer.Definition = ActiveController.Definition; UdLRControllerAdapter.Source = ActiveController.Or(AutoFireController); StickyXorAdapter.Source = UdLRControllerAdapter; AutofireStickyXorAdapter.Source = StickyXorAdapter; MultitrackRewiringAdapter.Source = AutofireStickyXorAdapter; MovieInputSourceAdapter.Source = MultitrackRewiringAdapter; ControllerOutput.Source = MovieOutputHardpoint; Global.MovieSession.MovieControllerAdapter.Definition = MovieInputSourceAdapter.Definition; // connect the movie session before MovieOutputHardpoint if it is doing anything // otherwise connect the MovieInputSourceAdapter to it, effectively bypassing the movie session if (Global.MovieSession != null) { MovieOutputHardpoint.Source = Global.MovieSession.MovieControllerAdapter; } else { MovieOutputHardpoint.Source = MovieInputSourceAdapter; } }
public void SyncControls(IEmulator emulator, IMovieSession session, Config config) { var def = emulator.ControllerDefinition; ActiveController = BindToDefinition(def, config.AllTrollers, config.AllTrollersAnalog); AutoFireController = BindToDefinitionAF(emulator, config.AllTrollersAutoFire, config.AutofireOn, config.AutofireOff); // allow propagating controls that are in the current controller definition but not in the prebaked one // these two lines shouldn't be required anymore under the new system? ActiveController.ForceType(new ControllerDefinition(def)); ClickyVirtualPadController.Definition = new ControllerDefinition(def); // Wire up input chain ControllerInputCoalescer.Definition = ActiveController.Definition; UdLRControllerAdapter.Source = ActiveController.Or(AutoFireController); UdLRControllerAdapter.AllowUdlr = config.AllowUdlr; StickyXorAdapter.Source = UdLRControllerAdapter; AutofireStickyXorAdapter.Source = StickyXorAdapter; session.MovieIn = AutofireStickyXorAdapter; session.StickySource = AutofireStickyXorAdapter; ControllerOutput.Source = session.MovieOut; }
public ViewerController(GameObject screen, VideoPlayer video) { this.screen = screen; this.video = video; Debug.Log("about to start loading"); loadSlides(); Debug.Log("finished loading slides"); loadVideo(); this.aController = ActiveController.slide; }
/// <summary> /// Advance the animations. /// </summary> public void Update() { if ((ActiveAnimation != null) && (ActiveController != null)) { ActiveController.Update(Time.GameTimeFrameSeconds); } if ((IdleAnimation != null) && (IdleController != null)) { IdleController.Update(Time.GameTimeFrameSeconds); } }
/** * * Viewer Controller constructor * * @param slides List<Sprite> "the sprite objects for the slides" * * @param video VideoPlayer "The video object preloaded with video" * * @param screen GameObject "the 2d plane that hosts the slides" * **/ public ViewerController(List <Sprite> slides, VideoPlayer video, GameObject screen) { Debug.Log("Standard ViewerController Initializer"); this.aController = ActiveController.slide; this.sController = new SlideController(slides, screen); this.slidesBuilt = true; this.vController = new VideoController(video); this.videoBuilt = true; this.sController.setEnabled(true); this.vController.setEnabled(false); Debug.Log("Finished Standard ViewerController CTOR"); }
public void SyncControls(IEmulator emulator, Config config) { var def = emulator.ControllerDefinition; ActiveController = BindToDefinition(def, config.AllTrollers, config.AllTrollersAnalog); AutoFireController = BindToDefinitionAF(def, emulator, config.AllTrollersAutoFire); // allow propagating controls that are in the current controller definition but not in the prebaked one // these two lines shouldn't be required anymore under the new system? ActiveController.ForceType(new ControllerDefinition(def)); ClickyVirtualPadController.Definition = new ControllerDefinition(def); RewireInputChain(); }
private void InitialisePlayer() { var playerController = Instantiate(PlayerControllerType); ActiveController = playerController.GetComponent <ControllerComponent>(); if (ActiveController == null) { throw new ApplicationException("Controller type was not valid! Needs a controller component!"); } ActiveController.PawnInitialTransform = StartingSpawnLocation.GetSpawnLocation(); ActiveController.CreatePawnOfType(PlayerCharacterType); }
private void OpenVpnSwitch(string config, bool ask = true) { if (ask && ActiveController.IsRunning && (!ActiveController.IsRunning || MessageBox.Show("Do you want to disconnect from the current server and connect to this one?", "Reconnect", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)) { return; } if (ActiveController.IsRunning) { ActiveController.SoftKill(true); } ActiveController.Run(config, InternalData.SettingsGrid.Username, InternalData.SettingsGrid.Password); }
private void functionButton_Click(object sender, EventArgs e) { if (ActiveController.IsRunning) { ActiveController.SoftKill(); } else { if (serverView.SelectedItems.Count > 0) { ConnectToSelected(); } else { AutoConnect(); } } }
public static void ResetSticks() { #if DC_TOUCH_CONTROLS Instance.leftStick = new VirtualStick( "Virtual Left", new Vector3(InputSensitivityMin, InputSensitivityDefault, InputSensitivityMax), new Vector3(InputVerticalSkewMin, InputVerticalSkewDefault, InputVerticalSkewMax), false, false, new Vector3(InputMobilityMin, InputMobilityDefault, InputMobilityMax), new Vector3(InputStickinessMin, InputStickinessDefault, InputStickinessMax), new Vector3(InputReleaseDelayMin, InputReleaseDelayDefault, InputReleaseDelayMax) ); Instance.rightStick = new VirtualStick( "Virtual Right", new Vector3(InputSensitivityMin, InputSensitivityDefault, InputSensitivityMax), new Vector3(InputVerticalSkewMin, InputVerticalSkewDefault, InputVerticalSkewMax), false, false, new Vector3(InputMobilityMin, InputMobilityDefault, InputMobilityMax), new Vector3(InputStickinessMin, InputStickinessDefault, InputStickinessMax), new Vector3(InputReleaseDelayMin, InputReleaseDelayDefault, InputReleaseDelayMax) ); #else string controllerName = ActiveController == null ? "" : ActiveController.ToString() + " "; Instance.leftStick = new Stick( controllerName + "Left", new Vector3(InputSensitivityMin, InputSensitivityDefault, InputSensitivityMax), new Vector3(InputVerticalSkewMin, InputVerticalSkewDefault, InputVerticalSkewMax), false, false ); Instance.rightStick = new Stick( controllerName + "Right", new Vector3(InputSensitivityMin, InputSensitivityDefault, InputSensitivityMax), new Vector3(InputVerticalSkewMin, InputVerticalSkewDefault, InputVerticalSkewMax), false, false ); #endif }
// 攻守交代 public void SwitchAvtiveController() { ActiveController.StopThrow(); if (ActiveController == ControllerList[0]) { var tmp = ActiveController; ActiveController = ControllerList[1]; NonActiveController = tmp; } else if (ActiveController == ControllerList[1]) { var tmp = ActiveController; ActiveController = ControllerList[0]; NonActiveController = tmp; } ActiveController.StartThrow(); }
public string PerformAction(string userInput) { ActionResult result = ActiveController.PerformAction(userInput); if (result.QuitController) { Controllers.Pop(); if (Controllers.Count == 0) { this.IsActive = false; } } if (result.NextController != null) { Controllers.Push(result.NextController); } return(result.Output); }
void S2C_WORLD_LOGIN() { var msg = GameHeader.S2C_WORLD_LOGIN.CreatePacket(); msg.WriteInt32((int)PacketStatusCode.NO_ERROR); ActiveController.WriteLoginStream(msg); ActivePawn.WriteLoginStream(msg); (ActivePawn.CharacterStats as Game_PlayerStats).WriteLoginStream(msg); ActivePawn.Effects.WriteLoginStream(msg); msg.Write(ActiveController.DBCharacter); msg.Write(ActiveController.DBCharacterSheet); msg.Write(ActiveController.DBItems); msg.Write(ActiveController.DBSkilldecks); msg.Write(ActiveController.DBSkillTokens); (ActivePawn.Skills as Game_PlayerSkills).WriteLoginStream(msg); (ActivePawn.questLog as Game_PlayerQuestLog).WriteLoginStream(msg); msg.WriteInt32(0); //num persistentVars //foreach var int32:contextID, int32:varID, int32:value msg.WriteInt32(ActiveController.GetAuthorityLevel()); Connection.SendMessage(msg); }
public override void Process(TagHelperContext context, TagHelperOutput output) { base.Process(context, output); bool setActive = false; if (ActiveController != null && ViewContext.ActionDescriptor is ControllerActionDescriptor cad && ActiveController.Split(',').Contains(cad.ControllerName)) { setActive = true; } if (ActiveAction != null && ViewContext.ActionDescriptor is ControllerActionDescriptor cad2 && ActiveAction.Split(',').Contains(cad2.ActionName)) { setActive = true; } if (ActiveArea != null && (string)ViewContext.RouteData.Values.GetValueOrDefault("area") == ActiveArea) { setActive = true; } if (ActiveViewData != null && (string)ViewContext.ViewData["ActiveAction"] == ActiveViewData) { setActive = true; } if (setActive) { output.Attributes.TryGetAttribute("class", out var attrs); var nowClass = (attrs?.Value ?? "").ToString(); nowClass += " active"; output.Attributes.SetAttribute("class", nowClass); } }
private void SetPageInformation(ActionExecutingContext context) { Controller controller = context.Controller as Controller; if (controller != null) { StringValues RequestId; StringValues ErrorMessage; object ActiveController; object ActiveAction; string returnUrl = context.HttpContext.Request.Headers["Referer"].ToString(); context.HttpContext.Request.Query.TryGetValue("RequestId", out RequestId); context.HttpContext.Request.Query.TryGetValue("ErrorMessage", out ErrorMessage); context.RouteData.Values.TryGetValue("Controller", out ActiveController); context.RouteData.Values.TryGetValue("Action", out ActiveAction); if (string.IsNullOrEmpty(returnUrl)) { returnUrl = _httpContextAccessor.HttpContext.Request.PathBase; } else { Uri uri = new Uri(returnUrl); returnUrl = uri.AbsolutePath; } PageViewModel pageViewModel = new PageViewModel(); pageViewModel.ReturnURL = returnUrl; pageViewModel.RequestId = RequestId; pageViewModel.ErrorMessage = ErrorMessage; pageViewModel.Controller = ActiveController.ToString(); pageViewModel.Action = ActiveAction.ToString(); controller.ViewData["PageViewModel"] = pageViewModel; } }
public bool ChangeState(StableAnimationState state) { if (_isLocked) { return(false); } if (state == ActiveState && ActiveController != null) { return(false); } var newController = _stateLookup[state]; if (ActiveController != null) { ActiveController.Disable(); } if (SwitchingFromSidewaysToFrontFacingAnimation(ActiveController, newController)) { ResetSkeleton(); } ActiveController = newController; ActiveController.Enable(); if (ActiveController.LocksStateMachine) { _isLocked = true; } ActiveState = state; return(true); }
private void disconnectToolStripMenuItem_Click(object sender, EventArgs e) { ActiveController.SoftKill(); }
public void toggleActiveController() { this.aController = this.aController == ActiveController.slide ? ActiveController.video : ActiveController.slide; this.sController.toggleEnabled(); this.vController.toggleEnabled(); }
public void StartThrowActiveController() { ActiveController.StartThrow(); }