Compare commits

..

No commits in common. "e721d96d671ad418d8c5150aed05969876bb4fcb" and "6dda7cfde4388d6b2d0a9a1ab1f356d40ebf5999" have entirely different histories.

3 changed files with 16 additions and 40 deletions

View File

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

View File

@ -34,7 +34,6 @@ 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) ||
@ -74,18 +73,6 @@ 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 };
@ -158,24 +145,20 @@ 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; /* Then select the one that matches the most.
if (matches != null && matches.Count() > 0) { */
/* Then select the one that matches the most. var objective = matches
*/ .OrderBy(x => x.Matches(entry))
objective = matches .Reverse()
.OrderBy(x => x.Matches(entry)) .First()
.Reverse() ;
.First()
; if (objective == null) {
} else { continue;
/* create a new objective if we don't have one */
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="Generate Discord Report" VerticalAlignment="Center" Margin="0,0,0,4.857" Click="GenerateDiscord_Click" Height="26"/> <Button x:Name="GenerateDiscord" Content="Genereate 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>