public InteractiveJoystickCommandDetailsControl(InteractiveJoystickCommand command) { this.command = command; this.Control = command.Joystick; InitializeComponent(); }
public InteractiveJoystickSetupTestDialogControl(InteractiveJoystickCommand command) { this.command = command; InitializeComponent(); this.Loaded += InteractiveJoystickSetupTestDialogControl_Loaded; }
public InteractiveJoystickCommandDetailsControl(InteractiveGameModel game, InteractiveGameVersionModel version, InteractiveJoystickCommand command) { this.Game = game; this.Version = version; this.command = command; this.Control = command.Joystick; InitializeComponent(); }
public override async Task <CommandBase> GetNewCommand() { if (await this.Validate()) { InteractiveJoystickSetupType setup = EnumHelper.GetEnumValueFromString <InteractiveJoystickSetupType>((string)this.JoystickSetupComboBox.SelectedItem); RequirementViewModel requirements = this.Requirements.GetRequirements(); if (this.command == null) { this.command = new InteractiveJoystickCommand(this.Game, this.Scene, this.Control, requirements); ChannelSession.Settings.InteractiveCommands.Add(this.command); } this.command.InitializeAction(); this.command.SetupType = setup; this.command.DeadZone = (double.Parse(this.JoystickDeadZoneTextBox.Text) / 100.0); this.command.MappedKeys.Clear(); if (setup == InteractiveJoystickSetupType.MouseMovement) { this.command.MouseMovementMultiplier = double.Parse(this.MouseMovementMultiplierTextBox.Text); } else if (setup == InteractiveJoystickSetupType.MapToIndividualKeys) { if (this.UpKeyComboBox.SelectedIndex >= 0) { this.command.MappedKeys.Add(EnumHelper.GetEnumValueFromString <InputKeyEnum>((string)this.UpKeyComboBox.SelectedItem)); } else { this.command.MappedKeys.Add(null); } if (this.RightKeyComboBox.SelectedIndex >= 0) { this.command.MappedKeys.Add(EnumHelper.GetEnumValueFromString <InputKeyEnum>((string)this.RightKeyComboBox.SelectedItem)); } else { this.command.MappedKeys.Add(null); } if (this.DownKeyComboBox.SelectedIndex >= 0) { this.command.MappedKeys.Add(EnumHelper.GetEnumValueFromString <InputKeyEnum>((string)this.DownKeyComboBox.SelectedItem)); } else { this.command.MappedKeys.Add(null); } if (this.LeftKeyComboBox.SelectedIndex >= 0) { this.command.MappedKeys.Add(EnumHelper.GetEnumValueFromString <InputKeyEnum>((string)this.LeftKeyComboBox.SelectedItem)); } else { this.command.MappedKeys.Add(null); } } this.command.Unlocked = this.UnlockedControl.Unlocked; this.command.Requirements = requirements; return(this.command); } return(null); }