From 94b6f6ac1435d6c250231826bd25c99196d6c3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E5=8D=83=E5=B0=98?= <1836448651@qq.com> Date: Mon, 5 Oct 2026 22:36:01 +0800 Subject: [PATCH] =?UTF-8?q?The=20copied=20invite=20link=20carries=20an=20i?= =?UTF-8?q?nvitation=20line:=20=E3=80=8C{name}=E9=82=80=E8=AF=B7=E4=BD=A0?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=8D=AB=E6=88=8D=E5=8D=8F=E8=AE=AE=EF=BC=9A?= =?UTF-8?q?=E7=9B=9F=E7=BA=A6=E3=80=90{difficulty}=E3=80=91=E3=80=8D=20(#1?= =?UTF-8?q?03)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the clipboard text changes. Contributed by @LongQianChen. --- public/js/screens/room.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/screens/room.js b/public/js/screens/room.js index b14cb989..23c9c57f 100644 --- a/public/js/screens/room.js +++ b/public/js/screens/room.js @@ -153,9 +153,9 @@ function SpectatorBar({ facts, myId, busy, onRemove, onSit }) { `; } -function InviteBox({ code }) { +function InviteBox({ code, name, difficulty }) { const copy = async (what) => { - const ok = await copyText(what === 'code' ? code : inviteLink(code)); + const ok = await copyText(what === 'code' ? code : `${inviteLink(code)} ${name}邀请你加入卫戍协议:盟约【${DIFFICULTY_NAMES[difficulty]}】`); if (ok) toast(what === 'code' ? `已复制同盟密钥 ${code}` : '已复制邀请链接', 'success'); else toast('复制失败,请手动复制', 'warn'); }; @@ -280,7 +280,7 @@ export function RoomScreen() {

${coop ? '同盟模拟' : '独立模拟'}<${DifficultyTag} difficulty=${room.difficulty} size="lg" />

- ${coop ? html`<${InviteBox} code=${room.code} />` : html`
<${MicroLabel}>SINGLE OPERATOR仅限 1 名博士
`} + ${coop ? html`<${InviteBox} code=${room.code} name=${me.name} difficulty=${room.difficulty} />` : html`
<${MicroLabel}>SINGLE OPERATOR仅限 1 名博士
`}