Skip to content

Commit

Permalink
feeder: renamed from "application" to "simulator" for the format filt…
Browse files Browse the repository at this point in the history
…er and results
  • Loading branch information
stojy committed Aug 21, 2023
1 parent 7310ade commit c22fc70
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions ClrVpin/Feeder/FeederResults.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<ContentControl Template="{StaticResource KeyValueStringPair}" controls:GenericAttached.String="Name" controls:GenericAttached.String2="{Binding Name}"
Visibility="{Binding Name, Converter={StaticResource NullableToVisibilityConverter}}" />
<ContentControl Template="{StaticResource KeyValueStringPair}" controls:GenericAttached.String="Authors" />
<ContentControl Template="{StaticResource KeyValueStringPair}" controls:GenericAttached.String="Application" controls:GenericAttached.String2="{Binding TableFormat}" />
<ContentControl Template="{StaticResource KeyValueStringPair}" controls:GenericAttached.String="Simulator" controls:GenericAttached.String2="{Binding TableFormat}" />
<ContentControl Template="{StaticResource KeyValueStringPair}" controls:GenericAttached.String="Themes"
controls:GenericAttached.String2="{Binding Themes, Converter={StaticResource ListToStringConverter}}" />
<ContentControl Template="{StaticResource KeyValueStringPair}" controls:GenericAttached.String="Created" controls:GenericAttached.String2="{Binding CreatedAt}" />
Expand Down Expand Up @@ -334,9 +334,9 @@
</b:Interaction.Triggers>
</ComboBox>

<ComboBox ItemsSource="{Binding GameFiltersViewModel.ApplicationFormatsFilterView}"
SelectedItem="{Binding Path=Settings.SelectedApplicationFormatFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Application"
<ComboBox ItemsSource="{Binding GameFiltersViewModel.SimulatorFormatsFilterView}"
SelectedItem="{Binding Path=Settings.SelectedSimulatorFormatFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Simulator"
Style="{StaticResource ComboBoxStyle}"
Width="90" Margin="10,0,0,0"
ToolTip="Filter the tables based on the simulator application. Ignored for unmatched tables.">
Expand Down
6 changes: 3 additions & 3 deletions ClrVpin/Feeder/FeederResultsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public FeederResultsViewModel(IList<GameItem> gameItems, IList<LocalGame> localG
(Settings.SelectedYearBeginFilter == null || string.CompareOrdinal(gameItem.Year, 0, Settings.SelectedYearBeginFilter, 0, 50) >= 0) &&
(Settings.SelectedYearEndFilter == null || string.CompareOrdinal(gameItem.Year, 0, Settings.SelectedYearEndFilter, 0, 50) <= 0) &&
(Settings.SelectedTypeFilter == null || string.CompareOrdinal(gameItem.Type, 0, Settings.SelectedTypeFilter, 0, 50) == 0) &&
(Settings.SelectedApplicationFormatFilter == null || gameItem.OnlineGame?.TableFormats.Contains(Settings.SelectedApplicationFormatFilter) == true) &&
(Settings.SelectedSimulatorFormatFilter == null || gameItem.OnlineGame?.TableFormats.Contains(Settings.SelectedSimulatorFormatFilter) == true) &&
// gameItem.UpdatedAt is derived property that surfaces the 'max updated at' timestamps from ALL the different content and their underlying files
// - if a gameItem satisfies the 'updatedAt' filtering.. then all the gameItem's content (e.g. table, backglass, etc) and their file(s) will be available for viewing
Expand Down Expand Up @@ -405,8 +405,8 @@ private void UpdateOnlineGameFileDetails()
file.IsNew = false;
// - simulator application, aka file format, e.g. VPX, FP, etc
if (file.IsNew && Settings.SelectedApplicationFormatFilter != null && fileCollectionTypeEnum == OnlineFileTypeEnum.Tables &&
(file as TableFile)?.TableFormat != Settings.SelectedApplicationFormatFilter)
if (file.IsNew && Settings.SelectedSimulatorFormatFilter != null && fileCollectionTypeEnum == OnlineFileTypeEnum.Tables &&
(file as TableFile)?.TableFormat != Settings.SelectedSimulatorFormatFilter)
file.IsNew = false;
// flag each url within the file - required to allow for simpler view binding
Expand Down
4 changes: 2 additions & 2 deletions ClrVpin/Models/Settings/FeederSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public FeederSettings()
OnlineFileTypeEnum.DMDs.GetDescription(),
});

SelectedApplicationFormatFilter = ApplicationFormatEnum.VirtualPinballX;
SelectedSimulatorFormatFilter = ApplicationFormatEnum.VirtualPinballX;
}

public ObservableCollection<HitTypeEnum> SelectedMatchCriteriaOptions { get; set; } = new();
Expand All @@ -37,5 +37,5 @@ public FeederSettings()
public ObservableCollection<string> SelectedOnlineFileTypeOptions { get; set; } = new();
public ObservableCollection<MiscFeatureOptionEnum> SelectedMiscFeatureOptions { get; set; } = new ();

public string SelectedApplicationFormatFilter { get; set; }
public string SelectedSimulatorFormatFilter { get; set; }
}
6 changes: 3 additions & 3 deletions ClrVpin/Shared/GameFiltersViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public GameFiltersViewModel(ListCollectionView<GameItem> gameItemsView, IGameCol
public ListCollectionView<string> YearsBeginFilterView { get; private set; }
public ListCollectionView<string> YearsEndFilterView { get; private set; }
public ListCollectionView<string> TypesFilterView { get; private set; }
public ListCollectionView<string> ApplicationFormatsFilterView { get; private set; }
public ListCollectionView<string> SimulatorFormatsFilterView { get; private set; }
public ListCollectionView<FeatureType.FeatureType> PresetDateOptionsView { get; }
public ListCollectionView<FeatureType.FeatureType> TableManufacturedOptionsView { get; }

Expand All @@ -57,7 +57,7 @@ public void Refresh(int? debounceMilliseconds = null)
YearsBeginFilterView.RefreshDebounce(debounceMilliseconds);
YearsEndFilterView.RefreshDebounce(debounceMilliseconds);
TypesFilterView.RefreshDebounce(debounceMilliseconds);
ApplicationFormatsFilterView?.RefreshDebounce(debounceMilliseconds); // not used by all VMs, e.g. Explorer
SimulatorFormatsFilterView?.RefreshDebounce(debounceMilliseconds); // not used by all VMs, e.g. Explorer
}

// todo; improve: private method and only invoke once during initialization (i.e. don't recreate LCVs) using an ObservableCollection (from GameCollection) instead of List
Expand Down Expand Up @@ -96,7 +96,7 @@ public void UpdateFilterViews()

// table formats - vpx, fp, etc
// - only available via online
ApplicationFormatsFilterView = new ListCollectionView<string>(_gameCollections.Formats)
SimulatorFormatsFilterView = new ListCollectionView<string>(_gameCollections.Formats)
{
Filter = format => Filter(() => _gameItemsView.Any(x => x.OnlineGame?.TableFormats.Contains(format) == true))
};
Expand Down

0 comments on commit c22fc70

Please sign in to comment.