diff --git a/DS4Windows/DS4Forms/RecordBox.xaml b/DS4Windows/DS4Forms/RecordBox.xaml index 6fcc38e..055473a 100644 --- a/DS4Windows/DS4Forms/RecordBox.xaml +++ b/DS4Windows/DS4Forms/RecordBox.xaml @@ -39,6 +39,10 @@ + + + + diff --git a/DS4Windows/DS4Forms/RecordBox.xaml.cs b/DS4Windows/DS4Forms/RecordBox.xaml.cs index 29ac8bd..ada2f99 100644 --- a/DS4Windows/DS4Forms/RecordBox.xaml.cs +++ b/DS4Windows/DS4Forms/RecordBox.xaml.cs @@ -136,7 +136,8 @@ namespace DS4WinWPF.DS4Forms recordBtn.Content = "Stop"; if (recordBoxVM.MacroStepIndex == -1) { - recordBoxVM.MacroSteps.Clear(); + // Don't clear macro steps in RECORD button because nowadays there is a separate CLEAR button. RECORD btn without a selection appends new steps to existing macro sequence + //recordBoxVM.MacroSteps.Clear(); } else { @@ -192,6 +193,15 @@ namespace DS4WinWPF.DS4Forms recordBoxVM.MacroStepIndex = -1; } + private void ClearStepsBtn_Click(object sender, RoutedEventArgs e) + { + if (!recordBoxVM.Recording) + { + recordBoxVM.MacroStepIndex = -1; + recordBoxVM.MacroSteps.Clear(); + } + } + private void Enable_Controls(bool on) { macroListBox.IsEnabled = on; @@ -201,6 +211,7 @@ namespace DS4WinWPF.DS4Forms loadPresetBtn.IsEnabled = on; savePresetBtn.IsEnabled = on; macroModeCombo.IsEnabled = on; + clearStepsBtn.IsEnabled = on; } private void ChangeLightbarAction() diff --git a/DS4Windows/DS4Forms/ViewModels/RecordBoxViewModel.cs b/DS4Windows/DS4Forms/ViewModels/RecordBoxViewModel.cs index f2a038e..1b4485d 100644 --- a/DS4Windows/DS4Forms/ViewModels/RecordBoxViewModel.cs +++ b/DS4Windows/DS4Forms/ViewModels/RecordBoxViewModel.cs @@ -108,6 +108,9 @@ namespace DS4WinWPF.DS4Forms.ViewModels } BindingOperations.EnableCollectionSynchronization(macroSteps, _colLockobj); + + // By default RECORD button appends new steps. User must select (click) an existing step to insert new steps in front of the selected step + this.MacroStepIndex = -1; } public void LoadMacro()