add setting to ignore influence support

This commit is contained in:
Florian Stinglmayr 2023-03-29 18:40:36 +02:00
parent f666a2c7c5
commit e39dd6ffda
3 changed files with 32 additions and 3 deletions

View File

@ -163,6 +163,7 @@
<TabItem Header="Settings">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
@ -201,6 +202,19 @@
<ComboBox x:Name="Colour" IsEditable="False" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Width="Auto" SelectionChanged="Colour_SelectionChanged"/>
</Grid>
</GroupBox>
<GroupBox Header="Advanced Parsing Options" Grid.Row="2" VerticalAlignment="Top" Width="Auto" Grid.ColumnSpan="3" Margin="0,5,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<mah:ToggleSwitch x:Name="NoInfluenceSupport" Grid.Row="1" Grid.ColumnSpan="2" Content="Ignore secondary influence support given out by certain missions" Toggled="NoInfluenceSupport_Toggled"/>
</Grid>
</GroupBox>
</Grid>
</TabItem>
<TabItem Header="Event Log">

View File

@ -58,6 +58,8 @@ public partial class MainWindow : MetroWindow {
LogType.SelectedIndex = 0;
}
this.NoInfluenceSupport.IsOn = Config.Global.IgnoreInfluenceSupport;
// Apply theme
try {
AddCustomThemes();
@ -165,8 +167,12 @@ public partial class MainWindow : MetroWindow {
private void HandleEntries(List<Entry> entries, DateTime start, DateTime end) {
try {
TransactionParser parser = new TransactionParser();
List<Transaction> transactions = parser.Parse(entries);
TransactionParser parser = new();
TransactionParserOptions options = new();
options.IgnoreInfluenceSupport = Config.Global.IgnoreInfluenceSupport;
List<Transaction> transactions = parser.Parse(entries, options);
// Filter the transactions down to the given time frame
transactions = transactions
@ -520,4 +526,8 @@ public partial class MainWindow : MetroWindow {
Process.Start(info);
e.Handled = true;
}
private void NoInfluenceSupport_Toggled(object sender, RoutedEventArgs e) {
Config.Global.IgnoreInfluenceSupport = this.NoInfluenceSupport.IsOn;
}
}

View File

@ -34,7 +34,7 @@ namespace EliteBGS.Util {
}
}
}
public string Colour {
get {
return colour;
@ -48,6 +48,11 @@ namespace EliteBGS.Util {
}
}
/// <summary>
/// Whether we ignore influence support scenarios form parsing.
/// </summary>
public bool IgnoreInfluenceSupport { get; set; } = false;
[JsonIgnore]
public string FullTheme {
get { return Theme + "." + Colour; }