Compare commits

..

No commits in common. "644fad649bda5ef9dc414f89d9884fa0d8f39469" and "f45c41cec7c9dee7ba92bbd15e37d88e6042569a" have entirely different histories.

5 changed files with 8 additions and 69 deletions

View File

@ -1,5 +1,4 @@
using System;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -9,7 +8,7 @@ namespace EliteBGS.BGS {
public class GenericDiscordLog : IDiscordLogGenerator {
private string FormatDate() {
DateTime today = DateTime.Now;
return today.ToString("dd/MM/yyyy");
return today.ToShortDateString();
}
private string BuildCartoGraphics(Objective objective) {
@ -25,7 +24,7 @@ namespace EliteBGS.BGS {
}
return string.Format("Sold {0} page(s) worth of universal cartographics\n" +
"(Total value: {1})\n\n", pages, Credits.FormatCredits(sum));
"(Total value: {1})\n", pages, Credits.FormatCredits(sum));
}
private string BuildCargoSold(Objective objective) {
@ -165,17 +164,6 @@ namespace EliteBGS.BGS {
output.Append(")\n\n");
}
var support = objective.LogEntries.OfType<InfluenceSupport>();
foreach (InfluenceSupport inf in support) {
output.Append(inf.ToString());
output.Append("\n");
total_influence += inf.Influence.Length;
}
if (support.Count() > 0) {
output.Append("\n");
}
if (total_influence > 0) {
output.AppendFormat("Total Influence: {0}\n\n", total_influence);
}

View File

@ -2,13 +2,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using EDJournal;
namespace EliteBGS.BGS {
public class NonaDiscordLog : IDiscordLogGenerator {
private string FormatDate() {
CultureInfo cultureInfo = CultureInfo.InvariantCulture;
StringBuilder date = new StringBuilder();
DateTime today = DateTime.Now;
string suffix;
@ -22,8 +20,7 @@ namespace EliteBGS.BGS {
}
date.AppendFormat("{0} {1}{2}, {3}",
cultureInfo.DateTimeFormat.GetMonthName(today.Month),
today.Day, suffix,
today.ToString("MMMM"), today.Day, suffix,
today.Year + EliteDangerous.YearOffset
);
@ -43,9 +40,7 @@ namespace EliteBGS.BGS {
}
return string.Format("Sold {0} page(s) worth of universal cartographics\n" +
"(Total value: {1})\n\n",
pages, Credits.FormatCredits(sum)
);
"(Total value: {1})\n", pages, Credits.FormatCredits(sum));
}
private string BuildCargoSold(Objective objective) {
@ -165,17 +160,6 @@ namespace EliteBGS.BGS {
output.Append(")\n\n");
}
var support = objective.LogEntries.OfType<InfluenceSupport>();
foreach (InfluenceSupport inf in support) {
output.Append(inf.ToString());
output.Append("\n");
total_influence += inf.Influence.Length;
}
if (support.Count() > 0) {
output.Append("\n");
}
if (total_influence > 0) {
output.AppendFormat("Total Influence: {0}\n\n", total_influence);
}

View File

@ -86,7 +86,7 @@
<ToolBar HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="Auto" Grid.ColumnSpan="2">
<Button x:Name="GenerateDiscord" Content="Generate Discord Report" VerticalAlignment="Center" Margin="0,0,0,4.857" Click="GenerateDiscord_Click" Height="26"/>
<Separator />
<ComboBox x:Name="LogType" Height="36" Margin="0" VerticalAlignment="Center" Width="140" SelectionChanged="LogType_SelectionChanged" />
<ComboBox x:Name="LogType" Height="36" Margin="0" VerticalAlignment="Center" Width="140" />
</ToolBar>
<TextBox x:Name="DiscordLog" Height="Auto" TextWrapping="Wrap" FontFamily="Consolas" FontSize="14" Grid.Row="1" Grid.ColumnSpan="3" AcceptsReturn="True" AcceptsTab="True"/>
</Grid>

View File

@ -1,6 +1,4 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@ -29,11 +27,6 @@ namespace EliteBGS {
public Report Report => report;
private static readonly List<IDiscordLogGenerator> logtypes = new List<IDiscordLogGenerator>() {
new NonaDiscordLog(),
new GenericDiscordLog(),
};
public MainWindow() {
InitializeComponent();
@ -45,17 +38,9 @@ namespace EliteBGS {
report.OnLog += Report_OnLog;
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.Items.Add(new NonaDiscordLog());
LogType.Items.Add(new GenericDiscordLog());
LogType.SelectedIndex = 0;
}
api = new API(config.ConfigPath);
journal = new PlayerJournal(config.Global.JournalLocation);
@ -312,14 +297,5 @@ 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;
}
}
}

View File

@ -5,7 +5,6 @@ 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;
@ -17,14 +16,6 @@ namespace EliteBGS.Util {
}
}
public string LastUsedDiscordTemplate {
get => lastdiscordlog;
set {
lastdiscordlog = value;
FirePropertyChanged("LastUsedDiscordTemplate");
}
}
public string JournalLocation {
get {
if (journal_location == null) {