mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-07-01 08:23:42 -04:00
Export version fixes (#83)
* Add file association for .eop, prompt for install dir * Handle .eop or .aip file passed as arg. * VS2022 version bump * Filter neutron stars and black holes from fast spinning criteria. * Adjustments for new "high value" check * Refactor herald cache * Fix element order and namespaces for voice moods. * Add explicit .Stop() between audio player calls. * Use nullsafe member access instead of skipping * Don't queue up a title that's already queued. * Improve body ordinal handling for explorer speech titles. * Escape strings being inserted into xml * Handle flip-flopping JSON type * Converter for flip-flopping property type * Use the converter * Escape characters *before* we wrap it in xml. * Give Eahlstan his clear button. :D * Exclude all stars from fast rotation check. * Close outstanding popup notifications on exit. * TO DONE * [Herald] Suppress duplicate notification titles for spoken notifications If you have notifications from multiple plugins producing notifications with the same title in quick succession (ie. "Body A 1 e" from both Explorer and BioInsights), the title on successive notifications will not be spoken again to save the breath of our friendly Azure speakers. * Doc update * Remove unintended member hiding * Fix export errors when exporting BioInsights data, cleanup Discovered a couple issues with exporting BioInsights data resulting from using two different types of objects in the data grid; improved error handling as well. Also cleaned up some old-style read all code. * Add read-all on launch setting * Updated framework xml * Improve high-value body description text Co-authored-by: Fred Kuipers <mr.fredk@gmail.com>
This commit is contained in:
@ -9,18 +9,6 @@ namespace Observatory.Explorer
|
||||
{
|
||||
internal static class DefaultCriteria
|
||||
{
|
||||
private static IList<string> HighValueNonTerraformablePlanetClasses = new string[] {
|
||||
"Earthlike body",
|
||||
"Ammonia world",
|
||||
"Water world",
|
||||
};
|
||||
|
||||
private static IList<string> HighValueTerraformablePlanetClasses = new string[] {
|
||||
"Water world",
|
||||
"High metal content body",
|
||||
"Rocky body",
|
||||
};
|
||||
|
||||
public static List<(string Description, string Detail, bool SystemWide)> CheckInterest(Scan scan, Dictionary<ulong, Dictionary<int, Scan>> scanHistory, Dictionary<ulong, Dictionary<int, FSSBodySignals>> signalHistory, ExplorerSettings settings)
|
||||
{
|
||||
List<(string, string, bool)> results = new();
|
||||
@ -61,13 +49,25 @@ namespace Observatory.Explorer
|
||||
#region Value Checks
|
||||
if (settings.HighValueMappable)
|
||||
{
|
||||
if (HighValueTerraformablePlanetClasses.Contains(scan.PlanetClass) && scan.TerraformState?.Length > 0)
|
||||
IList<string> HighValueNonTerraformablePlanetClasses = new string[] {
|
||||
"Earthlike body",
|
||||
"Ammonia world",
|
||||
"Water world",
|
||||
};
|
||||
|
||||
if (HighValueNonTerraformablePlanetClasses.Contains(scan.PlanetClass) || scan.TerraformState?.Length > 0)
|
||||
{
|
||||
results.Add("High-Value Mapping", $"{scan.DistanceFromArrivalLS:0}Ls, {scan.PlanetClass} (TF)");
|
||||
}
|
||||
if (HighValueNonTerraformablePlanetClasses.Contains(scan.PlanetClass) && scan.TerraformState?.Length == 0)
|
||||
{
|
||||
results.Add("High-Value Mapping", $"{scan.DistanceFromArrivalLS:0}Ls, {scan.PlanetClass}");
|
||||
var info = new System.Text.StringBuilder();
|
||||
|
||||
if (!scan.WasDiscovered)
|
||||
info.Append("Undiscovered ");
|
||||
else if (!scan.WasMapped)
|
||||
info.Append("Unmapped ");
|
||||
|
||||
if (scan.TerraformState?.Length > 0)
|
||||
info.Append("Terraformable ");
|
||||
|
||||
results.Add("High-Value Body", $"{(info.Length > 1 ? info.ToString() : string.Empty)}{textInfo.ToTitleCase(scan.PlanetClass)}, {scan.DistanceFromArrivalLS:N0}Ls");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@ -143,7 +143,7 @@ namespace Observatory.Explorer
|
||||
results.Add("Nested Moon");
|
||||
}
|
||||
|
||||
if (settings.FastRotation && scan.RotationPeriod != 0 && !scan.TidalLock && Math.Abs(scan.RotationPeriod) < 28800 && !isRing)
|
||||
if (settings.FastRotation && scan.RotationPeriod != 0 && !scan.TidalLock && Math.Abs(scan.RotationPeriod) < 28800 && !isRing && string.IsNullOrEmpty(scan.StarType))
|
||||
{
|
||||
results.Add("Non-locked Body with Fast Rotation", $"Period: {scan.RotationPeriod/3600:N1} hours");
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ namespace Observatory.Explorer
|
||||
bodyAffix = string.Empty;
|
||||
}
|
||||
|
||||
string bodyLabel = scanEvent.PlanetClass == "Barycentre" ? "Barycentre" : "Body";
|
||||
string bodyLabel = System.Security.SecurityElement.Escape(scanEvent.PlanetClass == "Barycentre" ? "Barycentre" : "Body");
|
||||
|
||||
string spokenAffix;
|
||||
|
||||
@ -222,13 +222,13 @@ namespace Observatory.Explorer
|
||||
{
|
||||
int ringIndex = bodyAffix.Length - 6;
|
||||
spokenAffix =
|
||||
"<say-as interpret-as=\"spell-out\">" + bodyAffix.Substring(0, ringIndex) +
|
||||
"</say-as><break strength=\"weak\"/><say-as interpret-as=\"spell-out\">" +
|
||||
bodyAffix.Substring(ringIndex, 1) + "</say-as>" + bodyAffix.Substring(ringIndex + 1, bodyAffix.Length - (ringIndex + 1));
|
||||
"<say-as interpret-as=\"spell-out\">" + bodyAffix[..ringIndex]
|
||||
+ "</say-as><break strength=\"weak\"/>" + SplitOrdinalForSsml(bodyAffix.Substring(ringIndex, 1))
|
||||
+ bodyAffix[(ringIndex + 1)..];
|
||||
}
|
||||
else
|
||||
{
|
||||
spokenAffix = "<say-as interpret-as=\"spell-out\">" + bodyAffix + "</say-as>";
|
||||
spokenAffix = SplitOrdinalForSsml(bodyAffix);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -248,5 +248,18 @@ namespace Observatory.Explorer
|
||||
}
|
||||
}
|
||||
|
||||
private static string SplitOrdinalForSsml(string ordinalString)
|
||||
{
|
||||
var ordinalSegments = ordinalString.Split(' ');
|
||||
StringBuilder affix = new();
|
||||
foreach (var ordinalSegment in ordinalSegments)
|
||||
{
|
||||
if (ordinalSegment.All(Char.IsDigit))
|
||||
affix.Append(" " + ordinalSegment);
|
||||
else
|
||||
affix.Append("<say-as interpret-as=\"spell-out\">" + ordinalSegment + "</say-as>");
|
||||
}
|
||||
return affix.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ namespace Observatory.Explorer
|
||||
[SettingDisplayName("All Surface Mats In System")]
|
||||
public bool GoldSystem { get; set; }
|
||||
|
||||
[SettingDisplayName("High-Value Mapping")]
|
||||
[SettingDisplayName("High-Value Body")]
|
||||
public bool HighValueMappable { get; set; }
|
||||
|
||||
[SettingDisplayName("Enable Custom Criteria")]
|
||||
|
Reference in New Issue
Block a user