feat: 实现避难所仓储系统与生存状态HUD改进
- 新增避难所仓储功能,支持物品在随身背包与仓储间转移 - 添加生存状态图标资源与状态阈值告警系统 - 重构HUD界面,优化状态显示与操作流程 - 扩展游戏核心系统,增加仓储相关动作和校验 - 更新文档说明仓储规则与实现细节
This commit is contained in:
@@ -1,22 +1,27 @@
|
||||
import type { OverlayPanel } from '../types';
|
||||
import type { GameView } from '@tinywaste/game-core';
|
||||
import { getActiveQuestCount, getSupplyCounts } from '../hudModel';
|
||||
import type { GameAction, GameView } from '@tinywaste/game-core';
|
||||
import { getActiveQuestCount, getCurrentPlace, getDominantAlert, getSupplyCounts } from '../hudModel';
|
||||
|
||||
export function BottomDock({
|
||||
activePanel,
|
||||
onOpenPanel,
|
||||
onSendAction,
|
||||
view,
|
||||
}: {
|
||||
activePanel: OverlayPanel | null;
|
||||
onOpenPanel: (panel: OverlayPanel) => void;
|
||||
onSendAction: (action: GameAction) => void;
|
||||
view: GameView;
|
||||
}) {
|
||||
const supplyCounts = getSupplyCounts(view);
|
||||
const activeQuestCount = getActiveQuestCount(view);
|
||||
const currentPlace = getCurrentPlace(view);
|
||||
const homeRoute = view.map.edges.find((edge) => edge.to === 'home');
|
||||
const dominantAlert = getDominantAlert(view);
|
||||
|
||||
return (
|
||||
<footer className="command-dock">
|
||||
<div className="operator-card">
|
||||
<footer className="command-dock tactical-dock">
|
||||
<div className="operator-card tactical-operator">
|
||||
<div className="operator-emblem">{view.player.name.slice(0, 1)}</div>
|
||||
<div className="operator-copy">
|
||||
<span>ACTIVE SURVIVOR</span>
|
||||
@@ -26,7 +31,7 @@ export function BottomDock({
|
||||
|
||||
<div className="dock-nav-groups">
|
||||
<div className="dock-tabs">
|
||||
<button className="dock-tab active">Shelter</button>
|
||||
<button className="dock-tab active">{currentPlace?.name ?? 'Expedition'}</button>
|
||||
<button
|
||||
className={`dock-tab ${activePanel === 'blueprints' ? 'active' : ''}`}
|
||||
onClick={() => onOpenPanel('blueprints')}
|
||||
@@ -54,13 +59,28 @@ export function BottomDock({
|
||||
</div>
|
||||
|
||||
<div className="dock-metrics">
|
||||
<span>{dominantAlert ? dominantAlert.label : '状态稳定'}</span>
|
||||
<span>水 {supplyCounts.water}</span>
|
||||
<span>食物 {supplyCounts.food}</span>
|
||||
<span>药品 {supplyCounts.medicine}</span>
|
||||
<span>材料 {supplyCounts.material}</span>
|
||||
<span>任务 {activeQuestCount}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="dock-commit">
|
||||
{homeRoute ? (
|
||||
<button
|
||||
className="primary-button dock-commit-button"
|
||||
onClick={() => onSendAction({ type: 'travel', toPlaceId: homeRoute.to })}
|
||||
>
|
||||
返回避难点
|
||||
</button>
|
||||
) : (
|
||||
<button className="primary-button dock-commit-button" onClick={() => onOpenPanel('inventory')}>
|
||||
打开补给终端
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user