21 Commits
0.2.6 ... 0.3.0

Author SHA1 Message Date
1a8c163fc4 update readmes to include mahapps 2023-02-26 10:24:01 +01:00
7b7fdf0ceb update README 2023-02-26 10:21:55 +01:00
bf86ce3fe8 update documentation 2023-02-26 10:20:11 +01:00
bbf3d6c6a4 add another mission name 2023-02-26 10:10:48 +01:00
d1c232df9d if there is a bug, use a default skin 2023-02-26 10:09:50 +01:00
82281ecf1b English is hard 2023-02-25 18:14:00 +01:00
7bf2b028c3 add link to homepage & source code to window 2023-02-25 18:12:33 +01:00
d2300fa088 update package information 2023-02-25 17:54:42 +01:00
32d7bccadc update changelog 2023-02-25 17:51:23 +01:00
831bf38e78 sort combat zones 2023-02-25 17:48:01 +01:00
e864db8488 add english names 2023-02-25 17:41:51 +01:00
0250878ee7 add more english names 2023-02-25 11:00:25 +01:00
5120c7991f implement a summary line
For Pony's bot, implement a summary line that just shows the highlights of the log
2023-02-23 21:44:55 +01:00
3c1abe5e8c change colour 2023-02-23 20:57:43 +01:00
637b4f85d0 use brighter colour 2023-02-23 20:57:28 +01:00
53bf0d22b8 add custom themes for NovaNavy & Salus 2023-02-23 20:55:17 +01:00
1c0c864e62 remove exo biology from reports
Multiple confirmations tell that the exo biology donations don't affect BGS at all.
2023-02-22 20:51:51 +01:00
52aa2706c0 switch to MahApps controls and style
Why didn't I find this sooner?
2023-02-22 20:39:40 +01:00
fd10b86c79 add more mission names 2023-02-22 18:25:12 +01:00
2f8d32f57a add some more mission names 2023-02-13 17:26:20 +01:00
926150cd18 update webpage with releases from CodeBerg 2023-02-04 16:15:42 +01:00
34 changed files with 615 additions and 83 deletions

View File

@@ -38,4 +38,23 @@ public class CombatZones {
/// Very high difficulty, so far AX combat zone only
/// </summary>
public static readonly string DifficultyVeryHigh = "Very High";
/// <summary>
/// Returns the given combat zone difficulty as an integer, so it can be sorted.
/// 0 = lowest difficulty, 1 = medium and so forth.
/// </summary>
public static int? DifficultyRank(string difficulty) {
Dictionary<string, int> ranks = new() {
{ DifficultyLow, 0 },
{ DifficultyMedium, 1 },
{ DifficultyHigh, 2 },
{ DifficultyVeryHigh, 3 }
};
if (ranks.TryGetValue(difficulty, out int rank)) {
return rank;
}
return null;
}
}

View File

@@ -34,4 +34,16 @@ public class Credits {
return string.Format("{0} CR", amount.ToString("N", format));
}
public static string FormatMillions(long amount) {
double millions = (amount / 1000000.0);
if (amount >= 100000) {
return string.Format("{0:0.0}M", millions);
} else if (amount >= 10000) {
return string.Format("{0:0.00}M", millions);
}
return "";
}
}

View File

