summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop/TaskRuntime.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-29 08:56:42 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-29 08:56:42 +0800
commita578791b0dd8ca95fba3af6f3c2f39c816bd7e52 (patch)
treeaf71c5a7d69087a59f5f5116134c602f65960ae0 /src/LivingVillage.Desktop/TaskRuntime.fs
parent8cfdb2aa8b19595f5fa7870c4ad3e6c4c20c421e (diff)
downloadliving-village-a578791b0dd8ca95fba3af6f3c2f39c816bd7e52.tar.gz
p67: 每日任务面板展示目标(TargetNpc/TargetTile 可见化)
- TaskRuntime.targetText/taskLine:帮工→「村民 N」、翻土→「自家地块」, 无目标时与旧任务行文案逐字节一致(不加箭头/目标名) - Interaction TaskPanel 任务行改用 taskLine(其余面板/文案不动) - 字形表新增 地 块 →(343 字,图集重生成);ChineseText.requiredUiLabels 增补 - P67TaskTargetUiTests(5 例,红先)+ PrototypeTests 计数同步 340→343 - LV_P67_SHOT 证据钩子(有目标/无目标各一帧)+ scripts/analyze-p67.py - Desktop 333/333、Kernel 119/119;digest 953775FA…7F6C ×3 PASS;未动 Kernel/Sim
Diffstat (limited to 'src/LivingVillage.Desktop/TaskRuntime.fs')
-rw-r--r--src/LivingVillage.Desktop/TaskRuntime.fs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop/TaskRuntime.fs b/src/LivingVillage.Desktop/TaskRuntime.fs
index efc57f3..ce9bfbc 100644
--- a/src/LivingVillage.Desktop/TaskRuntime.fs
+++ b/src/LivingVillage.Desktop/TaskRuntime.fs
@@ -16,6 +16,20 @@ module TaskRuntime =
| Some(item, quantity) -> sprintf "%s +%s×%d" headline (Occupation.itemNameOf item) quantity
| None -> headline
+ // ---- P67 任务目标 UI(design §2.4-3 收口后的可见化)----
+ /// 带目标时的中文目标名:帮工 → 指定村民;翻土 → 自家地块。其余模板/无目标 → None。
+ let targetText (task: Occupation.DailyTask) : string option =
+ match task.TemplateId, task.TargetNpc, task.TargetTile with
+ | Occupation.HelpWork, Some(Sim.NpcId id), _ -> Some(sprintf "村民 %d" id)
+ | Occupation.TillSoil, _, Some _ -> Some "自家地块"
+ | _ -> None
+
+ /// 任务标题行:有目标时「模板:状态 → 目标」;无目标时与既有文案逐字节一致。
+ let taskLine (task: Occupation.DailyTask) (stateText: string) : string =
+ match targetText task with
+ | Some target -> sprintf "%s:%s → %s" (Occupation.taskNameOf task.TemplateId) stateText target
+ | None -> sprintf "%s:%s" (Occupation.taskNameOf task.TemplateId) stateText
+
let private completionMessage
(before: Occupation.DailyTask option)
(after: Occupation.DailyTask option)