add option to ignore power play to UI

This commit is contained in:
Florian Stinglmayr 2024-11-14 13:40:25 +01:00
parent 2905696641
commit d9dd2cc524
3 changed files with 13 additions and 1 deletions

View File

@ -262,6 +262,7 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -270,6 +271,7 @@
<mah:ToggleSwitch x:Name="NoInfluenceSupport" Grid.Row="0" Grid.ColumnSpan="2" Content="Ignore secondary influence support given out by certain missions" Toggled="NoInfluenceSupport_Toggled"/>
<mah:ToggleSwitch x:Name="NoMarketBuy" Grid.Row="1" Grid.ColumnSpan="2" Content="Ignore commodities bought at stations" Toggled="NoMarketBuy_Toggled"/>
<mah:ToggleSwitch x:Name="NoFleetCarrier" Grid.Row="2" Grid.ColumnSpan="2" Content="Ignore transactions done on a Fleet Carrier" Toggled="NoFleetCarrier_Toggled" />
<mah:ToggleSwitch x:Name="NoPowerplay" Grid.Row="3" Grid.ColumnSpan="2" Content="Ignore Powerplay Merits" Toggled="NoPowerplay_Toggled" />
</Grid>
</GroupBox>
<GroupBox Header="Discord Webhooks" Grid.Row="3" VerticalAlignment="Top" Width="Auto" Grid.ColumnSpan="3" Margin="0,5,0,0">

View File

@ -64,6 +64,7 @@ public partial class MainWindow : MetroWindow {
this.NoInfluenceSupport.IsOn = Config.Global.IgnoreInfluenceSupport;
this.NoMarketBuy.IsOn = Config.Global.IgnoreMarketBuy;
this.NoFleetCarrier.IsOn = Config.Global.IgnoreFleetCarrier;
this.NoPowerplay.IsOn = Config.Global.IgnorePowerplay;
// Apply theme
try {
@ -182,6 +183,7 @@ public partial class MainWindow : MetroWindow {
options.IgnoreInfluenceSupport = Config.Global.IgnoreInfluenceSupport;
options.IgnoreMarketBuy = Config.Global.IgnoreMarketBuy;
options.IgnoreFleetCarrierFaction = Config.Global.IgnoreFleetCarrier;
options.IgnorePowerplay = Config.Global.IgnorePowerplay;
List<Transaction> transactions = parser.Parse(entries, options);
@ -583,6 +585,10 @@ public partial class MainWindow : MetroWindow {
Config.Global.IgnoreFleetCarrier = this.NoFleetCarrier.IsOn;
}
private void NoPowerplay_Toggled(object sender, RoutedEventArgs e) {
Config.Global.IgnorePowerplay = this.NoPowerplay.IsOn;
}
private void OpenInExplorer_Click(object sender, RoutedEventArgs e) {
try {
Process.Start(new ProcessStartInfo(Config.Global.JournalLocation) {
@ -723,5 +729,4 @@ public partial class MainWindow : MetroWindow {
private void PostToAll_Click(object sender, RoutedEventArgs e) {
PostToDiscordWebhook(Config.Global.Webhooks);
}
}

View File

@ -67,6 +67,11 @@ public class AppConfig {
/// </summary>
public bool IgnoreFleetCarrier { get; set; } = true;
/// <summary>
/// Ignore power play?
/// </summary>
public bool IgnorePowerplay { get; set; } = true;
/// <summary>
/// List of Webhooks configured
/// </summary>