@@ -51,6 +51,7 @@ public class EnglishMissionNames {
{"Mission_Delivery_Retreat_name", "Delivery (Retreat)"},
{"Mission_DeliveryWing_name", "Delivery (Wing)"},
{"Mission_DeliveryWing_War_name", "Delivery (Wing) (War)"},
{"MISSION_Disable_BLOPS_name", "Disable (Black Ops)" },
{"Mission_Hack_BLOPS_Boom_name", "Hack Surface Installation (Boom)"},
{"Mission_Hack_BLOPS_Elections_name", "Hack Surface Installation (Elections)"},
{"Mission_Hack_BLOPS_Expansion_name", "Hack Surface Installation (Expansion)"},
@@ -65,10 +66,13 @@ public class EnglishMissionNames {
{"Mission_MassacreWing_name", "Massacre (Wing)"},
{"Mission_Mining_name", "Mining" },
{"Mission_OnFoot_Assassination_MB_name", "On Foot Assassination"},
{"Mission_OnFoot_Assassination_Hard_MB_name", "On Foot Assassination (Flight-Risk)" },
{"Mission_OnFoot_Assassination_Covert_MB_name", "On Foot Assassination (Covert)" },
{"Mission_OnFoot_AssassinationIllegal_MB_name", "On Foot Assassination (Illegal)"},
{"Mission_OnFoot_AssassinationIllegal_NCD_MB_name", "On Foot Assassination (Illegal)" },
{"Mission_OnFoot_Collect_Contact_MB_name", "On Foot Collect"},
{"Mission_OnFoot_Collect_MB_name", "On Foot Collection"},
{"Mission_OnFoot_Defence_MacGuffin_MB_StandardCanister_name", "On Foot Cargo Defence" },
{"Mission_OnFoot_Delivery_Contact_MB_name", "On Foot Delivery (Contact)"},
{"Mission_OnFoot_Hack_Upload_Covert_MB_name", "On Foot Hack (Covert Upload)"},
{"Mission_OnFoot_Hack_Upload_MB_name", "On Foot Hack (Upload)"},
@@ -82,7 +86,10 @@ public class EnglishMissionNames {
{"Mission_OnFoot_ProductionHeist_MB_name", "On Foot Production Heist"},
{"Mission_OnFoot_Reboot_MB_name", "On Foot Reboot"},
{"Mission_OnFoot_RebootRestore_MB_name", "On Foot Reboot/Restore"},
{"Mission_OnFoot_Sabotage_Production_Covert_MB_name", "On Foot Sabotage Production (Covert)"},
{"Mission_OnFoot_Sabotage_Power_MB_name", "On Foot Power Sabotage"},
{"Mission_OnFoot_Sabotage_Power_Covert_MB_name", "On Foot Power Sabotage (Covert)"},
{"Mission_OnFoot_Sabotage_Production_MB_name", "On Foot Production Sabotage"},
{"Mission_OnFoot_Sabotage_Production_Covert_MB_name", "On Foot Production Sabotage (Covert)"},
{"Mission_OnFoot_Salvage_MB_name", "On Foot Salvage"},
{"Mission_OnFoot_SalvageIllegal_MB_name", "On Foot Salvage (Illegal)"},
{"Mission_OnFoot_Smuggle_Contact_MB_name", "On Foot Smuggling" },
@@ -106,11 +113,13 @@ public class EnglishMissionNames {
{"Mission_Sightseeing_Criminal_FAMINE_name", "Sightseeing (Criminal) (Famine)"},
{"Mission_Sightseeing_name", "Sightseeing"},
{"Mission_Smuggle_Anarchy_name", "Smuggling (Anarchy)" },
{"Mission_TW_Massacre_Basilisk_Plural_name", "Kill Basilisk" },
{"Mission_TW_Massacre_Basilisk_Plural_name", "Kill Basilisks" },
{"Mission_TW_Massacre_Basilisk_Singular_name", "Kill Basilisk" },
{"Mission_TW_Massacre_Cyclops_Plural_name", "Kill Cyclops" },
{"Mission_TW_Massacre_Cyclops_Singular_name", "Kill Cyclops" },
{"Mission_TW_Massacre_Scout_Plural_name", "Kill Scouts (Wing)" },
{"Mission_TW_Massacre_Cyclops_Singular_name", "Kill Cyclop" },
{"Mission_TW_Massacre_Hydra_Plural_name", "Kill Hydras" },
{"Mission_TW_Massacre_Hydra_Singular_name", "Kill Hydra" },
{"Mission_TW_Massacre_Scout_Plural_name", "Kill Scouts" },
{"Mission_TW_PassengerEvacuation_Burning_name", "Passenger Evacuation (Significant Damage)" },
{"Mission_TW_PassengerEvacuation_UnderAttack_name", "Passenger Evacuation (Thargoid Invasion)" },
{"Mission_TW_Rescue_UnderAttack_name", "Rescue (Thargoid Attack)" },

View File

@@ -4,6 +4,14 @@
xmlns:local="clr-namespace:EliteBGS"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<!-- Theme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@@ -1,4 +1,5 @@
using System.Windows;
using ControlzEx.Theming;
using System.Windows;
namespace EliteBGS {
/// <summary>

View File

@@ -19,10 +19,36 @@ public class DiscordLogGenerator {
new MicroResourcesFormat(),
new MarketBuyFormat(),
new CargoSoldFormatter(),
new VistaGenomicsFormat(),
/* As of this moment, Update 14.02 organics do not affect BGS at all */
//new VistaGenomicsFormat(),
new SearchAndRescueFormat(),
};
protected virtual string GenerateSummary(Objective objective) {
StringBuilder sb = new StringBuilder();
foreach (var formatter in formatters) {
string summary = "";
try {
summary = formatter.GenerateSummary(objective);
} catch (NotImplementedException) {
}
if (string.IsNullOrEmpty(summary)) {
continue;
}
if (sb.Length > 0) {
sb.Append(", ");
}
sb.Append(summary);
}
return sb.ToString();
}
protected virtual string GenerateHeader() {
return "";
}
@@ -49,8 +75,13 @@ public class DiscordLogGenerator {
.Count()
;
string summary = GenerateSummary(objective);
log.AppendFormat("**Date:** {0}\n", DateTime.Now.ToString("dd/MM/yyyy"));
log.AppendFormat("**Target:** {0}\n", location);
if (!string.IsNullOrEmpty(summary)) {
log.AppendFormat("**Summary**: {0}\n", summary);
}
if (legacycount > 0) {
log.AppendFormat("**Warning:** Some actions were performed on ED Legacy\n");
}

View File

@@ -0,0 +1,86 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<Version>0.2.6</Version>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
</PropertyGroup>
<PropertyGroup>
<StartupObject>EliteBGSApplication</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Salus.ico</ApplicationIcon>
<Title>BGS reporting and logging tool for Elite:Dangerous</Title>
<Authors>nola</Authors>
<Copyright>Copyright 2019 by Florian Stinglmayr</Copyright>
<RepositoryUrl>https://git.aror.org/florian/EDBGS</RepositoryUrl>
<PackageTags>ED;Elite Dangerous;BGS</PackageTags>
<PackageProjectUrl>https://bgs.n0la.org</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<Resource Include="main-page.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<None Update="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="docs\CHANGELOG.md">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Resource Include="docs\main-page.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>
<Content Include="LICENCE.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Resource Include="Salus.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="logo_v4.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EliteBGS.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="EliteBGS.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EDPlayerJournal\EDPlayerJournal.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<Version>0.2.6</Version>
<Version>0.3.0</Version>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
@@ -16,15 +16,22 @@
<Title>BGS reporting and logging tool for Elite:Dangerous</Title>
<Authors>nola</Authors>
<Copyright>Copyright 2019 by Florian Stinglmayr</Copyright>
<RepositoryUrl>https://git.aror.org/florian/EDBGS</RepositoryUrl>
<RepositoryUrl>https://codeberg.org/nola/EDBGS</RepositoryUrl>
<PackageTags>ED;Elite Dangerous;BGS</PackageTags>
<PackageProjectUrl>https://bgs.n0la.org</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Elite: Dangerous BGS logging and reporting tool
</Description>
<PackageIcon>logo_v5.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<Resource Include="main-page.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<None Update="logo_v5.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>True</Pack>
@@ -47,11 +54,6 @@
<ItemGroup>
<Resource Include="Salus.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="logo_v4.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EliteBGS.ico" />
</ItemGroup>
@@ -59,7 +61,7 @@
<Resource Include="EliteBGS.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.0" />
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" />
</ItemGroup>

View File

@@ -1,5 +1,6 @@
using System.Linq;
using System.Text;
using System.Windows.Documents;
using EDPlayerJournal;
using EDPlayerJournal.BGS;
@@ -53,4 +54,15 @@ public class CargoSoldFormatter : LogFormatter {
return builder.ToString();
}
public string GenerateSummary(Objective objective) {
SellCargo[] sold = objective.EnabledOfType<SellCargo>().ToArray();
long totalProfit = sold.Sum(x => x.Profit);
if (totalProfit >= 100000) {
return string.Format("Trade: {0}", Credits.FormatMillions(totalProfit));
}
return "";
}
}

View File

@@ -19,4 +19,15 @@ public class CartographicsFormat : LogFormatter {
pages, Credits.FormatCredits(sum)
);
}
public string GenerateSummary(Objective objective) {
Cartographics[] sold = objective.EnabledOfType<Cartographics>().ToArray();
long totalProfit = sold.Sum(x => x.TotalSum);
if (totalProfit >= 100000) {
return string.Format("Explo: {0}", Credits.FormatMillions(totalProfit));
}
return "";
}
}

View File

@@ -9,6 +9,7 @@ class CombatZoneFormat : LogFormatter {
public string GenerateLog(Objective objective) {
var logs = objective
.EnabledOfType<CombatZone>()
.OrderBy(x => CombatZones.DifficultyRank(x.Grade))
.GroupBy(x => new { x.Type, x.Grade })
.ToDictionary(x => x.Key, x => x.ToList())
;
@@ -43,4 +44,49 @@ class CombatZoneFormat : LogFormatter {
return builder.ToString().Trim();
}
public string GenerateSummary(Objective objective) {
var logs = objective
.EnabledOfType<CombatZone>()
.OrderBy(x => CombatZones.DifficultyRank(x.Grade))
.GroupBy(x => new { x.Type, x.Grade })
.ToDictionary(x => x.Key, x => x.ToList())
;
StringBuilder builder = new StringBuilder();
if (logs == null || logs.Count() <= 0) {
return "";
}
foreach (var log in logs) {
int optionals = log.Value
.Sum(x => x.OptionalObjectivesCompleted)
;
if (builder.Length > 0) {
builder.Append(", ");
}
if (!string.IsNullOrEmpty(log.Key.Grade)) {
string grade = log.Key.Grade.Substring(0, 1);
if (log.Key.Grade == CombatZones.DifficultyVeryHigh) {
grade = "VH";
}
builder.AppendFormat("CZ: {0}x{1}{2}",
log.Value.Count,
log.Key.Grade.Substring(0, 1),
log.Key.Type.Substring(0, 1)
);
} else {
builder.AppendFormat("CZ: {0}x?{1}",
log.Value.Count,
log.Key.Type.Substring(0, 1)
);
}
if (optionals > 0) {
builder.AppendFormat("+ {0} OPTS", optionals);
}
}
return builder.ToString().Trim();
}
}

View File

@@ -1,6 +1,5 @@
using System.Linq;
using System.Text;
using EDPlayerJournal.Entries;
using EDPlayerJournal.BGS;
namespace EliteBGS.LogGenerator;
@@ -31,4 +30,30 @@ public class FailedMissionFormat : LogFormatter {
return builder.ToString().Trim();
}
public string GenerateSummary(Objective objective) {
var missions = objective.EnabledOfType<MissionFailed>();
if (missions.Count <= 0) {
return "";
}
StringBuilder sb = new();
int onFootFails = missions.Where(x => x.Mission.IsOnFoot).Count();
int shipFails = missions.Where(x => !x.Mission.IsOnFoot).Count();
if (onFootFails > 0) {
sb.AppendFormat("Fails: {0} Ground", onFootFails);
}
if (shipFails > 0) {
if (sb.Length> 0) {
sb.Append(", ");
}
sb.AppendFormat("{0} Ship", shipFails);
}
return sb.ToString();
}
}

View File

@@ -25,4 +25,8 @@ public class GenericFormat<Type> : LogFormatter where Type : Transaction {
return builder.ToString();
}
public string GenerateSummary(Objective objective) {
throw new System.NotImplementedException();
}
}

View File

@@ -2,4 +2,5 @@
public interface LogFormatter {
string GenerateLog(Objective objective);
string GenerateSummary(Objective objective);
}

View File

@@ -16,4 +16,8 @@ public class MicroResourcesFormat : LogFormatter {
return string.Format("Sold {0} worth of Micro Resources\n",
Credits.FormatCredits(sum));
}
public string GenerateSummary(Objective objective) {
return "";
}
}

View File

@@ -76,4 +76,21 @@ public class MissionFormat : LogFormatter {
return output.ToString().Trim();
}
public string GenerateSummary(Objective objective) {
long influence = objective
.EnabledOfType<MissionCompleted>()
.Sum(x => x.Influence.Length)
;
long support = objective
.EnabledOfType<InfluenceSupport>()
.Sum(x => x.Influence.Length)
;
if (influence + support <= 0) {
return "";
}
return string.Format("INF: {0}", influence + support);
}
}

