Skip to content

Commit

Permalink
- Adding settings option to not show the "No Data" error message if t…
Browse files Browse the repository at this point in the history
…here is no tracked data for the End Credits Overlay Widget
  • Loading branch information
Matthew Olivo committed Oct 11, 2024
1 parent 56c6ea1 commit 9940d53
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 14 deletions.
7 changes: 6 additions & 1 deletion MixItUp.Base/Model/Overlay/OverlayEndCreditsV3Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ public class OverlayEndCreditsV3Model : OverlayEventTrackingV3ModelBase
public bool RunCreditsWhenVisible { get; set; }
[DataMember]
public bool RunEndlessly { get; set; }
[DataMember]
public bool DontShowNoDataError { get; set; }

[DataMember]
public List<OverlayEndCreditsSectionV3Model> Sections { get; set; } = new List<OverlayEndCreditsSectionV3Model>();
Expand Down Expand Up @@ -589,7 +591,10 @@ public async Task PlayCredits()
}
else
{
await ServiceManager.Get<ChatService>().SendMessage(Resources.OverlayWidgetEndCreditsNoDataCurrentlyAvailable);
if (!this.DontShowNoDataError)
{
await ServiceManager.Get<ChatService>().SendMessage(Resources.OverlayWidgetEndCreditsNoDataCurrentlyAvailable);
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions MixItUp.Base/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions MixItUp.Base/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -10790,4 +10790,7 @@ We have detected that you have more than 1 Overlay Endpoint created, meaning the
<data name="OverlayWidgetEndCreditsNoDataCurrentlyAvailable" xml:space="preserve">
<value>ERROR: End Credits Overlay Widget could not be run because there is not currently captured data from this session.</value>
</data>
<data name="DontShowNoDataError" xml:space="preserve">
<value>Don't Show "No Data" Error</value>
</data>
</root>
13 changes: 13 additions & 0 deletions MixItUp.Base/ViewModel/Overlay/OverlayEndCreditsV3ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,17 @@ public bool RunEndlessly
}
private bool runEndlessly;

public bool DontShowNoDataError
{
get { return this.dontShowNoDataError; }
set
{
this.dontShowNoDataError = value;
this.NotifyPropertyChanged();
}
}
private bool dontShowNoDataError;

public string BackgroundColor
{
get { return this.backgroundColor; }
Expand Down Expand Up @@ -372,6 +383,7 @@ public OverlayEndCreditsV3ViewModel(OverlayEndCreditsV3Model item)
this.BackgroundColor = item.BackgroundColor;
this.RunCreditsWhenVisible = item.RunCreditsWhenVisible;
this.RunEndlessly = item.RunEndlessly;
this.DontShowNoDataError = item.DontShowNoDataError;

this.StartedCommand = this.GetEmbeddedCommand(item.StartedCommandID, Resources.Started);
this.EndedCommand = this.GetEmbeddedCommand(item.EndedCommandID, Resources.Ended);
Expand Down Expand Up @@ -467,6 +479,7 @@ protected override OverlayItemV3ModelBase GetItemInternal()
result.BackgroundColor = this.BackgroundColor;
result.RunCreditsWhenVisible = this.RunCreditsWhenVisible;
result.RunEndlessly = this.RunEndlessly;
result.DontShowNoDataError = this.DontShowNoDataError;

foreach (OverlayEndCreditsSectionV3ViewModel section in this.Sections)
{
Expand Down
37 changes: 24 additions & 13 deletions MixItUp.WPF/Controls/Overlay/OverlayEndCreditsV3Control.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,8 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="200" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<ComboBox Grid.Column="0" ItemsSource="{Binding ScrollSpeeds}" SelectedItem="{Binding SelectedScrollSpeed}" MaterialDesign:HintAssist.Hint="{x:Static resx:Resources.ScrollSpeed}" Style="{StaticResource MaterialDesignFloatingHintComboBox}">
Expand All @@ -193,23 +188,39 @@
</ComboBox>

<TextBox Text="{Binding BackgroundColor}" Grid.Column="2" MaterialDesign:HintAssist.Hint="{x:Static resx:Resources.BackgroundColor}" Style="{StaticResource MaterialDesignFloatingHintTextBox}" />

<TextBlock Grid.Column="4" VerticalAlignment="Center" Text="{Binding Source={x:Static resx:Resources.RunCreditsWhenVisible}, StringFormat={x:Static resx:Resources.ColumnHeaderFormat}}" />
<CheckBox Grid.Column="5" IsChecked="{Binding RunCreditsWhenVisible}" VerticalAlignment="Center" Margin="5,0,0,0" />
</Grid>

<Grid Grid.Row="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<TextBlock Grid.Column="0" VerticalAlignment="Center" Text="{Binding Source={x:Static resx:Resources.RunCreditsWhenVisible}, StringFormat={x:Static resx:Resources.ColumnHeaderFormat}}" />
<CheckBox Grid.Column="1" IsChecked="{Binding RunCreditsWhenVisible}" VerticalAlignment="Center" Margin="5,0,0,0" />

<TextBlock Grid.Column="3" VerticalAlignment="Center" Text="{Binding Source={x:Static resx:Resources.RunEndlessly}, StringFormat={x:Static resx:Resources.ColumnHeaderFormat}}" />
<CheckBox Grid.Column="4" IsChecked="{Binding RunEndlessly}" VerticalAlignment="Center" Margin="5,0,0,0" />

<TextBlock Grid.Column="7" VerticalAlignment="Center" Text="{Binding Source={x:Static resx:Resources.RunEndlessly}, StringFormat={x:Static resx:Resources.ColumnHeaderFormat}}" />
<CheckBox Grid.Column="8" IsChecked="{Binding RunEndlessly}" VerticalAlignment="Center" Margin="5,0,0,0" />
<TextBlock Grid.Column="6" VerticalAlignment="Center" Text="{Binding Source={x:Static resx:Resources.DontShowNoDataError}, StringFormat={x:Static resx:Resources.ColumnHeaderFormat}}" />
<CheckBox Grid.Column="7" IsChecked="{Binding DontShowNoDataError}" VerticalAlignment="Center" Margin="5,0,0,0" />
</Grid>

<Grid Grid.Row="6" HorizontalAlignment="Center">
<Grid Grid.Row="8" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<Button Command="{Binding AddSectionCommand}" Content="{x:Static resx:Resources.AddSection}" />
</Grid>

<ItemsControl Grid.Row="8" ItemsSource="{Binding Sections}">
<ItemsControl Grid.Row="10" ItemsSource="{Binding Sections}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Controls:AccordianGroupBoxControl>
Expand Down

0 comments on commit 9940d53

Please sign in to comment.