26 Commits
0.2.6 ... 0.3.1

Author SHA1 Message Date
7ee734bc33 bugfix release 2023-02-26 22:16:01 +01:00
5799b3ed16 fix summary for failed missions 2023-02-26 22:03:31 +01:00
a13e8446d2 fix summary for AX combat zones 2023-02-26 22:01:13 +01:00
0665e64459 fix VH type 2023-02-26 21:57:45 +01:00
d8ac2a7ee7 grade can be null 2023-02-26 21:57:24 +01:00
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 625 additions and 83 deletions

View File

@@ -38,4 +38,27 @@ public class CombatZones {
/// Very high difficulty, so far AX combat zone only /// Very high difficulty, so far AX combat zone only
/// </summary> /// </summary>
public static readonly string DifficultyVeryHigh = "Very High"; 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 (difficulty == null ) {
return null;
}
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)); 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_Delivery_Retreat_name", "Delivery (Retreat)"},
{"Mission_DeliveryWing_name", "Delivery (Wing)"}, {"Mission_DeliveryWing_name", "Delivery (Wing)"},
{"Mission_DeliveryWing_War_name", "Delivery (Wing) (War)"}, {"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_Boom_name", "Hack Surface Installation (Boom)"},
{"Mission_Hack_BLOPS_Elections_name", "Hack Surface Installation (Elections)"}, {"Mission_Hack_BLOPS_Elections_name", "Hack Surface Installation (Elections)"},
{"Mission_Hack_BLOPS_Expansion_name", "Hack Surface Installation (Expansion)"}, {"Mission_Hack_BLOPS_Expansion_name", "Hack Surface Installation (Expansion)"},
@@ -65,24 +66,30 @@ public class EnglishMissionNames {
{"Mission_MassacreWing_name", "Massacre (Wing)"}, {"Mission_MassacreWing_name", "Massacre (Wing)"},
{"Mission_Mining_name", "Mining" }, {"Mission_Mining_name", "Mining" },
{"Mission_OnFoot_Assassination_MB_name", "On Foot Assassination"}, {"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_MB_name", "On Foot Assassination (Illegal)"},
{"Mission_OnFoot_AssassinationIllegal_NCD_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_Contact_MB_name", "On Foot Collect"},
{"Mission_OnFoot_Collect_MB_name", "On Foot Collection"}, {"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_Delivery_Contact_MB_name", "On Foot Delivery (Contact)"},
{"Mission_OnFoot_Hack_Upload_Covert_MB_name", "On Foot Hack (Covert Upload)"}, {"Mission_OnFoot_Hack_Upload_Covert_MB_name", "On Foot Hack (Covert Upload)"},
{"Mission_OnFoot_Hack_Upload_MB_name", "On Foot Hack (Upload)"}, {"Mission_OnFoot_Hack_Upload_MB_name", "On Foot Hack (Upload)"},
{"Mission_OnFoot_Heist_MB_name", "On Foot Heist" }, {"Mission_OnFoot_Heist_MB_name", "On Foot Heist" },
{"Mission_OnFoot_Heist_POI_MB_name", "On Foot Heist (POI)"}, {"Mission_OnFoot_Heist_POI_MB_name", "On Foot Heist (POI)"},
{"Mission_OnFoot_Massacre_MB_name", "On Foot Massacre" }, {"Mission_OnFoot_Massacre_MB_name", "On Foot Massacre" },
{"Mission_OnFoot_MassacreIllegal_MB_name", "On Foot Massacre (Illegal)" }, {"Mission_OnFoot_MassacreIllegal_MB_name", "On Foot Massacre (Illegal)"},
{"Mission_OnFoot_Onslaught_MB_name", "On Foot Onslaught"}, {"Mission_OnFoot_Onslaught_MB_name", "On Foot Onslaught"},
{"Mission_OnFoot_Onslaught_Offline_MB_name", "On Foot Onslaught (Offline)"}, {"Mission_OnFoot_Onslaught_Offline_MB_name", "On Foot Onslaught (Offline)"},
{"Mission_OnFoot_ProductionHeist_Covert_MB_name", "On Foot Production Heist (Covert)"}, {"Mission_OnFoot_ProductionHeist_Covert_MB_name", "On Foot Production Heist (Covert)"},
{"Mission_OnFoot_ProductionHeist_MB_name", "On Foot Production Heist"}, {"Mission_OnFoot_ProductionHeist_MB_name", "On Foot Production Heist"},
{"Mission_OnFoot_Reboot_MB_name", "On Foot Reboot"}, {"Mission_OnFoot_Reboot_MB_name", "On Foot Reboot"},
{"Mission_OnFoot_RebootRestore_MB_name", "On Foot Reboot/Restore"}, {"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_Salvage_MB_name", "On Foot Salvage"},
{"Mission_OnFoot_SalvageIllegal_MB_name", "On Foot Salvage (Illegal)"}, {"Mission_OnFoot_SalvageIllegal_MB_name", "On Foot Salvage (Illegal)"},
{"Mission_OnFoot_Smuggle_Contact_MB_name", "On Foot Smuggling" }, {"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_Criminal_FAMINE_name", "Sightseeing (Criminal) (Famine)"},
{"Mission_Sightseeing_name", "Sightseeing"}, {"Mission_Sightseeing_name", "Sightseeing"},
{"Mission_Smuggle_Anarchy_name", "Smuggling (Anarchy)" }, {"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_Basilisk_Singular_name", "Kill Basilisk" },
{"Mission_TW_Massacre_Cyclops_Plural_name", "Kill Cyclops" }, {"Mission_TW_Massacre_Cyclops_Plural_name", "Kill Cyclops" },
{"Mission_TW_Massacre_Cyclops_Singular_name", "Kill Cyclops" }, {"Mission_TW_Massacre_Cyclops_Singular_name", "Kill Cyclop" },
{"Mission_TW_Massacre_Scout_Plural_name", "Kill Scouts (Wing)" }, {"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_Burning_name", "Passenger Evacuation (Significant Damage)" },
{"Mission_TW_PassengerEvacuation_UnderAttack_name", "Passenger Evacuation (Thargoid Invasion)" }, {"Mission_TW_PassengerEvacuation_UnderAttack_name", "Passenger Evacuation (Thargoid Invasion)" },
{"Mission_TW_Rescue_UnderAttack_name", "Rescue (Thargoid Attack)" }, {"Mission_TW_Rescue_UnderAttack_name", "Rescue (Thargoid Attack)" },

View File

@@ -4,6 +4,14 @@
xmlns:local="clr-namespace:EliteBGS" xmlns:local="clr-namespace:EliteBGS"
StartupUri="MainWindow.xaml"> StartupUri="MainWindow.xaml">
<Application.Resources> <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.Resources>
</Application> </Application>

View File

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

View File

@@ -19,10 +19,36 @@ public class DiscordLogGenerator {
new MicroResourcesFormat(), new MicroResourcesFormat(),
new MarketBuyFormat(), new MarketBuyFormat(),
new CargoSoldFormatter(), new CargoSoldFormatter(),
new VistaGenomicsFormat(), /* As of this moment, Update 14.02 organics do not affect BGS at all */
//new VistaGenomicsFormat(),
new SearchAndRescueFormat(), 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() { protected virtual string GenerateHeader() {
return ""; return "";
} }
@@ -49,8 +75,13 @@ public class DiscordLogGenerator {
.Count() .Count()
; ;
string summary = GenerateSummary(objective);
log.AppendFormat("**Date:** {0}\n", DateTime.Now.ToString("dd/MM/yyyy")); log.AppendFormat("**Date:** {0}\n", DateTime.Now.ToString("dd/MM/yyyy"));
log.AppendFormat("**Target:** {0}\n", location); log.AppendFormat("**Target:** {0}\n", location);
if (!string.IsNullOrEmpty(summary)) {
log.AppendFormat("**Summary**: {0}\n", summary);
}
if (legacycount > 0) { if (legacycount > 0) {
log.AppendFormat("**Warning:** Some actions were performed on ED Legacy\n"); 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> <PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework> <TargetFramework>net7.0-windows</TargetFramework>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<Version>0.2.6</Version> <Version>0.3.1</Version>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
@@ -16,15 +16,22 @@
<Title>BGS reporting and logging tool for Elite:Dangerous</Title> <Title>BGS reporting and logging tool for Elite:Dangerous</Title>
<Authors>nola</Authors> <Authors>nola</Authors>
<Copyright>Copyright 2019 by Florian Stinglmayr</Copyright> <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> <PackageTags>ED;Elite Dangerous;BGS</PackageTags>
<PackageProjectUrl>https://bgs.n0la.org</PackageProjectUrl> <PackageProjectUrl>https://bgs.n0la.org</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile> <PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Elite: Dangerous BGS logging and reporting tool
</Description>
<PackageIcon>logo_v5.png</PackageIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Resource Include="main-page.png"> <Resource Include="main-page.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource> </Resource>
<None Update="logo_v5.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="README.md"> <None Update="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>True</Pack> <Pack>True</Pack>
@@ -47,11 +54,6 @@
<ItemGroup> <ItemGroup>
<Resource Include="Salus.ico" /> <Resource Include="Salus.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="logo_v4.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\EliteBGS.ico" /> <Resource Include="Resources\EliteBGS.ico" />
</ItemGroup> </ItemGroup>
@@ -59,7 +61,7 @@
<Resource Include="EliteBGS.ico" /> <Resource Include="EliteBGS.ico" />
</ItemGroup> </ItemGroup>
<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.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" /> <PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" />
</ItemGroup> </ItemGroup>

View File

@@ -1,5 +1,6 @@
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Documents;
using EDPlayerJournal; using EDPlayerJournal;
using EDPlayerJournal.BGS; using EDPlayerJournal.BGS;
@@ -53,4 +54,15 @@ public class CargoSoldFormatter : LogFormatter {
return builder.ToString(); 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) 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) { public string GenerateLog(Objective objective) {
var logs = objective var logs = objective
.EnabledOfType<CombatZone>() .EnabledOfType<CombatZone>()
.OrderBy(x => (CombatZones.DifficultyRank(x.Grade) ?? 0))
.GroupBy(x => new { x.Type, x.Grade }) .GroupBy(x => new { x.Type, x.Grade })
.ToDictionary(x => x.Key, x => x.ToList()) .ToDictionary(x => x.Key, x => x.ToList())
; ;
@@ -43,4 +44,49 @@ class CombatZoneFormat : LogFormatter {
return builder.ToString().Trim(); return builder.ToString().Trim();
} }
public string GenerateSummary(Objective objective) {
var logs = objective
.EnabledOfType<CombatZone>()
.OrderBy(x => (CombatZones.DifficultyRank(x.Grade) ?? 0))
.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,
grade,
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.Linq;
using System.Text; using System.Text;
using EDPlayerJournal.Entries;
using EDPlayerJournal.BGS; using EDPlayerJournal.BGS;
namespace EliteBGS.LogGenerator; namespace EliteBGS.LogGenerator;
@@ -31,4 +30,31 @@ public class FailedMissionFormat : LogFormatter {
return builder.ToString().Trim(); 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();
sb.Append("Fails: ");
if (onFootFails > 0) {
sb.AppendFormat("{0} Ground", onFootFails);
}
if (shipFails > 0) {
if (onFootFails > 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(); return builder.ToString();
} }
public string GenerateSummary(Objective objective) {
throw new System.NotImplementedException();
}
} }

View File

@@ -2,4 +2,5 @@
public interface LogFormatter { public interface LogFormatter {
string GenerateLog(Objective objective); 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", return string.Format("Sold {0} worth of Micro Resources\n",
Credits.FormatCredits(sum)); Credits.FormatCredits(sum));
} }
public string GenerateSummary(Objective objective) {
return "";
}
} }

View File

@@ -76,4 +76,21 @@ public class MissionFormat : LogFormatter {
return output.ToString().Trim(); 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(); 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(); 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 (interceptors > 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(); 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="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 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:local="clr-namespace:EliteBGS"
xmlns:Util="clr-namespace:EliteBGS.Util" d:DataContext="{d:DesignInstance Type=Util:AppConfig}" x:Name="window" x:Class="EliteBGS.MainWindow" xmlns:Util="clr-namespace:EliteBGS.Util" d:DataContext="{d:DesignInstance Type=Util:AppConfig}" x:Name="window" x:Class="EliteBGS.MainWindow"
mc:Ignorable="d" mc:Ignorable="d"
@@ -15,6 +14,17 @@
</Style> </Style>
<local:MinusFortyFiveConverter x:Key="MinusFortyFiveConverter" /> <local:MinusFortyFiveConverter x:Key="MinusFortyFiveConverter" />
</Window.Resources> </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>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
@@ -22,9 +32,9 @@
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TabControl> <TabControl Style="{DynamicResource MahApps.Styles.TabControl.Animated}">
<TabItem Header="Current Objectives"> <TabItem Header="Current Objectives">
<Grid Background="#FFE5E5E5"> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
@@ -41,16 +51,16 @@
<Button x:Name="ParseJournal" Content="Parse Journal" VerticalAlignment="Center" Click="ParseJournal_Click" HorizontalAlignment="Center"/> <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"/> <Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/>
<Label Content="From (UTC):" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center"/> <Label Content="From (UTC):" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center"/>
<xctk:DateTimePicker x:Name="startdate" 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="Top"/> <Label Content="To (UTC):" Height="26.2857142857143" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<xctk:DateTimePicker x:Name="enddate" 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"/> <Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/>
<Button x:Name="ResetTime" Content="Reset Time" Click="ResetTime_Click" /> <Button x:Name="ResetTime" Content="Reset Time" Click="ResetTime_Click" />
<Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/> <Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/>
<Button x:Name="ManuallyParse" Content="Manually Parse" Click="ManuallyParse_Click" /> <Button x:Name="ManuallyParse" Content="Manually Parse" Click="ManuallyParse_Click" />
</ToolBar> </ToolBar>
<ToolBar Grid.Row="1" HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="Auto" Grid.ColumnSpan="3"> <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" Height="26"/> <Button x:Name="GenerateDiscord" Content="Generate Discord Report" VerticalAlignment="Stretch" Margin="0,0,0,0" VerticalContentAlignment="Center" Click="GenerateDiscord_Click"/>
<Separator /> <Separator />
<ComboBox x:Name="LogType" VerticalAlignment="Stretch" Margin="0,3,0,3" Width="140" SelectionChanged="LogType_SelectionChanged" /> <ComboBox x:Name="LogType" VerticalAlignment="Stretch" Margin="0,3,0,3" Width="140" SelectionChanged="LogType_SelectionChanged" />
</ToolBar> </ToolBar>
@@ -91,7 +101,7 @@
<HierarchicalDataTemplate> <HierarchicalDataTemplate>
<!-- This will stretch out the width of the item--> <!-- This will stretch out the width of the item-->
<Grid Initialized="Transaction_Initialized" <Grid Initialized="Transaction_Initialized"
HorizontalAlignment="Stretch" HorizontalAlignment="Left"
Width="{Binding ActualWidth, ElementName=entries, Converter={StaticResource MinusFortyFiveConverter}}" Width="{Binding ActualWidth, ElementName=entries, Converter={StaticResource MinusFortyFiveConverter}}"
Margin="0,2,0,2" 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"/> <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> </Grid>
</TabItem> </TabItem>
<TabItem Header="Settings" HorizontalAlignment="Left" Height="20" VerticalAlignment="Top" Width="53.7142857142857"> <TabItem Header="Settings">
<Grid Background="#FFE5E5E5"> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<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"/> <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> </Grid>
</GroupBox> </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> </Grid>
</TabItem> </TabItem>
<TabItem Header="Event Log" HorizontalAlignment="Left" Height="20" VerticalAlignment="Top"> <TabItem Header="Event Log">
<Grid Background="#FFE5E5E5"> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
@@ -188,8 +212,8 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBox IsReadOnly="True" Grid.Row="1" x:Name="log" Height="Auto" Margin="5" TextWrapping="Wrap" FontFamily="Courier New" Background="{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" Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}"> <RichTextBox IsReadOnly="True" HorizontalAlignment="Left" Height="Auto" Margin="5" Width="Auto" VerticalContentAlignment="Stretch" VerticalAlignment="Top" BorderBrush="{x:Null}" SelectionBrush="{x:Null}">
<FlowDocument> <FlowDocument>
<Paragraph> <Paragraph>
<Run Text="This tool does not recognise every option and/or configuration that E:D outputs through its JSON files."/> <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> </TabItem>
</TabControl> </TabControl>
</Grid> </Grid>
</Window> </mah:MetroWindow>

View File

@@ -12,15 +12,18 @@ using EDPlayerJournal.Entries;
using EliteBGS.BGS; using EliteBGS.BGS;
using EliteBGS.Util; using EliteBGS.Util;
using System.Globalization; using System.Globalization;
using System.Windows.Forms;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using MahApps.Metro.Controls;
using ControlzEx.Theming;
using System.Windows.Media;
using System.Diagnostics;
namespace EliteBGS; namespace EliteBGS;
/// <summary> /// <summary>
/// Interaction logic for MainWindow.xaml /// Interaction logic for MainWindow.xaml
/// </summary> /// </summary>
public partial class MainWindow : Window { public partial class MainWindow : MetroWindow {
private PlayerJournal journal; private PlayerJournal journal;
private Report report; private Report report;
@@ -55,6 +58,38 @@ public partial class MainWindow : Window {
LogType.SelectedIndex = 0; 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); journal = new PlayerJournal(Config.Global.JournalLocation);
// Set both to now // Set both to now
@@ -63,14 +98,50 @@ public partial class MainWindow : Window {
journallocation.Text = Config.Global.JournalLocation; 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() { private void InitialiseTime() {
DateTime today = DateTime.Today; DateTime today = DateTime.Today;
DateTime tomorrow = today.AddDays(1); DateTime tomorrow = today.AddDays(1);
startdate.CultureInfo = enddate.CultureInfo = CultureInfo.InvariantCulture; // HOCHKULTUR
startdate.Culture = enddate.Culture = CultureInfo.GetCultureInfo("de-AT");
startdate.Value = today; startdate.SelectedDateTime = today;
enddate.Value = tomorrow; enddate.SelectedDateTime = tomorrow;
} }
private void TreeView_CheckBox_Updated(object sender, RoutedEventArgs args) { private void TreeView_CheckBox_Updated(object sender, RoutedEventArgs args) {
@@ -120,7 +191,7 @@ public partial class MainWindow : Window {
} }
private void HandleEntries(List<Entry> entries) { 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) { private void Loadentries_EntriesLoaded(List<Entry> lines) {
@@ -131,8 +202,8 @@ public partial class MainWindow : Window {
try { try {
TransactionParser parser = new TransactionParser(); TransactionParser parser = new TransactionParser();
DateTime start = startdate.Value ?? DateTime.Now; DateTime start = startdate.SelectedDateTime ?? DateTime.Now;
DateTime end = enddate.Value ?? DateTime.Now; DateTime end = enddate.SelectedDateTime ?? DateTime.Now;
journal.Open(); // Load all files journal.Open(); // Load all files
// Log files only get rotated if you restart the game client. This means that there might // 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) { private void window_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
loadentries?.Close(); loadentries?.Close();
loadentries = null; 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) { 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) { private void ResetTime_Click(object sender, RoutedEventArgs e) {
DateTime? d = startdate.Value; DateTime? d = startdate.SelectedDateTime;
if (d != null) { if (d != null) {
startdate.Value = ResetTimeToZero(d.Value); startdate.SelectedDateTime = ResetTimeToZero(d.Value);
} }
d = enddate.Value; d = enddate.SelectedDateTime;
if (d != null) { 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)) .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/> /// <inheritdoc/>
public object Convert( public object Convert(
object value, Type targetType, object parameter, CultureInfo culture) { object value, Type targetType, object parameter, CultureInfo culture) {
return (double)value - 65; return (double)value - 80;
} }
/// <inheritdoc/> /// <inheritdoc/>

View File

@@ -51,7 +51,12 @@ public class NonaDiscordLog : DiscordLogGenerator {
.Count() .Count()
; ;
string summary = GenerateSummary(objective);
log.AppendFormat(":globe_with_meridians: `Target:` {0}\n", location); log.AppendFormat(":globe_with_meridians: `Target:` {0}\n", location);
if (!string.IsNullOrEmpty(summary)) {
log.AppendFormat(":scroll: `Summary:` {0}\n", summary);
}
if (legacycount > 0) { if (legacycount > 0) {
log.Append(":rotating_light: `Warning`: Some actions were done in E:D Legacy\n"); 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 cartography data
* Selling of cargo to stations * Selling of cargo to stations
* Selling of micro resources (Odyssey only) * Selling of micro resources (Odyssey only)
* Selling of organic data (Odyssey only)
* Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages) * Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages)
* Thargoid kills * Thargoid kills
* Contributions to Thargoid war effort * 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 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 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. 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` * `Ookii.Dialogs.WPF`
* `Newtonsoft.Json` * `Newtonsoft.Json`
* `Extended.Wpf.Toolkit` * `MahApps`
## About ## About

View File

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

View File

@@ -12,15 +12,6 @@ namespace EliteBGS.Util {
public Config() { public Config() {
DetermineConfigFolder(); 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; public string ConfigPath => config_folder;
@@ -58,7 +49,6 @@ namespace EliteBGS.Util {
if (app != null) { if (app != null) {
this.global_config = app; this.global_config = app;
global_config.PropertyChanged += Global_config_PropertyChanged;
} }
} }
} }

View File

@@ -1,5 +1,19 @@
# EliteBGS changelog # EliteBGS changelog
## 0.3.1 on 26.02.2023
* Fixed: AX combat zones caused crashes with the summary.
* Fixed: Summaries for thargoid kills didn't render probably.
## 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 ## 0.2.6 on 04.02.2023
* Update Post 14.02 Thargoid bounties * 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 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. 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/). 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 cartography data
* Selling of cargo to stations * Selling of cargo to stations
* Selling of micro resources (Odyssey only) * Selling of micro resources (Odyssey only)
* Selling of organic data (Odyssey only)
* Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages) * Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages)
* Thargoid kills * Thargoid kills
* Combat zones (experimental) * 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 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 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 it will assume on foot combat zones, and if you don't, it will assume a ship CZ. This
@@ -232,4 +235,6 @@ 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. The project also requires `Ookii.Dialogs.WPF` controls, which contains the auto complete text box.
And of course, `Newtonsoft.Json` as the JSON parser. 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 winget install Microsoft.DotNet.DesktopRuntime.7
``` ```
You can download the **latest** version **0.2.5** here: You can download the **latest** version **0.3.1** 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.1.zip](https://bgs.n0la.org/elitebgs-0.3.1.zip)
## Old Versions ## Old Versions
@@ -54,11 +58,14 @@ You can then select which of the two actions goes into the final log.
* Selling cartography data * Selling cartography data
* Selling of cargo to stations * Selling of cargo to stations
* Selling of micro resources (Odyssey only) * Selling of micro resources (Odyssey only)
* Selling of organic data (Odyssey only)
* Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages) * Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages)
* Thargoid kills * Thargoid kills
* Combat zones (experimental feature) * 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: ### What it does not detect:
* Combat zone objectives * 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. 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 ## Requirements
This repository depends on dotnet desktop SDK 7, as well as Newtonsoft.JSON, Extended This repository depends on dotnet desktop SDK 7, as well as `Newtonsoft.JSON`, MahApps,
WPF toolkit, and Ookii Dialogs. and Ookii Dialogs.