View File

@@ -45,4 +45,18 @@ public class MurderFormat : LogFormatter {
return builder.ToString();
}
public string GenerateSummary(Objective objective) {
long murders = objective
.EnabledOfType<FoulMurder>()
.Where(x => x.CrimeType == CrimeTypes.Murder || x.CrimeType == CrimeTypes.OnFootMurder)
.Count()
;
if (murders <= 0) {
return "";
}
return string.Format("Kills: {0}", murders);
}
}

View File

@@ -29,4 +29,30 @@ public class ThargoidFormatter : LogFormatter {
return builder.ToString();
}
public string GenerateSummary(Objective objective) {
List<ThargoidKill> kills = objective.EnabledOfType<ThargoidKill>().ToList();
if (kills.Count == 0 ) {
return "";
}
int scouts = kills.Where(x => x.ThargoidType == ThargoidVessel.Scout).Count();
int interceptors = kills.Count - scouts;
StringBuilder builder = new StringBuilder();
builder.Append("AX: ");
if (interceptors > 0) {
builder.AppendFormat("{0} INT", interceptors);
}
if (scouts > 0) {
if (builder.Length> 0) {
builder.Append(", ");
}
builder.AppendFormat("{0} SCT", scouts);
}
return builder.ToString();
}
}

View File

