Add a settings page for profit display and default stack

- Per-device toggle to hide your own net and the net ranking at tables
- Default starting stack set in settings; creating a table saves the
  stack, SB and BB used as the next defaults
- Number fields on create and settings select all on focus

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
agomizi1cmandClaude Opus 5.5 committed 2026-10-23 12:31:32 +09:00
1 parent ed3d1e437e
commit 22ee28ba03
9 files changed
+160 -8

No files matched your search

+10 -5
View File
@@ -437,8 +437,9 @@
const o = m.options;
Fluid.countTo($('my-stack'), m.stack, chips);
const net = m.net;
$('my-net').textContent = `収支 ${net > 0 ? '+' : net < 0 ? '−' : '±'}${chips(Math.abs(net))}`;
// 収支は設定で消せる(この端末だけ)
const net = Store.showNet ? m.net : null;
$('my-net').textContent = net == null ? '' : `収支 ${net > 0 ? '+' : net < 0 ? '−' : '±'}${chips(Math.abs(net))}`;
$('my-net').className = net > 0 ? 'plus' : net < 0 ? 'minus' : '';
$('my-bet').textContent = seat.inHand && seat.bet > 0 ? `ベット中 ${chips(seat.bet)}` : '';
$('my-hand').textContent = (seat.inHand && seat.handName) || '';
@@ -642,8 +643,11 @@
net: '収支 = 持っているチップ − バイインの合計(リバイを含む)',
};
// 収支を表示しない設定のときはスタック順だけ
const rankMode = () => (Store.showNet ? rankBy : 'stack');
function rankingEntries(s) {
const key = rankBy === 'net' ? 'net' : 'held';
const key = rankMode() === 'net' ? 'net' : 'held';
const list = s.seats.filter(Boolean).sort((a, b) => b[key] - a[key] || a.seat - b.seat);
let rank = 0;
return list.map((p, i) => {
@@ -694,7 +698,7 @@
const sub = [p.seat === s.mySeat && 'あなた', p.bot && 'CPU', p.sittingOut && '離席中', !p.connected && 'オフライン']
.filter(Boolean)
.join(' ・ ');
const net = rankBy === 'net';
const net = rankMode() === 'net';
patch(
el,
`<span class="rank-no${rank <= 3 ? ` top-${rank}` : ''}">${rank}</span>` +
@@ -712,7 +716,8 @@
rankRows.delete(seat);
}
slideFrom(before); // 順位が変わった行は元の位置から滑らせる
$('ranking-note').textContent = RANK_NOTE[rankBy];
$('ranking-tabs').hidden = !Store.showNet;
$('ranking-note').textContent = RANK_NOTE[rankMode()];
if (!s.seats.some(Boolean)) listEl.innerHTML = '<li class="empty">まだ誰も座っていません</li>';
}