5 Commits
0.3.0 ... 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
7 changed files with 21 additions and 11 deletions

View File

@@ -43,7 +43,7 @@ public class CombatZones {
/// Returns the given combat zone difficulty as an integer, so it can be sorted. /// Returns the given combat zone difficulty as an integer, so it can be sorted.
/// 0 = lowest difficulty, 1 = medium and so forth. /// 0 = lowest difficulty, 1 = medium and so forth.
/// </summary> /// </summary>
public static int? DifficultyRank(string difficulty) { public static int? DifficultyRank(string? difficulty) {
Dictionary<string, int> ranks = new() { Dictionary<string, int> ranks = new() {
{ DifficultyLow, 0 }, { DifficultyLow, 0 },
{ DifficultyMedium, 1 }, { DifficultyMedium, 1 },
@@ -51,6 +51,10 @@ public class CombatZones {
{ DifficultyVeryHigh, 3 } { DifficultyVeryHigh, 3 }
}; };
if (difficulty == null ) {
return null;
}
if (ranks.TryGetValue(difficulty, out int rank)) { if (ranks.TryGetValue(difficulty, out int rank)) {
return rank; return rank;
} }

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.3.0</Version> <Version>0.3.1</Version>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>

View File

@@ -9,7 +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)) .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())
; ;
@@ -48,7 +48,7 @@ class CombatZoneFormat : LogFormatter {
public string GenerateSummary(Objective objective) { public string GenerateSummary(Objective objective) {
var logs = objective var logs = objective
.EnabledOfType<CombatZone>() .EnabledOfType<CombatZone>()
.OrderBy(x => CombatZones.DifficultyRank(x.Grade)) .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())
; ;
@@ -72,7 +72,7 @@ class CombatZoneFormat : LogFormatter {
} }
builder.AppendFormat("CZ: {0}x{1}{2}", builder.AppendFormat("CZ: {0}x{1}{2}",
log.Value.Count, log.Value.Count,
log.Key.Grade.Substring(0, 1), grade,
log.Key.Type.Substring(0, 1) log.Key.Type.Substring(0, 1)
); );
} else { } else {

View File

@@ -43,12 +43,13 @@ public class FailedMissionFormat : LogFormatter {
int onFootFails = missions.Where(x => x.Mission.IsOnFoot).Count(); int onFootFails = missions.Where(x => x.Mission.IsOnFoot).Count();
int shipFails = missions.Where(x => !x.Mission.IsOnFoot).Count(); int shipFails = missions.Where(x => !x.Mission.IsOnFoot).Count();
sb.Append("Fails: ");
if (onFootFails > 0) { if (onFootFails > 0) {
sb.AppendFormat("Fails: {0} Ground", onFootFails); sb.AppendFormat("{0} Ground", onFootFails);
} }
if (shipFails > 0) { if (shipFails > 0) {
if (sb.Length> 0) { if (onFootFails > 0) {
sb.Append(", "); sb.Append(", ");
} }
sb.AppendFormat("{0} Ship", shipFails); sb.AppendFormat("{0} Ship", shipFails);

View File

@@ -47,8 +47,8 @@ public class ThargoidFormatter : LogFormatter {
builder.AppendFormat("{0} INT", interceptors); builder.AppendFormat("{0} INT", interceptors);
} }
if (scouts > 0) { if (scouts > 0) {
if (builder.Length> 0) { if (interceptors > 0) {
builder.Append(", "); builder.Append(" + ");
} }
builder.AppendFormat("{0} SCT", scouts); builder.AppendFormat("{0} SCT", scouts);
} }

View File

@@ -1,5 +1,10 @@
# 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 ## 0.3.0 on 26.02.2023
* Move to MahApps toolkit, which replaces extended toolkit. * Move to MahApps toolkit, which replaces extended toolkit.

View File

@@ -20,13 +20,13 @@ command line:
winget install Microsoft.DotNet.DesktopRuntime.7 winget install Microsoft.DotNet.DesktopRuntime.7
``` ```
You can download the **latest** version **0.3.0** at CodeBerg: You can download the **latest** version **0.3.1** at CodeBerg:
* [https://codeberg.org/nola/EDBGS/releases](https://codeberg.org/nola/EDBGS/releases) * [https://codeberg.org/nola/EDBGS/releases](https://codeberg.org/nola/EDBGS/releases)
Or alternatively from my server: Or alternatively from my server:
* [https://bgs.n0la.org/elitebgs-0.3.0.zip](https://bgs.n0la.org/elitebgs-0.3.0.zip) * [https://bgs.n0la.org/elitebgs-0.3.1.zip](https://bgs.n0la.org/elitebgs-0.3.1.zip)
## Old Versions ## Old Versions