@@ -25,4 +25,32 @@ public class VoucherFormat : LogFormatter {
return builder.ToString().Trim();
}
public string GenerateSummary(Objective objective) {
long bounties = objective
.EnabledOfType<Vouchers>()
.Where(x => x.Type == "Bounty")
.Sum(x => x.TotalSum)
;
long bonds = objective
.EnabledOfType<Vouchers>()
.Where(x => x.Type == "Combat Bond")
.Sum(x => x.TotalSum)
;
StringBuilder sb = new();
if (bounties > 0) {
sb.AppendFormat("Bounties: {0}", Credits.FormatMillions(bounties));
}
if (bonds > 0) {
if (sb.Length > 0) {
sb.Append(", ");
}
sb.AppendFormat("Bonds: {0}", Credits.FormatMillions(bonds));
}
return sb.ToString();
}
}

View File

@@ -1,10 +1,9 @@
<Window
<mah:MetroWindow
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:abc="http://wpfcontrols.com/"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:EliteBGS"
xmlns:Util="clr-namespace:EliteBGS.Util" d:DataContext="{d:DesignInstance Type=Util:AppConfig}" x:Name="window" x:Class="EliteBGS.MainWindow"
mc:Ignorable="d"
@@ -15,6 +14,17 @@
</Style>
<local:MinusFortyFiveConverter x:Key="MinusFortyFiveConverter" />
</Window.Resources>
<mah:MetroWindow.RightWindowCommands>
<mah:WindowCommands ShowSeparators="False">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,5,0">
<Hyperlink x:Name="URL" NavigateUri="https://bgs.n0la.org/" RequestNavigate="URL_RequestNavigate">Homepage</Hyperlink>
</TextBlock>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,15,0">
<Hyperlink x:Name="SRC" NavigateUri="https://codeberg.org/nola/EDBGS" RequestNavigate="URL_RequestNavigate">Source</Hyperlink>
</TextBlock>
<mah:ToggleSwitch Content="Dark Theme" x:Name="SwitchTheme" IsOn="True" Toggled="SwitchTheme_Toggled"/>
</mah:WindowCommands>
</mah:MetroWindow.RightWindowCommands>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@@ -22,9 +32,9 @@
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TabControl>
<TabControl Style="{DynamicResource MahApps.Styles.TabControl.Animated}">
<TabItem Header="Current Objectives">
<Grid Background="#FFE5E5E5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
@@ -41,16 +51,16 @@
<Button x:Name="ParseJournal" Content="Parse Journal" VerticalAlignment="Center" Click="ParseJournal_Click" HorizontalAlignment="Center"/>
<Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/>
<Label Content="From (UTC):" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center"/>
<xctk:DateTimePicker x:Name="startdate" Height="26.2857142857143" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Label Content="To (UTC):" Height="26.2857142857143" VerticalAlignment="Top"/>
<xctk:DateTimePicker x:Name="enddate" Height="26.2857142857143" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<mah:DateTimePicker x:Name="startdate" Height="26.2857142857143" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Label Content="To (UTC):" Height="26.2857142857143" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<mah:DateTimePicker x:Name="enddate" Height="26.2857142857143" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/>
<Button x:Name="ResetTime" Content="Reset Time" Click="ResetTime_Click" />
<Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/>
<Button x:Name="ManuallyParse" Content="Manually Parse" Click="ManuallyParse_Click" />
</ToolBar>
<ToolBar Grid.Row="1" HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="Auto" Grid.ColumnSpan="3">
<Button x:Name="GenerateDiscord" Content="Generate Discord Report" VerticalAlignment="Stretch" Margin="0,0,0,0" VerticalContentAlignment="Center" Click="GenerateDiscord_Click" Height="26"/>
<ToolBar Grid.Row="1" HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top" Width="Auto" Grid.ColumnSpan="3">
<Button x:Name="GenerateDiscord" Content="Generate Discord Report" VerticalAlignment="Stretch" Margin="0,0,0,0" VerticalContentAlignment="Center" Click="GenerateDiscord_Click"/>
<Separator />
<ComboBox x:Name="LogType" VerticalAlignment="Stretch" Margin="0,3,0,3" Width="140" SelectionChanged="LogType_SelectionChanged" />
</ToolBar>
@@ -91,7 +101,7 @@
<HierarchicalDataTemplate>
<!-- This will stretch out the width of the item-->
<Grid Initialized="Transaction_Initialized"
HorizontalAlignment="Stretch"
HorizontalAlignment="Left"
Width="{Binding ActualWidth, ElementName=entries, Converter={StaticResource MinusFortyFiveConverter}}"
Margin="0,2,0,2"
>
@@ -150,8 +160,8 @@
<TextBox x:Name="DiscordLog" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="4" Height="Auto" TextWrapping="Wrap" FontFamily="Consolas" FontSize="14" Grid.ColumnSpan="3" AcceptsReturn="True" AcceptsTab="True"/>
</Grid>
</TabItem>
<TabItem Header="Settings" HorizontalAlignment="Left" Height="20" VerticalAlignment="Top" Width="53.7142857142857">
<Grid Background="#FFE5E5E5">
<TabItem Header="Settings">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
@@ -177,10 +187,24 @@
<Button x:Name="browsejournallocation" Content="Browse" Grid.Row="1" Grid.Column="1" Margin="0,0,0,0" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Left" Click="browsejournallocation_Click"/>
</Grid>
</GroupBox>
<GroupBox Header="Theme Colour" Height="Auto" Grid.Row="1" VerticalAlignment="Top" Width="Auto" Grid.ColumnSpan="3" Margin="0,5,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Content="Colour of the current theme." Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top"/>
<ComboBox x:Name="Colour" IsEditable="False" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Width="Auto" SelectionChanged="Colour_SelectionChanged"/>
</Grid>
</GroupBox>
</Grid>
</TabItem>
<TabItem Header="Event Log" HorizontalAlignment="Left" Height="20" VerticalAlignment="Top">
<Grid Background="#FFE5E5E5">
<TabItem Header="Event Log">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
@@ -188,8 +212,8 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBox IsReadOnly="True" Grid.Row="1" x:Name="log" Height="Auto" Margin="5" TextWrapping="Wrap" FontFamily="Courier New" Background="{x:Null}"/>
<RichTextBox IsReadOnly="True" HorizontalAlignment="Left" Height="Auto" Margin="5" Width="Auto" VerticalContentAlignment="Stretch" VerticalAlignment="Top" Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}">
<TextBox IsReadOnly="True" Grid.Row="1" x:Name="log" Height="Auto" Margin="5" TextWrapping="Wrap" FontFamily="Courier New" />
<RichTextBox IsReadOnly="True" HorizontalAlignment="Left" Height="Auto" Margin="5" Width="Auto" VerticalContentAlignment="Stretch" VerticalAlignment="Top" BorderBrush="{x:Null}" SelectionBrush="{x:Null}">
<FlowDocument>
<Paragraph>
<Run Text="This tool does not recognise every option and/or configuration that E:D outputs through its JSON files."/>
@@ -203,4 +227,4 @@
</TabItem>
</TabControl>
</Grid>
</Window>
</mah:MetroWindow>

