Изменение отображения скидок в аплинке (#266)

* Better sales

* Sale item restrictions
This commit is contained in:
Aviu00
2023-08-04 16:00:49 +03:00
committed by Aviu00
parent b34ade60d8
commit 0c098d9c53
5 changed files with 65 additions and 2 deletions

View File

@@ -38,8 +38,10 @@ public sealed partial class StoreSystem
if (listing.Cost.Any(x => x.Value.Int() != newCost[x.Key].Int()))
{
var key = listing.Cost.First(x => x.Value > 0).Key;
listingData.OldCost = listing.Cost;
listingData.SaleAmount = 100 - (newCost[key] / listing.Cost[key] * 100).Int();
listingData.Cost = newCost;
listingData.SaleAmount = 100 - (int) MathF.Round(sale.Item1 * 100);
listingData.Categories = new() {sale.Item2};
}
}