diff --git a/EliteBGS/DiscordLogGenerator.cs b/EliteBGS/DiscordLogGenerator.cs index 99d1188..6d54642 100644 --- a/EliteBGS/DiscordLogGenerator.cs +++ b/EliteBGS/DiscordLogGenerator.cs @@ -44,8 +44,16 @@ public class DiscordLogGenerator { location = "Unknown Location"; } + int legacycount = objective.Transactions + .Where(x => x.IsLegacy) + .Count() + ; + log.AppendFormat("**Date:** {0}\n", DateTime.Now.ToString("dd/MM/yyyy")); log.AppendFormat("**Target:** {0}\n", location); + if (legacycount > 0) { + log.AppendFormat("**Warning:** Some actions were performed on ED Legacy"); + } log.AppendLine(""); log.AppendLine("```"); diff --git a/EliteBGS/MainWindow.xaml.cs b/EliteBGS/MainWindow.xaml.cs index f652d00..80f8620 100644 --- a/EliteBGS/MainWindow.xaml.cs +++ b/EliteBGS/MainWindow.xaml.cs @@ -299,7 +299,7 @@ public partial class MainWindow : Window { } private TransactionType GetTransaction(object sender) where TransactionType : Transaction { - System.Windows.Controls.Control? button = sender as System.Windows.Controls.Control; + System.Windows.Controls.Control button = sender as System.Windows.Controls.Control; if (button == null || button.DataContext == null) { return null; } diff --git a/EliteBGS/NonaDiscordLog.cs b/EliteBGS/NonaDiscordLog.cs index 789ff6d..eb1a3a5 100644 --- a/EliteBGS/NonaDiscordLog.cs +++ b/EliteBGS/NonaDiscordLog.cs @@ -2,6 +2,7 @@ using System.Text; using System.Globalization; using EDPlayerJournal; +using System.Linq; namespace EliteBGS.BGS; @@ -44,7 +45,15 @@ public class NonaDiscordLog : DiscordLogGenerator { location = "Unknown Location"; } + int legacycount = objective.Transactions + .Where(x => x.IsLegacy) + .Count() + ; + log.AppendFormat(":globe_with_meridians: `Target:` {0}\n", location); + if (legacycount > 0) { + log.Append(":rotating_light: `Warning`: Some actions were done in E:D Legacy\n"); + } log.Append(":clipboard: `Conducted:`\n"); log.Append("```"); diff --git a/EliteBGS/Objective.cs b/EliteBGS/Objective.cs index 27fcd66..c1f0e88 100644 --- a/EliteBGS/Objective.cs +++ b/EliteBGS/Objective.cs @@ -27,7 +27,7 @@ public class UITransaction { public Visibility IsShipCombatZone { get { - CombatZone? combat = Transaction as CombatZone; + CombatZone combat = Transaction as CombatZone; if (combat == null) { return Visibility.Hidden; } @@ -40,9 +40,9 @@ public class UITransaction { } } - public bool? HasSpecOps { + public bool HasSpecOps { get { - CombatZone? combat = Transaction as CombatZone; + CombatZone combat = Transaction as CombatZone; if (combat == null) { return false; } @@ -50,7 +50,7 @@ public class UITransaction { return combat.SpecOps ?? false; } set { - CombatZone? combat = Transaction as CombatZone; + CombatZone combat = Transaction as CombatZone; if (combat == null) { return; } @@ -59,9 +59,9 @@ public class UITransaction { } } - public bool? HasCapitalShip { + public bool HasCapitalShip { get { - CombatZone? combat = Transaction as CombatZone; + CombatZone combat = Transaction as CombatZone; if (combat == null) { return false; } @@ -69,7 +69,7 @@ public class UITransaction { return combat.CapitalShip ?? false; } set { - CombatZone? combat = Transaction as CombatZone; + CombatZone combat = Transaction as CombatZone; if (combat == null) { return; } @@ -78,9 +78,9 @@ public class UITransaction { } } - public bool? HasCaptain { + public bool HasCaptain { get { - CombatZone? combat = Transaction as CombatZone; + CombatZone combat = Transaction as CombatZone; if (combat == null) { return false; } @@ -88,7 +88,7 @@ public class UITransaction { return combat.Captain ?? false; } set { - CombatZone? combat = Transaction as CombatZone; + CombatZone combat = Transaction as CombatZone; if (combat == null) { return; } @@ -97,9 +97,9 @@ public class UITransaction { } } - public bool? HasCorrespondent { + public bool HasCorrespondent { get { - CombatZone? combat = Transaction as CombatZone; + CombatZone combat = Transaction as CombatZone; if (combat == null) { return false; } @@ -107,7 +107,7 @@ public class UITransaction { return combat.Correspondent ?? false; } set { - CombatZone? combat = Transaction as CombatZone; + CombatZone combat = Transaction as CombatZone; if (combat == null) { return; }