View File

@@ -12,15 +12,18 @@ using EDPlayerJournal.Entries;
using EliteBGS.BGS;
using EliteBGS.Util;
using System.Globalization;
using System.Windows.Forms;
using System.Windows.Controls.Primitives;
using MahApps.Metro.Controls;
using ControlzEx.Theming;
using System.Windows.Media;
using System.Diagnostics;
namespace EliteBGS;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window {
public partial class MainWindow : MetroWindow {
private PlayerJournal journal;
private Report report;
@@ -55,6 +58,38 @@ public partial class MainWindow : Window {
LogType.SelectedIndex = 0;
}
// Apply theme
try {
AddCustomThemes();
string[] colours = ThemeManager.Current.Themes
.Select(x => x.ColorScheme)
.DistinctBy(x => x)
.OrderBy(x => x)
.ToArray()
;
foreach (var colour in colours) {
Colour.Items.Add(colour);
if (!string.IsNullOrEmpty(Config.Global.Colour) &&
string.Compare(colour, Config.Global.Colour, true) == 0) {
Colour.SelectedIndex = Colour.Items.Count - 1;
}
}
if (Colour.SelectedIndex < 0) {
Colour.SelectedIndex = 0;
}
SwitchTheme.IsOn = (string.Compare(Config.Global.Theme, "dark", true) == 0);
ThemeManager.Current.ChangeTheme(this, Config.Global.FullTheme);
} catch (Exception) {
// Theme is invalid, revert back to our standard dark theme
Config.Global.Colour = "Amber";
Config.Global.Theme = "Dark";
}
journal = new PlayerJournal(Config.Global.JournalLocation);
// Set both to now
@@ -63,14 +98,50 @@ public partial class MainWindow : Window {
journallocation.Text = Config.Global.JournalLocation;
}
private void AddCustomThemes() {
Dictionary<string, Color> colorThemes = new() {
//{ "HouseSalus", Color.FromRgb(0xBC, 0x94, 0x39) },
{ "HouseSalus", Color.FromRgb(0xED, 0xDA, 0x70) },
{ "NovaNavy", Color.FromRgb(0xA1, 0xA4, 0xDB) },
};
foreach (var colourtheme in colorThemes) {
var brush = new SolidColorBrush(colourtheme.Value);
// Add light theme
ThemeManager.Current.AddTheme(new Theme(
"Light." + colourtheme.Key,
"Light." + colourtheme.Key,
"Light",
colourtheme.Key,
colourtheme.Value,
brush,
true,
false)
);
// Add dark theme
ThemeManager.Current.AddTheme(new Theme(
"Dark." + colourtheme.Key,
"Dark." + colourtheme.Key,
"Dark",
colourtheme.Key,
colourtheme.Value,
brush,
true,
false)
);
}
}
private void InitialiseTime() {
DateTime today = DateTime.Today;
DateTime tomorrow = today.AddDays(1);
startdate.CultureInfo = enddate.CultureInfo = CultureInfo.InvariantCulture;
// HOCHKULTUR
startdate.Culture = enddate.Culture = CultureInfo.GetCultureInfo("de-AT");
startdate.Value = today;
enddate.Value = tomorrow;
startdate.SelectedDateTime = today;
enddate.SelectedDateTime = tomorrow;
}
private void TreeView_CheckBox_Updated(object sender, RoutedEventArgs args) {
@@ -120,7 +191,7 @@ public partial class MainWindow : Window {
}
private void HandleEntries(List<Entry> entries) {
HandleEntries(entries, startdate.Value ?? DateTime.Now, enddate.Value ?? DateTime.Now);
HandleEntries(entries, startdate.SelectedDateTime ?? DateTime.Now, enddate.SelectedDateTime ?? DateTime.Now);
}
private void Loadentries_EntriesLoaded(List<Entry> lines) {
@@ -131,8 +202,8 @@ public partial class MainWindow : Window {
try {
TransactionParser parser = new TransactionParser();
DateTime start = startdate.Value ?? DateTime.Now;
DateTime end = enddate.Value ?? DateTime.Now;
DateTime start = startdate.SelectedDateTime ?? DateTime.Now;
DateTime end = enddate.SelectedDateTime ?? DateTime.Now;
journal.Open(); // Load all files
// Log files only get rotated if you restart the game client. This means that there might
@@ -280,6 +351,12 @@ public partial class MainWindow : Window {
private void window_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
loadentries?.Close();
loadentries = null;
try {
Config.SaveGlobal();
} catch (Exception error) {
System.Windows.MessageBox.Show("There was an error saving your settings: " + error.Message);
}
}
private void Transaction_Initialized(object sender, EventArgs e) {
@@ -390,14 +467,14 @@ public partial class MainWindow : Window {
}
private void ResetTime_Click(object sender, RoutedEventArgs e) {
DateTime? d = startdate.Value;
DateTime? d = startdate.SelectedDateTime;
if (d != null) {
startdate.Value = ResetTimeToZero(d.Value);
startdate.SelectedDateTime = ResetTimeToZero(d.Value);
}
d = enddate.Value;
d = enddate.SelectedDateTime;
if (d != null) {
enddate.Value = ResetTimeToZero(d.Value);
enddate.SelectedDateTime = ResetTimeToZero(d.Value);
}
}
@@ -412,4 +489,35 @@ public partial class MainWindow : Window {
.ForEach(x => x.IsEnabled = (button.IsChecked ?? true))
;
}
private void UpdateTheme() {
ThemeManager.Current.ChangeTheme(this, Config.Global.FullTheme);
}
private void SwitchTheme_Toggled(object sender, RoutedEventArgs e) {
ToggleSwitch toggle = sender as ToggleSwitch;
if (toggle.IsOn) {
Config.Global.Theme = "Dark";
} else {
Config.Global.Theme = "Light";
}
UpdateTheme();
}
private void Colour_SelectionChanged(object sender, SelectionChangedEventArgs e) {
if (Colour.SelectedItem == null) {
return;
}
Config.Global.Colour = Colour.SelectedItem.ToString();
UpdateTheme();
}
private void URL_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) {
ProcessStartInfo info = new ProcessStartInfo();
info.UseShellExecute = true;
info.FileName = e.Uri.AbsoluteUri;
Process.Start(info);
e.Handled = true;
}
}

View File

@@ -8,7 +8,7 @@ public class MinusFortyFiveConverter : IValueConverter {
/// <inheritdoc/>
public object Convert(
object value, Type targetType, object parameter, CultureInfo culture) {
return (double)value - 65;
return (double)value - 80;
}
/// <inheritdoc/>

View File

@@ -51,7 +51,12 @@ public class NonaDiscordLog : DiscordLogGenerator {
.Count()
;
string summary = GenerateSummary(objective);
log.AppendFormat(":globe_with_meridians: `Target:` {0}\n", location);
if (!string.IsNullOrEmpty(summary)) {
log.AppendFormat(":scroll: `Summary:` {0}\n", summary);
}
if (legacycount > 0) {
log.Append(":rotating_light: `Warning`: Some actions were done in E:D Legacy\n");
}

View File

@@ -22,11 +22,14 @@ transactions. Currently the tool recognises the following transactions:
* Selling cartography data
* Selling of cargo to stations
* Selling of micro resources (Odyssey only)
* Selling of organic data (Odyssey only)
* Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages)
* Thargoid kills
* Contributions to Thargoid war effort
The following transactions are recognised but not listed, because they do not affect BGS:
* Selling of organic data (Odyssey only)
Vouchers help the faction that is listed for them. If said faction is not present in the
current system, then there is no BGS impact. So the tool looks for all system factions, and
makes sure that your vouchers actually have a BGS impact, otherwise it won't list them.
@@ -227,7 +230,7 @@ The project also requires:
* `Ookii.Dialogs.WPF`
* `Newtonsoft.Json`
* `Extended.Wpf.Toolkit`
* `MahApps`
## About

View File

@@ -1,20 +1,14 @@
using System.ComponentModel;
using Newtonsoft.Json;
namespace EliteBGS.Util {
public class AppConfig : INotifyPropertyChanged {
public class AppConfig {
private static readonly string default_journal_location = "%UserProfile%\\Saved Games\\Frontier Developments\\Elite Dangerous";
private string journal_location = default_journal_location;
private string lastdiscordlog;
public string DefaultJournalLocation => default_journal_location;
private string colour = "Amber";
private string theme = "Dark";
public string LastUsedDiscordTemplate {
get => lastdiscordlog;
set {
lastdiscordlog = value;
FirePropertyChanged("LastUsedDiscordTemplate");
}
}
public string LastUsedDiscordTemplate { get; set; }
public string JournalLocation {
get {
@@ -25,14 +19,38 @@ namespace EliteBGS.Util {
}
set {
journal_location = value;
FirePropertyChanged("JournalLocation");
}
}
private void FirePropertyChanged(string property) {
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
public string Theme {
get {
return theme;
}
set {
if (string.IsNullOrEmpty(value)) {
theme = "Dark";
} else {
theme = value;
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
public string Colour {
get {
return colour;
}
set {
if (string.IsNullOrEmpty(value)) {
colour = "Blue";
} else {
colour = value;
}
}
}
[JsonIgnore]
public string FullTheme {
get { return Theme + "." + Colour; }
}
}
}

View File

@@ -12,15 +12,6 @@ namespace EliteBGS.Util {
public Config() {
DetermineConfigFolder();
global_config.PropertyChanged += Global_config_PropertyChanged;
}
private void Global_config_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) {
try {
SaveGlobal();
} catch (Exception) {
/* ignored */
}
}
public string ConfigPath => config_folder;
@@ -58,7 +49,6 @@ namespace EliteBGS.Util {
if (app != null) {
this.global_config = app;
global_config.PropertyChanged += Global_config_PropertyChanged;
}
}
}

View File

@@ -1,5 +1,14 @@
# EliteBGS changelog
## 0.3.0 on 26.02.2023
* Move to MahApps toolkit, which replaces extended toolkit.
* Introduce themes (by MahApps) including dark mode.
* Add summary to the two bigger BGS log types.
* Remove organic data from BGS tool, as it has been confirmed that
it does not contribute to the BGS.
* Add a few more English mission names.
## 0.2.6 on 04.02.2023
* Update Post 14.02 Thargoid bounties

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -5,7 +5,7 @@ The tool allows you to configure BGS objectives, and will then parse your player
for tasks you completed relating to that BGS objective. Once the JSON player journal has
been parsed, you may then generate a BGS report you can copy/paste into Discord.
Source code is available [here](https://git.aror.org/florian/elitebgs).
Source code is available [here](https://codeberg.org/nola/EDBGS).
Binary downloads can be found here: [https://bgs.n0la.org/](https://bgs.n0la.org/).
@@ -22,11 +22,14 @@ missions. Currently the tool recognises the following completed tasks:
* Selling cartography data
* Selling of cargo to stations
* Selling of micro resources (Odyssey only)
* Selling of organic data (Odyssey only)
* Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages)
* Thargoid kills
* Combat zones (experimental)
The following transactions are recognised but not listed, because they do not affect BGS:
* Selling of organic data (Odyssey only)
Combat zone detection is highly wonky at this time. There is no direct event for detecting
combat zones, and so the tool makes a few assumptions and goes from there. If you disembark
it will assume on foot combat zones, and if you don't, it will assume a ship CZ. This
@@ -233,3 +236,5 @@ It would be helpful if you included the JSON player journal. This player journal
The project also requires `Ookii.Dialogs.WPF` controls, which contains the auto complete text box.
And of course, `Newtonsoft.Json` as the JSON parser.
`MahApps` is used to generate a prettier look, and for its dark themes.

View File

@@ -20,9 +20,13 @@ command line:
winget install Microsoft.DotNet.DesktopRuntime.7
```
You can download the **latest** version **0.2.5** here:
You can download the **latest** version **0.3.0** at CodeBerg:
* [https://bgs.n0la.org/elitebgs-0.2.5.zip](https://bgs.n0la.org/elitebgs-0.2.5.zip)
* [https://codeberg.org/nola/EDBGS/releases](https://codeberg.org/nola/EDBGS/releases)
Or alternatively from my server:
* [https://bgs.n0la.org/elitebgs-0.3.0.zip](https://bgs.n0la.org/elitebgs-0.3.0.zip)
## Old Versions
@@ -54,11 +58,14 @@ You can then select which of the two actions goes into the final log.
* Selling cartography data
* Selling of cargo to stations
* Selling of micro resources (Odyssey only)
* Selling of organic data (Odyssey only)
* Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages)
* Thargoid kills
* Combat zones (experimental feature)
The following transactions are recognised but not listed, because they do not affect BGS:
* Selling of organic data (Odyssey only)
### What it does not detect:
* Combat zone objectives

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

@@ -5,7 +5,14 @@ class library EDPlayerJournal, which reads and parses Elite Dangerous player jou
See [https://bgs.n0la.org/](https://bgs.n0la.org) for further details.
The tool helps with creating BGS reports for squadrons that support factions in
Elite: Dangerous that can be copy and pasted into a Discord server. It finds all BGS
relevant actions in the player journals, and constructs a human readable BGS report
from them:
![MainPage](EliteBGS/main-page.png)
## Requirements
This repository depends on dotnet desktop SDK 7, as well as Newtonsoft.JSON, Extended
WPF toolkit, and Ookii Dialogs.
This repository depends on dotnet desktop SDK 7, as well as `Newtonsoft.JSON`, MahApps,
and Ookii Dialogs.