Merge branch 'jay' of https://github.com/mika-n/DS4Windows into mika-n-jay

This commit is contained in:
Travis Nickles 2020-01-04 15:50:18 -06:00
commit be601e2aef
3 changed files with 19 additions and 1 deletions

View File

@ -39,6 +39,10 @@
<Button x:Name="recordBtn" Content="{lex:Loc RecordText}" Margin="0,10,0,0" Click="RecordBtn_Click" />
<UniformGrid Rows="1" Columns="2" FirstColumn="1" Margin="0,10,0,0">
<Button x:Name="clearStepsBtn" Content="{lex:Loc Clear}" Margin="5,00,0,0" Click="ClearStepsBtn_Click" />
</UniformGrid>
<UniformGrid Rows="1" Margin="0,10,0,0">
<Button x:Name="loadPresetBtn" Content="Load Preset" Margin="0,0,5,0" Click="LoadPresetBtn_Click">
<Button.ContextMenu>

View File

@ -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()

View File

@ -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()