Пример #1
0
        public static bool ControlReleased(ControlConfig control, string display)
        {
            if (control.Key != null)
            {
                return(KeyReleased((Key)control.Key, display) || MouseReleased(control.MouseButton, display));
            }

            return(MouseReleased(control.MouseButton, display));
        }
Пример #2
0
        public static bool ControlDown(ControlConfig control, string display)
        {
            if (control.Key != null)
            {
                return(KeyDown((Key)control.Key, display) && MouseDown(control.MouseButton, display));
            }

            return(MouseDown(control.MouseButton, display) && keysDownCount == 0);
        }
Пример #3
0
        private void BtnCancelClick(object sender, EventArgs e)
        {
            cmbTextureFilterMode.SelectedIndex = _lastFilterModeSelectedIndex;
            Configuration.CameraSpeed          = _lastCameraSpeedValue;
            _tempCameraDragConfig   = null;
            _tempSpriteMarkupConfig = null;
            _tempSpriteSelectConfig = null;

            Configuration.BackgroundColor        = _lastBgColor;
            Configuration.FrameRectColor         = _lastFrameRectColor;
            Configuration.HoverFrameRectColor    = _lastFrameRectHoveredColor;
            Configuration.SelectedFrameRectColor = _lastFrameRectSelectedColor;

            Close();
        }
Пример #4
0
        public static ControlConfig ParseControl(string keyString, string buttonString)
        {
            var controlConfig = new ControlConfig();

            if (keyString != "none")
            {
                controlConfig.Key = ParseEnum <Key>(keyString);
            }
            else
            {
                controlConfig.Key = null;
            }

            controlConfig.MouseButton = ParseEnum <MouseButton>(buttonString);

            return(controlConfig);
        }
Пример #5
0
        private ControlConfig BuildNewControlConfig(InputControl2.ControlsChangedEventArgs newControlArgs)
        {
            ControlConfig newConfig = new ControlConfig();

            if (newControlArgs.NewControlKey != Keys.None)
            {
                Key?key = InputConfigurationHelper.ConvertKey(newControlArgs.NewControlKey);

                if (key != null)
                {
                    newConfig.Key = key;
                }
            }

            MouseButton button = InputConfigurationHelper.ConvertButton(newControlArgs.NewControlMouseButton);

            if (button != MouseButton.None)
            {
                newConfig.MouseButton = button;
            }

            return(newConfig);
        }
Пример #6
0
 private void InputDetectorViewZoom_ControlsChanged(InputControl2.ControlsChangedEventArgs args)
 {
     _tempViewZoomConfig = BuildNewControlConfig(args);
 }
Пример #7
0
 private void InputDetectorSelectSprite_ControlsChanged(InputControl2.ControlsChangedEventArgs args)
 {
     _tempSpriteSelectConfig = BuildNewControlConfig(args);
 }
Пример #8
0
 private void InputDetectorMoveCamera_ControlsChanged(InputControl2.ControlsChangedEventArgs args)
 {
     _tempCameraDragConfig = BuildNewControlConfig(args);
 }