diff --git a/MainWindow.xaml b/MainWindow.xaml
index 17f1462..f1b15b9 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -86,7 +86,7 @@
-
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index c533a2c..33b2609 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -1,4 +1,6 @@
using System;
+using System.Linq;
+using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@@ -27,6 +29,11 @@ namespace EliteBGS {
public Report Report => report;
+ private static readonly List logtypes = new List() {
+ new NonaDiscordLog(),
+ new GenericDiscordLog(),
+ };
+
public MainWindow() {
InitializeComponent();
@@ -38,9 +45,17 @@ namespace EliteBGS {
report.OnLog += Report_OnLog;
- LogType.Items.Add(new NonaDiscordLog());
- LogType.Items.Add(new GenericDiscordLog());
- LogType.SelectedIndex = 0;
+ foreach (IDiscordLogGenerator type in logtypes) {
+ LogType.Items.Add(type);
+ }
+
+ string lastused = config.Global.LastUsedDiscordTemplate;
+ int lastindex = logtypes.FindIndex(x => x.ToString() == lastused);
+ if (lastindex > -1) {
+ LogType.SelectedIndex = lastindex;
+ } else {
+ LogType.SelectedIndex = 0;
+ }
api = new API(config.ConfigPath);
journal = new PlayerJournal(config.Global.JournalLocation);
@@ -297,5 +312,14 @@ namespace EliteBGS {
RefreshObjectives();
}
}
+
+ private void LogType_SelectionChanged(object sender, SelectionChangedEventArgs e) {
+ if (LogType.SelectedItem == null) {
+ return;
+ }
+
+ string template = LogType.SelectedItem.ToString();
+ config.Global.LastUsedDiscordTemplate = template;
+ }
}
}
diff --git a/Util/AppConfig.cs b/Util/AppConfig.cs
index 99a8bf6..eac9c76 100644
--- a/Util/AppConfig.cs
+++ b/Util/AppConfig.cs
@@ -5,6 +5,7 @@ namespace EliteBGS.Util {
private static readonly string default_journal_location = "%UserProfile%\\Saved Games\\Frontier Developments\\Elite Dangerous";
private string journal_location = default_journal_location;
private bool useeddb = false;
+ private string lastdiscordlog;
public string DefaultJournalLocation => default_journal_location;
@@ -16,6 +17,14 @@ namespace EliteBGS.Util {
}
}
+ public string LastUsedDiscordTemplate {
+ get => lastdiscordlog;
+ set {
+ lastdiscordlog = value;
+ FirePropertyChanged("LastUsedDiscordTemplate");
+ }
+ }
+
public string JournalLocation {
get {
if (journal_location == null) {