Compare commits

...

3 Commits

3 changed files with 40 additions and 16 deletions

View File

@ -9,7 +9,14 @@ namespace EliteBGS.BGS {
} }
public string MissionName { public string MissionName {
get { return (Entries[0] as MissionCompletedEntry).HumanReadableName; } get {
MissionCompletedEntry c = Entries[0] as MissionCompletedEntry;
if (string.IsNullOrEmpty(c.HumanReadableName)) {
return c.Name;
} else {
return c.HumanReadableName;
}
}
} }
public string Influence { public string Influence {
@ -24,7 +31,7 @@ namespace EliteBGS.BGS {
var entry = Entries[0] as MissionCompletedEntry; var entry = Entries[0] as MissionCompletedEntry;
var influence = entry.GetInfluenceForFaction(Faction); var influence = entry.GetInfluenceForFaction(Faction);
builder.AppendFormat("{0}", entry.HumanReadableName); builder.AppendFormat("{0}", MissionName);
if (influence != "") { if (influence != "") {
builder.AppendFormat(", Influence: {0}", influence); builder.AppendFormat(", Influence: {0}", influence);
} }

View File

@ -34,6 +34,7 @@ namespace EliteBGS.BGS {
e.Is(Events.MissionAccepted) || e.Is(Events.MissionAccepted) ||
e.Is(Events.Docked) || e.Is(Events.Docked) ||
e.Is(Events.FSDJump) || e.Is(Events.FSDJump) ||
e.Is(Events.Location) ||
e.Is(Events.MultiSellExplorationData) || e.Is(Events.MultiSellExplorationData) ||
e.Is(Events.SellMicroResources) || e.Is(Events.SellMicroResources) ||
e.Is(Events.RedeemVoucher) || e.Is(Events.RedeemVoucher) ||
@ -73,6 +74,18 @@ namespace EliteBGS.BGS {
*/ */
current_system = (e as FSDJumpEntry).StarSystem; current_system = (e as FSDJumpEntry).StarSystem;
controlling_faction = (e as FSDJumpEntry).SystemFaction; controlling_faction = (e as FSDJumpEntry).SystemFaction;
} else if (e.Is(Events.Location)) {
/* Get current system, faction name and station from Location message
*/
LocationEntry location = e as LocationEntry;
current_system = location.StarSystem;
if (!string.IsNullOrEmpty(location.SystemFaction)) {
controlling_faction = location.SystemFaction;
}
if (!string.IsNullOrEmpty(location.StationName)) {
current_station = location.StationName;
}
} else if (e.Is(Events.MissionCompleted)) { } else if (e.Is(Events.MissionCompleted)) {
var completed = e as MissionCompletedEntry; var completed = e as MissionCompletedEntry;
entry = new MissionCompleted(completed) { System = current_system, Station = current_station }; entry = new MissionCompleted(completed) { System = current_system, Station = current_station };
@ -145,20 +158,24 @@ namespace EliteBGS.BGS {
.Where(x => x.Matches(entry) > 0) .Where(x => x.Matches(entry) > 0)
.OrderBy(x => x.Matches(entry)) .OrderBy(x => x.Matches(entry))
; ;
if (matches == null || matches.Count() <= 0) {
continue;
}
Objective objective = null;
if (matches != null && matches.Count() > 0) {
/* Then select the one that matches the most. /* Then select the one that matches the most.
*/ */
var objective = matches objective = matches
.OrderBy(x => x.Matches(entry)) .OrderBy(x => x.Matches(entry))
.Reverse() .Reverse()
.First() .First()
; ;
} else {
if (objective == null) { /* create a new objective if we don't have one */
continue; objective = new Objective() {
Station = entry.Station,
Faction = entry.Faction,
System = entry.System,
};
objectives.Add(objective);
} }
LogEntry existing = null; LogEntry existing = null;

View File

@ -62,7 +62,7 @@
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<ToolBar HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="Auto"> <ToolBar HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="Auto">
<Button x:Name="GenerateDiscord" Content="Genereate Discord Report" VerticalAlignment="Center" Margin="0,0,0,4.857" Click="GenerateDiscord_Click" Height="26"/> <Button x:Name="GenerateDiscord" Content="Generate Discord Report" VerticalAlignment="Center" Margin="0,0,0,4.857" Click="GenerateDiscord_Click" Height="26"/>
</ToolBar> </ToolBar>
<TextBox x:Name="DiscordLog" Height="Auto" TextWrapping="Wrap" FontFamily="Consolas" FontSize="14" Grid.Row="1" Grid.ColumnSpan="2" AcceptsReturn="True" AcceptsTab="True"/> <TextBox x:Name="DiscordLog" Height="Auto" TextWrapping="Wrap" FontFamily="Consolas" FontSize="14" Grid.Row="1" Grid.ColumnSpan="2" AcceptsReturn="True" AcceptsTab="True"/>
</Grid> </Grid>