Compare commits
6 Commits
f45c41cec7
...
644fad649b
Author | SHA1 | Date | |
---|---|---|---|
644fad649b | |||
c34cb17c52 | |||
c9cb3e26e0 | |||
654444d39c | |||
561db29394 | |||
d789c75116 |
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -8,7 +9,7 @@ namespace EliteBGS.BGS {
|
||||
public class GenericDiscordLog : IDiscordLogGenerator {
|
||||
private string FormatDate() {
|
||||
DateTime today = DateTime.Now;
|
||||
return today.ToShortDateString();
|
||||
return today.ToString("dd/MM/yyyy");
|
||||
}
|
||||
|
||||
private string BuildCartoGraphics(Objective objective) {
|
||||
@ -24,7 +25,7 @@ namespace EliteBGS.BGS {
|
||||
}
|
||||
|
||||
return string.Format("Sold {0} page(s) worth of universal cartographics\n" +
|
||||
"(Total value: {1})\n", pages, Credits.FormatCredits(sum));
|
||||
"(Total value: {1})\n\n", pages, Credits.FormatCredits(sum));
|
||||
}
|
||||
|
||||
private string BuildCargoSold(Objective objective) {
|
||||
@ -164,6 +165,17 @@ 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);
|
||||
}
|
||||
|
@ -2,11 +2,13 @@
|
||||
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;
|
||||
@ -20,7 +22,8 @@ namespace EliteBGS.BGS {
|
||||
}
|
||||
|
||||
date.AppendFormat("{0} {1}{2}, {3}",
|
||||
today.ToString("MMMM"), today.Day, suffix,
|
||||
cultureInfo.DateTimeFormat.GetMonthName(today.Month),
|
||||
today.Day, suffix,
|
||||
today.Year + EliteDangerous.YearOffset
|
||||
);
|
||||
|
||||
@ -40,7 +43,9 @@ namespace EliteBGS.BGS {
|
||||
}
|
||||
|
||||
return string.Format("Sold {0} page(s) worth of universal cartographics\n" +
|
||||
"(Total value: {1})\n", pages, Credits.FormatCredits(sum));
|
||||
"(Total value: {1})\n\n",
|
||||
pages, Credits.FormatCredits(sum)
|
||||
);
|
||||
}
|
||||
|
||||
private string BuildCargoSold(Objective objective) {
|
||||
@ -160,6 +165,17 @@ 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);
|
||||
}
|
||||
|
@ -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" />
|
||||
<ComboBox x:Name="LogType" Height="36" Margin="0" VerticalAlignment="Center" Width="140" SelectionChanged="LogType_SelectionChanged" />
|
||||
</ToolBar>
|
||||
<TextBox x:Name="DiscordLog" Height="Auto" TextWrapping="Wrap" FontFamily="Consolas" FontSize="14" Grid.Row="1" Grid.ColumnSpan="3" AcceptsReturn="True" AcceptsTab="True"/>
|
||||
</Grid>
|
||||
|
@ -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<IDiscordLogGenerator> logtypes = new List<IDiscordLogGenerator>() {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user