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.
/// 0 = lowest difficulty, 1 = medium and so forth.
/// </summary>
public static int? DifficultyRank(string difficulty) {
public static int? DifficultyRank(string? difficulty) {
Dictionary<string, int> ranks = new() {
{ DifficultyLow, 0 },
{ DifficultyMedium, 1 },
@@ -51,6 +51,10 @@ public class CombatZones {
{ DifficultyVeryHigh, 3 }
};
if (difficulty == null ) {
return null;
}
if (ranks.TryGetValue(difficulty, out int rank)) {
return rank;
}

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<Version>0.3.0</Version>
<Version>0.3.1</Version>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>

View File

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

View File

@@ -43,12 +43,13 @@ public class FailedMissionFormat : LogFormatter {
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("Fails: {0} Ground", onFootFails);
sb.AppendFormat("{0} Ground", onFootFails);
}
if (shipFails > 0) {
if (sb.Length> 0) {
if (onFootFails > 0) {
sb.Append(", ");
}
sb.AppendFormat("{0} Ship", shipFails);

View File

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

View File

@@ -1,5 +1,10 @@
# 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.

View File

@@ -20,13 +20,13 @@ command line:
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)
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