Ejemplo n.º 1
0
        private void SetInputListener(View vin, SwSettings.ControlId cid)
        {
            var motion  = SwSettings.GetControlMotion(cid);
            var vibrate = SwSettings.GetVibrationEnable();

            vin.SetOnTouchListener(new SwButtonListener(vin, motion, vibrate));
        }
Ejemplo n.º 2
0
        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];
        }
Ejemplo n.º 3
0
        private bool IsAnalogControl(SwSettings.ControlId id)
        {
            switch (id)
            {
            case SwSettings.ControlId.L_Analog:
            case SwSettings.ControlId.R_Analog:
                return(true);

            default:
                return(false);
            }
        }
Ejemplo n.º 4
0
        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;
            }
        }
Ejemplo n.º 5
0
        private void SetJoystickListener(JoyStickView joystick, SwSettings.ControlId cid)
        {
            var motion = SwSettings.GetControlMotion(cid);

            joystick.SetOnMoveListener(new SwJoystickListener(motion));
        }