summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop/TaskRuntime.fs
diff options
context:
space:
mode:
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)