ui: skin bank page with right-aligned table and touch ops

This commit is contained in:
ZHU MINCHAO committed 2026-11-04 09:59:45 +08:00
1 parent 6926f994fd
commit 37c5362913
1 file changed
+7 -4
+7 -4
View File
@@ -182,7 +182,7 @@ namespace Decentralized
private static void BankPage(CustomUIBuilder b) private static void BankPage(CustomUIBuilder b)
{ {
var ps = PlayerStore.Instance; var ps = PlayerStore.Instance;
var w = new[] { 200f, 220f }; var w = new[] { 180f, 220f };
Columns(b, l => Columns(b, l =>
{ {
l.AddHeader(L.T("entry.bank")); l.AddHeader(L.T("entry.bank"));
@@ -194,8 +194,11 @@ namespace Decentralized
r.AddHeader(L.T("bank.ops")); r.AddHeader(L.T("bank.ops"));
AmountRow(r); AmountRow(r);
AmlPreview(r); AmlPreview(r);
r.AddSpace(4f);
r.BeginRow(6f);
r.AddButton(L.T("trade.deposit"), Deposit); r.AddButton(L.T("trade.deposit"), Deposit);
r.AddButton(L.T("trade.withdraw"), Withdraw); r.AddButton(L.T("trade.withdraw"), Withdraw);
r.End();
}); });
} }
@@ -207,17 +210,17 @@ namespace Decentralized
double rent = Session.Rent(); double rent = Session.Rent();
double recent = d.Exchange.History.Where(h => h.Key > day - Tuning.AmlWindowDays).Sum(h => h.Value); double recent = d.Exchange.History.Where(h => h.Key > day - Tuning.AmlWindowDays).Sum(h => h.Value);
b.AddSeparator(); b.AddSeparator();
b.AddLabel(L.T("aml.window", Tuning.AmlWindowDays, Fmt.Credits(recent), Fmt.Credits(Tuning.AmlCumRents * rent))); b.AddLabel(L.T("aml.window", Tuning.AmlWindowDays, Fmt.Credits(recent), Fmt.Credits(Tuning.AmlCumRents * rent)), "aml_dim");
var pb = d.Poinbase; var pb = d.Poinbase;
double total = pb.Value(Session.Price); double total = pb.Value(Session.Price);
double taintRatio = total > 0 ? pb.Taint / total : 0; double taintRatio = total > 0 ? pb.Taint / total : 0;
b.AddLabel(L.T("aml.taint", (int)Math.Round(taintRatio * 100))); b.AddLabel(L.T("aml.taint", (int)Math.Round(taintRatio * 100)), taintRatio > 0.05 ? "aml_note" : "aml_dim");
if (double.TryParse((_amount ?? "").Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out double v) && v > 0) if (double.TryParse((_amount ?? "").Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out double v) && v > 0)
{ {
double value = Math.Min(v, pb.Get(Assets.CRC)) * Session.Price(Assets.CRC); double value = Math.Min(v, pb.Get(Assets.CRC)) * Session.Price(Assets.CRC);
double taint = total > 0 ? pb.Taint * Math.Min(1, value / total) : 0; double taint = total > 0 ? pb.Taint * Math.Min(1, value / total) : 0;
double chance = Exchange.HitChance(value, taint, recent, rent, pb.Flagged); double chance = Exchange.HitChance(value, taint, recent, rent, pb.Flagged);
b.AddLabel(L.T("aml.chance", (int)Math.Round(chance * 100))); b.AddLabel(L.T("aml.chance", (int)Math.Round(chance * 100)), chance > 0.1 ? "aml_chance_note" : "aml_chance_dim");
} }
} }