private void Form1_KeyUp(object sender, KeyEventArgs e) { int key = e.KeyValue; if (key == controls.Up) { ControlsState.Up = false; } else if (key == controls.Down) { ControlsState.Down = false; } else if (key == controls.Right) { ControlsState.Right = false; } else if (key == controls.Left) { ControlsState.Left = false; } if (ControlsState.NoMovement()) { movementTimer.Stop(); } }
public WizardPlugin(GrtManager manager) : base(manager) { InitializeComponent(); savedControlsState = new ControlsState(); }
private void SetControlEnabled(ControlsState State) { foreach (Control item in groupPanel1.Controls) { if (item.GetType() == typeof(TextBoxX)) { switch (State) { case ControlsState.Normal: TextBoxX controll = item as TextBoxX; controll.ReadOnly = false; controll.Enabled = true; break; case ControlsState.Disabled: item.Enabled = false; break; case ControlsState.ReadOnly: TextBoxX c = item as TextBoxX; c.ReadOnly = true; break; default: break; } } } }
private void showControlsForState(ControlsState state) { switch (state) { case ControlsState.Disabled: disableInputButtons(); break; case ControlsState.Enabled: enableInputButtons(); break; } }
private void showControlsForState(ControlsState state) { switch (state) { case ControlsState.Disabled: disableDanceMoveControls(); break; case ControlsState.Enabled: enableDanceMoveControls(); break; } }
private void SetControlsState(ControlsState state) { switch (state) { case ControlsState.Capture: _cameraButton.gameObject.SetActive(true); _backButton.gameObject.SetActive(false); _loading.gameObject.SetActive(false); break; case ControlsState.Processing: _cameraButton.gameObject.SetActive(false); _backButton.gameObject.SetActive(false); _loading.gameObject.SetActive(true); break; case ControlsState.Back: _cameraButton.gameObject.SetActive(false); _backButton.gameObject.SetActive(true); _loading.gameObject.SetActive(false); break; } }
private void ProcessControls(float time) { IControlsState controlsState = new ControlsState(); if (Control.TurnLeft.IsPressed(controlsState)) { Turn(-time * _rotationSpeed); } if (Control.TurnRight.IsPressed(controlsState)) { Turn(time * _rotationSpeed); } if (Control.Enlarge.IsPressed(controlsState)) { Enlarge(time * _enlargeReduceRate); } if (Control.Reduce.IsPressed(controlsState)) { Reduce(time * _enlargeReduceRate); } }
public override void EnterState(ControlsState prevState){ Debug.Log ("Configuring controls for menu state"); CameraPanningScript.Disable (); }
private void changeControlState(ControlsState newState) { currentControlsState = newState; showControlsForState(currentControlsState); }
public WizardPlugin(GrtManager manager) : base(manager) { InitializeComponent(); savedControlsState = new ControlsState(); }
public ControlsController(ControlsState controlsState) : base(controlsState as IGameState) { }
public static void AddState(ControlsState state){ if (states.ContainsKey (state.name)) return; states.Add (state.name, state); }
public static void RemoveState(ControlsState state){ RemoveState (state.name); }
public virtual void ExitState(ControlsState nextState){ }
public virtual void EnterState(ControlsState prevState){ }
public static void SetState(string name){ if (!states.ContainsKey (name)) return; if (currentState != null) { currentState.ExitState(states[name]); } states [name].EnterState (currentState); currentState=states[name]; }
public static void SetState(ControlsState state){ SetState (state.name); }