Compare commits
No commits in common. "2253b879822e5fe26bd8115b954fdd8316b60daa" and "3f1af39ff1b639dcd8be19aee6dea3b11c7b2b3d" have entirely different histories.
2253b87982
...
3f1af39ff1
@ -1,24 +0,0 @@
|
||||
<Window x:Class="EliteBGS.AdjustProfitWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:EliteBGS"
|
||||
mc:Ignorable="d"
|
||||
Title="Adjust Trade Profit" Height="130" Width="450">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Use this dialog to adjust trade profits" Grid.Row="0" Grid.ColumnSpan="2" />
|
||||
<TextBox x:Name="Profit" Grid.Row="1" Grid.ColumnSpan="2" Margin="10,10,10,10"/>
|
||||
<Button x:Name="Cancel" Content="Cancel" Width="60" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" Margin="5,0,5,0" IsCancel="true" Click="Cancel_Click"/>
|
||||
<Button x:Name="Accept" Content="Accept" Width="60" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" Margin="5,0,5,0" IsDefault="true" Click="Accept_Click" />
|
||||
</Grid>
|
||||
</Window>
|
@ -1,34 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace EliteBGS {
|
||||
/// <summary>
|
||||
/// Interaction logic for AdjustProfitWindow.xaml
|
||||
/// </summary>
|
||||
public partial class AdjustProfitWindow : Window {
|
||||
public AdjustProfitWindow() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Cancel_Click(object sender, RoutedEventArgs e) {
|
||||
DialogResult = false;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void Accept_Click(object sender, RoutedEventArgs e) {
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
@ -7,8 +7,6 @@ namespace EliteBGS.BGS {
|
||||
public class LogEntry : IComparable<LogEntry> {
|
||||
private List<Entry> entries = new List<Entry>();
|
||||
|
||||
public bool IsExpanded { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controlling faction of the station this entry was made/turned into.
|
||||
/// </summary>
|
||||
|
@ -39,7 +39,6 @@ namespace EliteBGS.BGS {
|
||||
e.Is(Events.SellMicroResources) ||
|
||||
e.Is(Events.RedeemVoucher) ||
|
||||
e.Is(Events.FactionKillBond) ||
|
||||
e.Is(Events.MarketBuy) ||
|
||||
e.Is(Events.MarketSell)
|
||||
;
|
||||
}
|
||||
@ -56,8 +55,6 @@ namespace EliteBGS.BGS {
|
||||
|
||||
Dictionary<int, MissionAcceptedEntry> acceptedMissions = new Dictionary<int, MissionAcceptedEntry>();
|
||||
|
||||
Dictionary<string, int> buyCost = new Dictionary<string, int>();
|
||||
|
||||
string current_system = null;
|
||||
string current_station = null;
|
||||
string controlling_faction = null;
|
||||
@ -152,28 +149,11 @@ namespace EliteBGS.BGS {
|
||||
};
|
||||
|
||||
entry.Entries.Add(e);
|
||||
} else if (e.Is(Events.MarketBuy)) {
|
||||
MarketBuyEntry buy = e as MarketBuyEntry;
|
||||
if (string.IsNullOrEmpty(buy.Type) || buy.BuyPrice == 0) {
|
||||
continue;
|
||||
}
|
||||
buyCost[buy.Type] = buy.BuyPrice;
|
||||
} else if (e.Is(Events.MarketSell)) {
|
||||
MarketSellEntry sell = e as MarketSellEntry;
|
||||
int profit = 0;
|
||||
|
||||
if (!buyCost.ContainsKey(sell.Type)) {
|
||||
OnLog?.Invoke("Could not find buy order for the given commodity. Please adjust profit manually.");
|
||||
} else {
|
||||
int avg = buyCost[sell.Type];
|
||||
profit = sell.TotalSale - (avg * sell.Count);
|
||||
}
|
||||
|
||||
entry = new SellCargo() {
|
||||
Faction = controlling_faction,
|
||||
Station = current_station,
|
||||
System = current_system,
|
||||
Profit = profit
|
||||
System = current_system
|
||||
};
|
||||
|
||||
entry.Entries.Add(e);
|
||||
|
@ -4,7 +4,6 @@ using EDJournal;
|
||||
|
||||
namespace EliteBGS.BGS {
|
||||
public class SellCargo : LogEntry {
|
||||
public int Profit { get; set; }
|
||||
public override string ToString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
var sold = Entries.OfType<MarketSellEntry>().ToArray();
|
||||
@ -14,18 +13,11 @@ namespace EliteBGS.BGS {
|
||||
}
|
||||
|
||||
foreach (MarketSellEntry sell in sold) {
|
||||
builder.AppendFormat("Sold {0} {1} to the {2}",
|
||||
builder.AppendFormat("Sold {0} {1} to the {2}\n",
|
||||
sell.Count,
|
||||
sell.Type,
|
||||
sell.BlackMarket ? "Black Market" : "Commodity Market"
|
||||
);
|
||||
|
||||
if (Profit != 0) {
|
||||
builder.AppendFormat(" ({0} {1})",
|
||||
Credits.FormatCredits(Profit),
|
||||
Profit < 0 ? "loss" : "profit"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return builder.ToString().Trim();
|
||||
|
@ -1,11 +1,9 @@
|
||||
# EliteBGS changelog
|
||||
|
||||
## 0.1.0-beta3 on 12.01.2022
|
||||
## 0.1.0-beta3 on ??.??.????
|
||||
|
||||
* Collated failed missions into a single entry with a counter
|
||||
* Added failed missions to Nova Navy log template
|
||||
* Detect trade profit/loss
|
||||
* Allow adjusting trade profit/loss with a new window
|
||||
|
||||
## 0.1.0-beta2 on 09.01.2022
|
||||
|
||||
|
@ -77,9 +77,6 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="AdjustProfitWindow.xaml.cs">
|
||||
<DependentUpon>AdjustProfitWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BGS\DiscordLogGenerator.cs" />
|
||||
<Compile Include="BGS\GenericDiscordLog.cs" />
|
||||
<Compile Include="BGS\MissionFailed.cs" />
|
||||
@ -105,10 +102,6 @@
|
||||
<Compile Include="CombatZoneDialog.xaml.cs">
|
||||
<DependentUpon>CombatZoneDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="AdjustProfitWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -39,8 +39,6 @@
|
||||
<Button x:Name="AddFilter" Content="Add Objective" VerticalAlignment="Stretch" Click="AddFilter_Click" Margin="0,0,0,0.286" RenderTransformOrigin="0.5,0.505"/>
|
||||
<Separator Height="26.2857142857143" Margin="0" VerticalAlignment="Top"/>
|
||||
<Button x:Name="AddCombatZone" Content="Add Combat Zone Win" VerticalAlignment="Stretch" Margin="0,0,0,0.286" RenderTransformOrigin="0.5,0.505" Click="AddCombatZone_Click"/>
|
||||
<Separator Height="26.2857142857143" Margin="0" VerticalAlignment="Top"/>
|
||||
<Button x:Name="AdjustProfit" Content="Adjust Trade Profit" Margin="0" VerticalAlignment="Stretch" Click="AdjustProfit_Click" />
|
||||
</ToolBar>
|
||||
<ToolBar VerticalAlignment="Top" Grid.Row="1" Width="Auto" Margin="0,0,0,0" Height="Auto" Grid.ColumnSpan="3" HorizontalAlignment="Left">
|
||||
<Button x:Name="ParseJournal" Content="Parse Journal" VerticalAlignment="Center" Click="ParseJournal_Click" HorizontalAlignment="Center"/>
|
||||
|
@ -277,25 +277,5 @@ namespace EliteBGS {
|
||||
objective.LogEntries.Add(zone);
|
||||
RefreshObjectives();
|
||||
}
|
||||
|
||||
private void AdjustProfit_Click(object sender, RoutedEventArgs e) {
|
||||
if (entries.SelectedItem == null || entries.SelectedItem.GetType() != typeof(SellCargo)) {
|
||||
return;
|
||||
}
|
||||
|
||||
SellCargo sell = entries.SelectedItem as SellCargo;
|
||||
AdjustProfitWindow adjust = new AdjustProfitWindow() { Owner = this };
|
||||
|
||||
adjust.Profit.Text = sell.Profit.ToString();
|
||||
|
||||
if (!(adjust.ShowDialog() ?? false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (int.TryParse(adjust.Profit.Text, out int newprofit)) {
|
||||
sell.Profit = newprofit;
|
||||
RefreshObjectives();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,20 +24,11 @@ will check your Elite Dangerous player journal for completed missions. Currently
|
||||
recognises the following completed tasks:
|
||||
|
||||
* Completed missions
|
||||
* Failed missions
|
||||
* Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages)
|
||||
* Selling of micro resources (Odyssey only)
|
||||
* Selling cartography data
|
||||
* Selling of cargo to stations
|
||||
|
||||
Selling cargo attempts to discern the profit and/or loss, which is helpful to gauge BGS
|
||||
impact. But the player journal does not tell the amount of profit in the sell message.
|
||||
So the tool looks for a buy a message related to the same commodity, and calculates loss
|
||||
and/or profit from that. If the buy of the commodity is not within the time and date range,
|
||||
or some other shenanigans happen that the tool does not yet support the profit/loss could
|
||||
be wrong. You can use the "Adjust Trade Profit" button to manually adjust the trade profit,
|
||||
or you could simply edit the discord log manually.
|
||||
|
||||
Please note that cartography data, and micro resources only help the controlling faction
|
||||
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.
|
||||
|
BIN
main-entries.png
BIN
main-entries.png
Binary file not shown.
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 32 KiB |
Binary file not shown.
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 19 KiB |
Loading…
x
Reference in New Issue
Block a user