Show a full reserve count on the Sokko TCG menu icon and remaining openings while opening a pack
A gold count now sits on the Sokko TCG menu icon while the opening reserve is full, so players notice it from any page. A light reserve route keeps it up to date outside the game, and the game page updates it with every state it gets. The opening stage also lists the remaining openings, apart for the automatic recharge and for openings bought one at a time, since the sidebar reserve is hidden there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2231bf05e1
commit
498e171bc3
14 changed files with 186 additions and 4 deletions
|
|
@ -30,6 +30,7 @@ export function PackPanel({ catalog, state, runMutation, busy, content, reserveC
|
|||
busy={busy}
|
||||
content={content}
|
||||
shopShare={state.shop.shopPackShare}
|
||||
remaining={{ reserve: state.recharge.openingsBalance, purchased: state.wallet.purchasedOpenings }}
|
||||
onComplete={async () => {
|
||||
setCompletedOpening(opening);
|
||||
return runMutation(() => completeOpening(opening.id));
|
||||
|
|
@ -124,7 +125,7 @@ function OpeningOdds({ catalog, opening, collection, content, shopShare }) {
|
|||
</section>;
|
||||
}
|
||||
|
||||
function OpeningStage({ catalog, opening, onComplete, onDismiss, onOpenAnother, focusOnMountRef, busy, content, shopShare }) {
|
||||
function OpeningStage({ catalog, opening, onComplete, onDismiss, onOpenAnother, focusOnMountRef, remaining, busy, content, shopShare }) {
|
||||
const [revealed, setRevealed] = useState(new Set());
|
||||
const [finishedReveals, setFinishedReveals] = useState(new Set());
|
||||
const [completed, setCompleted] = useState(false);
|
||||
|
|
@ -160,7 +161,14 @@ function OpeningStage({ catalog, opening, onComplete, onDismiss, onOpenAnother,
|
|||
}
|
||||
|
||||
return <section className="nebula-opening-stage" aria-labelledby="nebula-opening-title">
|
||||
<div className="nds-section-heading nebula-section-heading"><div><p className="eyebrow">Paquet attribué</p><h2 id="nebula-opening-title">Révélez vos trois cartes</h2></div>
|
||||
<div className="nds-section-heading nebula-section-heading"><div><p className="eyebrow">Paquet attribué</p><h2 id="nebula-opening-title">Révélez vos trois cartes</h2>
|
||||
<div className="nebula-opening-remaining"><span>{content.remainingLabel} :</span>
|
||||
<dl aria-label={content.remainingLabel}>
|
||||
<div><dt>{content.remainingReserve}</dt><dd>{remaining.reserve}</dd></div>
|
||||
<div><dt>{content.remainingPurchased}</dt><dd>{remaining.purchased}</dd></div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
{!allStarted && <button ref={revealAllRef} className="nds-button" data-size="sm" data-variant="secondary" type="button" onClick={() => setRevealed(new Set(opening.cards.map((card) => card.id)))}>Tout révéler</button>}
|
||||
{allRevealed && <div className="nds-toolbar">
|
||||
<button className="nds-button" data-size="sm" data-variant="secondary" type="button" disabled={busy} onClick={finish}>{content.back}</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue