示例#1
0
        private void ConfigurationWindowLoad(object sender, EventArgs e)
        {
            _lastCameraSpeedValue        = Configuration.CameraSpeed;
            _lastFilterModeSelectedIndex = Configuration.TextureFilterMode.Equals(TextureFilter.Point) ? 0 : 1;
            _lastFrameRectColor          = Configuration.FrameRectColor;
            _lastFrameRectHoveredColor   = Configuration.HoverFrameRectColor;
            _lastFrameRectSelectedColor  = Configuration.SelectedFrameRectColor;
            _lastBgColor = Configuration.BackgroundColor;

            txtCamSpeed.Text = _lastCameraSpeedValue.ToString();
            cmbTextureFilterMode.SelectedIndex = _lastFilterModeSelectedIndex;

            ColorPickerBg.SelectedColor = Configuration.BackgroundColor.ToColor();

            radAlphaMode.Checked = Configuration.OverwriteImageWhenTransparencyModified;

            radColorKeyMode.Checked = !radAlphaMode.Checked;

            chkPackSpriteSheet.Checked = Configuration.PackSpriteSheetWhenExportingSpriteMap;

            chkForcePowTwo.Checked = Configuration.ForcePowTwo;

            chkForceSquare.Checked = Configuration.ForceSquare;

            udPadding.Value = Configuration.Padding;

            ColorPickerFrameRect.SelectedColor = Configuration.FrameRectColor.ToColor();

            ColorPickerFrameRectHovered.SelectedColor = Configuration.HoverFrameRectColor.ToColor();

            ColorPickerFrameRectSelected.SelectedColor = Configuration.SelectedFrameRectColor.ToColor();

            InputConfigurationHelper.LoadCurrentControlConfigIntoInputControl(Configuration.DragCameraControl,
                                                                              InputDetectorMoveCamera);

            InputConfigurationHelper.LoadCurrentControlConfigIntoInputControl(Configuration.SpriteMarkUpControl,
                                                                              InputDetectorMarkupSprite);

            InputConfigurationHelper.LoadCurrentControlConfigIntoInputControl(Configuration.SelectSpriteControl,
                                                                              InputDetectorSelectSprite);

            InputConfigurationHelper.LoadCurrentControlConfigIntoInputControl(Configuration.ViewZoomControl,
                                                                              InputDetectorViewZoom);

            txtCamSpeed.Focus();
        }
示例#2
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);
        }