fix: add big fish runtime settlement prompt

This commit is contained in:
2026-04-25 14:06:18 +08:00
parent 019dd9efba
commit e99714838f
2 changed files with 35 additions and 0 deletions

View File

@@ -241,6 +241,7 @@
1. 展示会话、草稿、资产槽位、运行快照。 1. 展示会话、草稿、资产槽位、运行快照。
2. 发送聊天、action 和摇杆输入。 2. 发送聊天、action 和摇杆输入。
3. 根据后端 snapshot 渲染实体。 3. 根据后端 snapshot 渲染实体。
4. 当后端 snapshot 返回 `won``failed` 时,必须在玩法舞台中央显示清晰结算浮层;通关与失败都不能只依赖顶部状态标签或事件日志。
前端禁止: 前端禁止:

View File

@@ -108,6 +108,24 @@ function resolveRuntimeEntityAsset(
); );
} }
function resolveSettlementCopy(run: BigFishRuntimeSnapshotResponse) {
if (run.status === 'won') {
return {
title: '通关完成',
message: `已成长到 Lv.${run.playerLevel},本轮生态征服完成。`,
tone: 'from-emerald-300/28 via-cyan-300/18 to-white/10',
};
}
if (run.status === 'failed') {
return {
title: '本轮失败',
message: '己方鱼群已经耗尽,重新调整路线再来一次。',
tone: 'from-rose-300/30 via-orange-300/16 to-white/10',
};
}
return null;
}
function BigFishEntityDot({ function BigFishEntityDot({
entity, entity,
run, run,
@@ -241,6 +259,7 @@ export function BigFishRuntimeShell({
const statusLabel = const statusLabel =
run.status === 'won' ? '通关' : run.status === 'failed' ? '失败' : '进行中'; run.status === 'won' ? '通关' : run.status === 'failed' ? '失败' : '进行中';
const settlementCopy = resolveSettlementCopy(run);
const backgroundAsset = const backgroundAsset =
findBigFishAssetSlot(assetSlots, 'stage_background')?.assetUrl?.trim() || null; findBigFishAssetSlot(assetSlots, 'stage_background')?.assetUrl?.trim() || null;
@@ -298,6 +317,21 @@ export function BigFishRuntimeShell({
))} ))}
</div> </div>
{settlementCopy ? (
<div className="pointer-events-none absolute inset-0 z-40 flex items-center justify-center px-5">
<div
className={`w-full max-w-[20rem] rounded-[2rem] border border-white/24 bg-gradient-to-br ${settlementCopy.tone} p-6 text-center shadow-2xl shadow-slate-950/45 backdrop-blur-xl`}
>
<div className="text-3xl font-black tracking-[0.22em] text-white [text-shadow:0_2px_12px_rgba(2,6,23,0.6)]">
{settlementCopy.title}
</div>
<div className="mt-3 text-sm font-semibold leading-6 text-white/82">
{settlementCopy.message}
</div>
</div>
</div>
) : null}
<div className="pointer-events-none absolute bottom-6 right-4 z-30 max-w-[13rem] space-y-2 text-right text-xs text-white/72"> <div className="pointer-events-none absolute bottom-6 right-4 z-30 max-w-[13rem] space-y-2 text-right text-xs text-white/72">
{isBusy ? <div>...</div> : null} {isBusy ? <div>...</div> : null}
{error ? <div className="text-rose-200">{error}</div> : null} {error ? <div className="text-rose-200">{error}</div> : null}