diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/LivingVillage.Desktop/Game.fs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop/Game.fs b/src/LivingVillage.Desktop/Game.fs index c796953..cb28e58 100644 --- a/src/LivingVillage.Desktop/Game.fs +++ b/src/LivingVillage.Desktop/Game.fs @@ -276,6 +276,18 @@ type LivingVillageGame() as this = let mutable storyShotPrepared = false let mutable storyShotFrame = 0L let mutable storyShotSaved = false + // P37 证据钩子:LV_P37_SHOT=1 时从主菜单进入职业选择页截图,选定职业开局后打开任务面板 + // 截 HUD/任务列表,然后退出。LV_P37_OCCUPATION=farmer|fisher|peddler|scholar(默认渔夫)。 + let p37ShotMode = Environment.GetEnvironmentVariable("LV_P37_SHOT") = "1" + let p37Occupation = + match Environment.GetEnvironmentVariable("LV_P37_OCCUPATION") with + | "farmer" -> Occupation.Farmer + | "peddler" -> Occupation.Peddler + | "scholar" -> Occupation.Scholar + | _ -> Occupation.Fisher + let mutable p37Step = 0 + let mutable p37Hold = 0 + let mutable p37Captured = false let mutable autoplayFrames = 0 let mutable flowStep = 0 let mutable flowHold = 0 @@ -570,6 +582,42 @@ type LivingVillageGame() as this = if menuShotFrame = MenuShotScript.downFrame then this.DispatchMenuInput Down + /// P37 证据:主菜单 →「选择职业」页截图 → 选定职业开局 → 打开任务面板截 HUD/任务列表 → 退出。 + member private this.RunP37Shot () = + let save (name: string) = + System.IO.Directory.CreateDirectory recordDirectory |> ignore + this.SaveBackBuffer(sprintf "%s/%s.png" recordDirectory name) + printfn "p37-shot=%s tick=%d page=%A selected=%d task=%s" + name + world.Tick + menu.Page + menu.Selected + (M5Interaction.panelLines world m5View |> List.tryHead |> Option.defaultValue "<none>") + let targetIndex = + MenuState.occupationOptions |> List.findIndex (fun option -> option = Some p37Occupation) + match p37Step with + | 0 when menu.Page = MainMenu -> + this.DispatchMenuInput Confirm + p37Step <- 1 + | 1 when menu.Page = OccupationSelect -> + if menu.Selected <> targetIndex then + this.DispatchMenuInput Down + else + save "p37-occupation-select" + this.DispatchMenuInput Confirm + p37Step <- 2 + | 2 when menu.Page = Playing -> + p37Hold <- p37Hold + 1 + if p37Hold = 1 then + let _, taskView = M5Interaction.apply ShowTaskPanel world m5View + m5View <- taskView + elif p37Hold >= 90 then + if not p37Captured then + p37Captured <- true + save (sprintf "p37-%s-start" (Occupation.saveToken p37Occupation)) + this.Exit() + | _ -> () + /// P20 第三步取证:真走位巡游(Sim.step 驱动)沿桥/路/民居门移动,用于桥面行走帧与昼夜录制。 member private this.RunRiverscapeTour () = if not riverscapeTourWatchStarted then @@ -868,6 +916,8 @@ type LivingVillageGame() as this = this.RunStoryShotSetup() elif autoplayFlow then this.RunAutoplayFlow() + elif p37ShotMode then + this.RunP37Shot() elif menu.Page = Playing then this.UpdatePlaying gameTime kb pressed pressedAny elif menuShotMode then |
