// public/js/screens/game/overlays.js — the match-ended plate and the solo pause plate.
import { Button, MicroLabel, html } from '../../ui/components.js';
import { emptyMatch, store } from '../../store.js';
import { localAsset } from '../../data.js';
/** The room went back to its lobby without a result (match aborted): offer the way back. */
export function MatchEnded() {
return html`
<${MicroLabel} tone="mint">SIMULATION CLOSED${MicroLabel}>
本局模拟已结束
同盟已返回等待室
<${Button} variant="primary" size="lg" icon="chevronLeft" onClick=${() => store.set({ match: emptyMatch() })}>返回同盟/>
`;
}
/** Solo pause (m.public.paused): the field dims under the 暂停中 plate; 继续作战 resumes (g.pause off). */
export function PausedOverlay({ canResume, busy, onResume, onExit }) {
const plate = localAsset('ui/battle', 'matte_pause');
return html`
PAUSED
暂停中
作战已暂停,计时与敌人行动均已停止
${onExit ? html`<${Button} variant="secondary" size="lg" icon="exit" onClick=${onExit}>放弃模拟/>` : null}
${canResume ? html`<${Button} variant="primary" size="lg" icon="play" loading=${busy} onClick=${onResume} data-autofocus>继续作战/>` : null}
`;
}