private void SetInputListener(View vin, SwSettings.ControlId cid) { var motion = SwSettings.GetControlMotion(cid); var vibrate = SwSettings.GetVibrationEnable(); vin.SetOnTouchListener(new SwButtonListener(vin, motion, vibrate)); }
private void ConfigureControlLabel(SwSettings.ControlId control) { Log.Debug(TAG, "ConfigureControlLabel"); var label = FindViewById <TextView>(Resource.Id.inputName); label.Text = SwSettings.CONTROL_TO_STRING_MAP[control]; }
private bool IsAnalogControl(SwSettings.ControlId id) { switch (id) { case SwSettings.ControlId.L_Analog: case SwSettings.ControlId.R_Analog: return(true); default: return(false); } }
public void Accept(SystemMessage message) { if (message.getMessageType() != MessageType.ControlUpdate) { return; } var control_message = (ControlUpdateMessage)message; selected_control = control_message.Id; switch (control_message.Update) { case ControlUpdateMessage.UpdateType.Pressed: Log.Debug(TAG, "Accept(UpdateType.Pressed)"); { if (IsAnalogControl(selected_control)) { ConfigureControlLabel(selected_control); MotionConfigurationActivity.control = selected_control; RefreshAnalogSpinner(); RefreshInputHighlighting(); } } break; case ControlUpdateMessage.UpdateType.Released: Log.Debug(TAG, "Accept(UpdateType.Released)"); { if (!IsAnalogControl(selected_control)) { ConfigureControlLabel(selected_control); MotionConfigurationActivity.control = selected_control; RefreshAnalogSpinner(); RefreshInputHighlighting(); } } break; default: break; } }
private void SetJoystickListener(JoyStickView joystick, SwSettings.ControlId cid) { var motion = SwSettings.GetControlMotion(cid); joystick.SetOnMoveListener(new SwJoystickListener(motion)); }