feat: companion 狀態列與 info 輸出對齊設計稿
- 狀態列的 PAD 條改為最強的兩種情緒(不含精力) - info 短版只列名字、關係、前 3 強情緒、適應度與待辦 - info --all 補上 12 格情緒與關係長條、人格 18 參數三層值、世界與時間感,基本資訊移到這裡 - 版本號改為 0.0.4 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
b99bf4e539
commit
13d3678032
@@ -1,10 +1,12 @@
|
||||
import { DIM_INFO, ranked } from './emotion'
|
||||
import { bar, lineWidth } from './seg'
|
||||
import type { Seg } from './seg'
|
||||
import type { View } from './core'
|
||||
|
||||
const axis = (v: number) => bar(((v + 1) / 2) * 100, 3)
|
||||
// 精力隨作息起伏,不列入主要情緒;取最強的兩種
|
||||
const top2 = (v: View) => ranked(v.emotions).filter(d => d !== 'energy').slice(0, 2)
|
||||
|
||||
// 由完整版往下捨棄次要資訊:氣泡 → 待辦 → PAD 條 → 好感階段;緊湊版只留「顏文字 名字 心情」
|
||||
// 由完整版往下捨棄次要資訊:氣泡 → 待辦 → 情緒條 → 好感階段;緊湊版只留「顏文字 名字 心情」
|
||||
function line(v: View, level: number, compact: boolean, bubble?: string): Seg[] {
|
||||
const out: Seg[] = [
|
||||
{ text: `${v.kaomoji} `, color: 'claude' },
|
||||
@@ -14,7 +16,7 @@ function line(v: View, level: number, compact: boolean, bubble?: string): Seg[]
|
||||
]
|
||||
if (compact) return out
|
||||
const dot = { text: ' · ', dim: true }
|
||||
if (level < 3) out.push(dot, { text: `P${axis(v.mood.p)} A${axis(v.mood.a)} D${axis(v.mood.d)}`, dim: true })
|
||||
if (level < 3) out.push(dot, { text: top2(v).map(d => `${DIM_INFO[d].name}${bar(v.emotions[d] * 100, 4)}`).join(' '), dim: true })
|
||||
if (level < 4) out.push(dot, { text: v.stage })
|
||||
if (level < 2 && v.todos > 0) out.push(dot, { text: `☐${v.todos}`, color: 'warning' })
|
||||
if (level < 1 && bubble) out.push(dot, { text: `💬 ${bubble}`, dim: true })
|
||||
|
||||
Reference in New Issue
Block a user