0.1.40 P2-1~P2-3: 天下大事记叙事层 + WorldPanel展示区 + LegacyPanel引用 (saga.ts + buildSaga + 8类标签色系)
This commit is contained in:
@@ -5,6 +5,8 @@ import { ResolveModal } from '../components/ResolveModal'
|
||||
import { buildBiography } from '../../game/engine/narrative/biography'
|
||||
import { yearAxis, decadeLabel } from '../../game/engine/narrative/yearaxis'
|
||||
import { buildReport, verdictLine } from '../../game/engine/narrative/legacyreport'
|
||||
import { buildSaga, sagaKindName, sagaKindClass } from '../../game/engine/narrative/saga'
|
||||
import type { WorldSimState } from '../../game/engine/sim/worldsim-data'
|
||||
|
||||
|
||||
export default function LegacyPanel() {
|
||||
@@ -155,6 +157,25 @@ function LegacyReportView() {
|
||||
<div className="dim" style={{ marginTop: 10 }}>死因榜:{Object.entries(r.deathCauses).filter(([k]) => k !== '').sort((a, b) => b[1] - a[1]).slice(0, 4).map(([k, v]) => `${k}×${v}`).join(' · ') || '尚无记录'}</div>
|
||||
<div className="dim" style={{ marginTop: 6 }}>突破之劲:{r.breakthroughs.slice(-6).map((b) => `${b.year}年×${b.count}`).join(' · ')}</div>
|
||||
<div className="resolve-poem" style={{ marginTop: 14 }}>{verdictLine(r)}</div>
|
||||
{/* 0.1.40 天下大事记摘要 */}
|
||||
{(() => {
|
||||
const ws = world.state.worldSim as WorldSimState | undefined
|
||||
if (!ws) return null
|
||||
const saga = buildSaga(ws).slice(0, 12)
|
||||
if (saga.length === 0) return null
|
||||
return (
|
||||
<div style={{ marginTop: 14 }}>
|
||||
<div className="dim" style={{ marginBottom: 4 }}>天下大事记摘要:</div>
|
||||
{saga.map((e, i) => (
|
||||
<div key={i} className="ch-item" style={{ padding: '4px 8px', fontSize: '0.84rem' }}>
|
||||
<span className="ch-month">{e.year}年</span>
|
||||
<span className={`tag ${sagaKindClass(e.kind)}`} style={{ marginRight: 6, fontSize: '0.72rem' }}>{sagaKindName(e.kind)}</span>
|
||||
<span className="dim">{e.text}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
})()}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user