diff --git a/EliteBGS/MainWindow.xaml b/EliteBGS/MainWindow.xaml
index 221a930..afb480e 100644
--- a/EliteBGS/MainWindow.xaml
+++ b/EliteBGS/MainWindow.xaml
@@ -43,8 +43,6 @@
-
-
@@ -58,19 +56,34 @@
>
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EliteBGS/MainWindow.xaml.cs b/EliteBGS/MainWindow.xaml.cs
index 80f8620..4eaf7b6 100644
--- a/EliteBGS/MainWindow.xaml.cs
+++ b/EliteBGS/MainWindow.xaml.cs
@@ -202,55 +202,23 @@ public partial class MainWindow : Window {
journal = new PlayerJournal(Config.Global.JournalLocation);
}
- ///
- /// Gets the currently selected objective, even if a log entry in said objective
- /// is selected instead. If nothing is selected, returns null.
- ///
- ///
- private Objective GetSelectedObjective() {
- var obj = entries.SelectedItem;
-
- if (obj == null) {
- return null;
- }
-
- if (obj.GetType() == typeof(Objective)) {
- return obj as Objective;
- }
-
- // Some form of entry perhaps?
- if (obj.GetType().IsSubclassOf(typeof(Transaction))) {
- Transaction entry = obj as Transaction;
- Objective objective = entries.Items
- .OfType()
- .First(x => x.Transactions.Contains(entry))
- ;
-
- return objective;
- }
-
- return null;
- }
-
private void AddCombatZone_Click(object sender, RoutedEventArgs e) {
- Objective objective = GetSelectedObjective();
-
- if (objective == null) {
+ System.Windows.Controls.Control control = sender as System.Windows.Controls.Control;
+ if (control == null || control.DataContext == null) {
return;
}
- CombatZoneDialog dialog = new CombatZoneDialog() { Owner = this };
-
- if (!(dialog.ShowDialog() ?? false)) {
+ Objective objective = control.DataContext as Objective;
+ if (objective == null) {
return;
}
CombatZone zone = new CombatZone {
Faction = objective.Faction,
System = objective.System,
- Grade = dialog.Grade,
- Type = dialog.Type,
- Amount = dialog.Amount
+ Grade = "Low",
+ Type = "Ship",
+ Amount = 1
};
UITransaction uitransaction = new UITransaction(zone);