improve log header if no system is known
This commit is contained in:
parent
e0e7cb5792
commit
61f1b10f29
@ -34,9 +34,18 @@ public class DiscordLogGenerator {
|
||||
protected virtual string GenerateObjectiveHeader(Objective objective) {
|
||||
StringBuilder log = new StringBuilder();
|
||||
|
||||
string location;
|
||||
|
||||
if (!string.IsNullOrEmpty(objective.System) && !string.IsNullOrEmpty(objective.Faction)) {
|
||||
location = string.Format("{0}, {1}", objective.System, objective.Faction);
|
||||
} else if (!string.IsNullOrEmpty(objective.System)) {
|
||||
location = objective.System;
|
||||
} else {
|
||||
location = "Unknown Location";
|
||||
}
|
||||
|
||||
log.AppendFormat("**Date:** {0}\n", DateTime.Now.ToString("dd/MM/yyyy"));
|
||||
log.AppendFormat("**Location:** {0}, {1}\n", objective.System, objective.Faction);
|
||||
log.AppendFormat("**Faction:** {0}\n", objective.Faction);
|
||||
log.AppendFormat("**Target:** {0}\n", location);
|
||||
log.AppendLine("");
|
||||
log.AppendLine("```");
|
||||
|
||||
|
@ -34,7 +34,17 @@ public class NonaDiscordLog : DiscordLogGenerator {
|
||||
protected override string GenerateObjectiveHeader(Objective objective) {
|
||||
StringBuilder log = new StringBuilder();
|
||||
|
||||
log.AppendFormat(":globe_with_meridians: `Location:` {0}, {1}\n", objective.System, objective.Faction);
|
||||
string location;
|
||||
|
||||
if (!string.IsNullOrEmpty(objective.System) && !string.IsNullOrEmpty(objective.Faction)) {
|
||||
location = string.Format("{0}, {1}", objective.System, objective.Faction);
|
||||
} else if (!string.IsNullOrEmpty(objective.System)) {
|
||||
location = objective.System;
|
||||
} else {
|
||||
location = "Unknown Location";
|
||||
}
|
||||
|
||||
log.AppendFormat(":globe_with_meridians: `Target:` {0}\n", location);
|
||||
log.Append(":clipboard: `Conducted:`\n");
|
||||
log.Append("```");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user