卖货页与订单页分栏,永续表头列宽,手册合并为 16 章

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Sonnet 5.5 committed 2026-11-04 13:37:54 +08:00
1 parent cfe598d2fc
commit 0520895b18
5 files changed
+40 -17

No files matched your search

+31 -15
View File
@@ -322,7 +322,7 @@ namespace Decentralized
private static string _perpProduct = "PSC";
private static bool _perpLong = true;
private static int _perpLev = 3;
private static readonly float[] PerpW = { 90f, 85f, 80f, 90f, 55f };
private static readonly float[] PerpW = { 80f, 70f, 110f, 60f, 70f };
private static readonly TextAnchor[] PerpAligns = { TextAnchor.MiddleLeft, TextAnchor.MiddleRight, TextAnchor.MiddleRight, TextAnchor.MiddleRight, TextAnchor.MiddleRight };
private static double PerpSpot(string p) => p == "SPARK" ? Session.Data.Stable.Spark : Session.Data.Market.Price;
@@ -1374,21 +1374,27 @@ namespace Decentralized
}
private static double _sellMult = 1.0;
private static readonly double[] SellMults = { 0.6, 0.8, 0.9, 1.0, 1.2, 1.5, 1.8 };
/// <summary>出售:储藏区里能上架的货做成货架,选标价倍率后上架。</summary>
private static void SellPage(CustomUIBuilder b, int day)
{
var d = Session.Data;
b.BeginRow(4f);
foreach (var m in SellMults)
var items = BlackDelivery.Sellable();
b.BeginRow(8f, TextAnchor.UpperLeft);
b.BeginPanel(SellerW + 8f, -1f, TextAnchor.UpperLeft, 0f, 2f);
_clear.Add(b.Last.image);
b.AddLabel(L.T("black.sell.mult"), "sell_mult_dim");
foreach (var m in Tuning.BmSellMults)
{
double mult = m;
string n = m.ToString("0.0", CultureInfo.InvariantCulture);
PledgerSkin.Pick(b, "×" + n, Math.Abs(mult - _sellMult) < 1e-9, () => { _sellMult = mult; Open(); }, _picked);
TableRow(b, SellerW, new[] { 70f, SellerW - 78f }, new[] { TextAnchor.MiddleLeft, TextAnchor.MiddleRight },
new[] { "×" + m.ToString("0.0", CultureInfo.InvariantCulture), L.T("black.sell.days", Math.Round(BlackMarket.ExpectedDays(m))) },
Math.Abs(mult - _sellMult) < 1e-9, () => { _sellMult = mult; Open(); });
}
b.End();
b.AddLabel(L.T("black.sell.rating", d.Black.Rating) + " " + L.T("black.sell.slots", d.Black.ActiveListings, Tuning.BmMaxListings), "sell_status_dim");
b.AddSpace(4f);
b.AddLabel(L.T("black.sell.rating", d.Black.Rating), "sell_status_dim");
b.AddLabel(L.T("black.sell.slots", d.Black.ActiveListings, Tuning.BmMaxListings), "sell_status_dim");
b.AddSpace(4f);
b.AddButton(L.T("black.sell.all"), () =>
{
double mult = _sellMult;
@@ -1399,10 +1405,11 @@ namespace Decentralized
Credits = (q, m) => fee, Execute = (asset, q, m, pw) => ListAll(asset, mult, pw),
});
});
b.AddSeparator();
var items = BlackDelivery.Sellable();
if (items.Count == 0) { b.AddLabel(L.T("black.sell.none"), "sell_none_dim"); return; }
Shelf(b, items.Select(it =>
b.End();
b.BeginPanel(ShelfW, -1f, TextAnchor.UpperLeft, 0f, 4f);
_clear.Add(b.Last.image);
if (items.Count == 0) b.AddLabel(L.T("black.sell.none"), "sell_none_dim");
else Shelf(b, items.Select(it =>
{
string id = BlackDelivery.SellId(it);
var kind = BlackDelivery.KindOf(id);
@@ -1417,7 +1424,9 @@ namespace Decentralized
c.AddLabel(L.T("black.price", g.Price));
c.AddFlexibleSpace();
c.AddButton(L.T("black.sell.list"), () => BeginEdit(new EditPrice { Item = it, Id = g.Item, Ref = BlackDelivery.RefValue(it) }, g.Price));
});
}, 3);
b.End();
b.End();
}
private static readonly System.Collections.Generic.Dictionary<BmGood, GameItem> SellCards = new System.Collections.Generic.Dictionary<BmGood, GameItem>();
@@ -1837,7 +1846,7 @@ namespace Decentralized
b.AddInput(L.T("black.edit.input"), _editPrice, s => _editPrice = s, "price", s => _editPrice = s);
b.End();
b.BeginRow(4f);
foreach (var m in SellMults)
foreach (var m in Tuning.BmSellMults)
{
double mult = m;
string label = "×" + m.ToString("0.0", CultureInfo.InvariantCulture);
@@ -1890,11 +1899,16 @@ namespace Decentralized
private static void OrdersPage(CustomUIBuilder b, int day)
{
var d = Session.Data;
b.BeginRow(8f, TextAnchor.UpperLeft);
b.BeginPanel(SellerW + 8f + 150f, -1f, TextAnchor.UpperLeft, 4f, 4f);
_clear.Add(b.Last.image);
b.AddHeader(L.T("black.orders.in"));
if (d.Black.Orders.Count == 0) b.AddLabel(L.T("black.mine.none"), "orders_in_none_dim");
foreach (var o in d.Black.Orders.OrderByDescending(x => x.PlacedDay))
b.AddLabel(L.T("black.mine.line", ItemName(o.Item) + (o.Count > 1 ? " ×" + o.Count : ""), BlackDelivery.DisplayName(o.Seller), L.T("black.mode." + o.Mode), L.T("black.state." + o.State + (o.Why != null && o.State != OrderState.Done ? "." + o.Why : "")), o.DueDay));
b.AddSeparator();
b.End();
b.BeginPanel(ShelfW - 150f, -1f, TextAnchor.UpperLeft, 4f, 4f);
_clear.Add(b.Last.image);
b.AddHeader(L.T("black.orders.out"));
if (d.Black.Sales.Count == 0) b.AddLabel(L.T("black.mine.none"), "orders_out_none_dim");
foreach (var sl in d.Black.Sales.Where(x => x.State != SaleState.Delisted || x.Why == "fake").OrderByDescending(x => x.ListedDay))
@@ -1910,6 +1924,8 @@ namespace Decentralized
b.End();
}
}
b.End();
b.End();
}
/// <summary>匿名币兑换:Web3 交易页里的一个通用兑换块,带"匿名币"标签。要黑市声望,有每日额度;兑入时这部分价值的污点被清除。</summary>