Compare commits
4 Commits
0fdd3e2c9a
...
479fcca851
Author | SHA1 | Date | |
---|---|---|---|
479fcca851 | |||
1d747756ac | |||
3b1fc79dba | |||
4b4b1a1161 |
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace NonaBGS.BGS {
|
||||
public class CombatZone : LogEntry, IComparable {
|
||||
@ -24,7 +25,8 @@ namespace NonaBGS.BGS {
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return string.Format("Won {0} x {1} {2} Combat Zone(s)", Amount, Type, Grade);
|
||||
return string.Format("Won {0} x {1} {2} Combat Zone(s) for {3}",
|
||||
Amount, Grade, Type, Faction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,9 @@ namespace NonaBGS.BGS {
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return string.Format("Faction Kill Bonds: {0}", Credits.FormatCredits(TotalSum));
|
||||
return string.Format("Faction Kill Bonds: {0} against {1}",
|
||||
Credits.FormatCredits(TotalSum),
|
||||
VictimFaction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,26 @@ namespace NonaBGS.BGS {
|
||||
"(Total value: {1} CR)\n", pages, sum);
|
||||
}
|
||||
|
||||
private string BuildCargoSold(Objective objective) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
SellCargo[] sold = objective.LogEntries
|
||||
.OfType<SellCargo>()
|
||||
.ToArray()
|
||||
;
|
||||
|
||||
if (sold == null && sold.Length > 0) {
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
foreach (SellCargo sell in sold) {
|
||||
builder.AppendFormat("{0}\n", sell.ToString());
|
||||
}
|
||||
|
||||
builder.AppendFormat("\n");
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
private string BuildMicroResourcesSold(Objective objective) {
|
||||
var total = from entries in objective.LogEntries
|
||||
where entries.GetType() == typeof(SellMicroResources)
|
||||
@ -199,6 +219,9 @@ namespace NonaBGS.BGS {
|
||||
var micro = BuildMicroResourcesSold(objective);
|
||||
entries.Append(micro);
|
||||
|
||||
var sold = BuildCargoSold(objective);
|
||||
entries.Append(sold);
|
||||
|
||||
log.Append(entries.ToString().Trim());
|
||||
log.Append("\n```\n");
|
||||
}
|
||||
|
@ -35,7 +35,8 @@ namespace NonaBGS.BGS {
|
||||
e.Is(Events.MultiSellExplorationData) ||
|
||||
e.Is(Events.SellMicroResources) ||
|
||||
e.Is(Events.RedeemVoucher) ||
|
||||
e.Is(Events.FactionKillBond)
|
||||
e.Is(Events.FactionKillBond) ||
|
||||
e.Is(Events.MarketSell)
|
||||
;
|
||||
}
|
||||
|
||||
@ -105,6 +106,14 @@ namespace NonaBGS.BGS {
|
||||
collate = true;
|
||||
} else if (e.Is(Events.SellMicroResources)) {
|
||||
entry = new SellMicroResources(current_system, current_station);
|
||||
entry.Entries.Add(e);
|
||||
} else if (e.Is(Events.MarketSell)) {
|
||||
entry = new SellCargo() {
|
||||
Faction = controlling_faction,
|
||||
Station = current_station,
|
||||
System = current_system
|
||||
};
|
||||
|
||||
entry.Entries.Add(e);
|
||||
}
|
||||
|
||||
|
31
BGS/SellCargo.cs
Normal file
31
BGS/SellCargo.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using EDJournal;
|
||||
|
||||
namespace NonaBGS.BGS {
|
||||
public class SellCargo : LogEntry {
|
||||
public override string ToString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
var sold = Entries.OfType<MarketSellEntry>().ToArray();
|
||||
|
||||
if (sold == null || sold.Length == 0) {
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
foreach (MarketSellEntry sell in sold) {
|
||||
builder.AppendFormat("Sold {0} {1} to the {2}\n",
|
||||
sell.Count,
|
||||
sell.Type,
|
||||
sell.BlackMarket ? "Black Market" : "Commodity Market"
|
||||
);
|
||||
}
|
||||
|
||||
return builder.ToString().Trim();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selling resources to a market only helps the controlling faction
|
||||
/// </summary>
|
||||
public override bool OnlyControllingFaction => true;
|
||||
}
|
||||
}
|
@ -25,7 +25,7 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ComboBox x:Name="type" Grid.Column="0" VerticalAlignment="Top" Width="Auto" IsReadOnly="True" Height="23" Margin="5" SelectedIndex="0">
|
||||
<ComboBoxItem Content="Space"/>
|
||||
<ComboBoxItem Content="Ship"/>
|
||||
<ComboBoxItem Content="On Foot"/>
|
||||
</ComboBox>
|
||||
<ComboBox x:Name="grade" Grid.Column="1" VerticalAlignment="Top" IsReadOnly="True" Margin="5" Height="23" Width="Auto" SelectedIndex="0">
|
||||
|
@ -32,6 +32,13 @@ Please note that cartography data, micro resources, and vouchers only help the c
|
||||
of a station. The tool is clever enough to exclude these if the station you turn them in at, is not
|
||||
controlled by the faction you specified in the objective.
|
||||
|
||||
There is no entry in the journal if you win a combat zone. So you have to add those manually. Select
|
||||
an objective for which you wish to log a combat zone. The faction in the objective, must be the
|
||||
faction you fought for in the combat zone. Then click "Add Combat Zone Win". Select type,
|
||||
either "On Foot" for Odyssey, or "Ship" for regular ones. Then select the grade (low, medium or
|
||||
high), and how many you won. Then press "Accept". Select "Cancel" to abort. You can of course remove
|
||||
the combat zone entries by selecting them, and pressing "DEL".
|
||||
|
||||
![Main Window with entries](main-entries.png)
|
||||
|
||||
The window will then list all the journal entries it has found, and group them by objectives. You
|
||||
|
@ -41,7 +41,8 @@
|
||||
<Reference Include="AutoCompleteTextBox, Version=1.1.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>packages\AutoCompleteTextBox.1.1.1\lib\net472\AutoCompleteTextBox.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EDJournal">
|
||||
<Reference Include="EDJournal, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\edjournal\bin\Debug\EDJournal.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
@ -75,6 +76,7 @@
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="BGS\DiscordLogGenerator.cs" />
|
||||
<Compile Include="BGS\NonaDiscordLog.cs" />
|
||||
<Compile Include="BGS\SellCargo.cs" />
|
||||
<Compile Include="BGS\SellMicroResources.cs" />
|
||||
<Compile Include="BGS\FactionKillBonds.cs" />
|
||||
<Compile Include="EDDB\PopulatedSystems.cs" />
|
||||
|
Reference in New Issue
Block a user