{"record":{"id":"0bab65b147ced63a","repo":"babalae/better-genshin-impact","slug":"error-0bab65","errorCode":null,"errorMessage":"未能打开队伍配置界面","messagePattern":"未能打开队伍配置界面","errorType":"exception","errorClass":"PartySetupFailedException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/Common/Job/SwitchPartyTask.cs","lineNumber":79,"sourceCode":"                {\n                    await Delay(600, ct);\n                    using var raCheck = CaptureToRectArea();\n                    if (Bv.IsInPartyViewUi(raCheck))\n                    {\n                        isOpened = true;\n                        break;\n                    }\n                }\n\n                if (isOpened)\n                {\n                    break; // 页面已打开，跳出循环\n                }\n            }\n\n            if (!isOpened)\n            {\n                throw new PartySetupFailedException(\"未能打开队伍配置界面\");\n            }\n        }\n\n        await Delay(500, ct);\n\n        using var ra = CaptureToRectArea();\n        var partyViewBtn = ra.Find(ElementRecognition.Get(\"PartyBtnChooseView\", ra));\n\n        // OCR 当前队伍名称（无法单字，中间禁止空格）\n        var currTeamName = ra.Find(new RecognitionObject\n        {\n            RecognitionType = RecognitionTypes.Ocr,\n            RegionOfInterest = new Rect(partyViewBtn.Right, partyViewBtn.Top, (int)(350 * _assetScale),\n                partyViewBtn.Height)\n        }).Text;\n        \n        var tempName = currTeamName\n            .Replace(\"\\\"\", \"\")        // 移除所有双引号（核心新增，解决日志里的\"\"问题）","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/Common/Job/SwitchPartyTask.cs#L61-L97","documentation":"SwitchPartyTask.Start attempts to open the party-setup screen by sending the OpenPartySetupScreen hotkey up to 2 times, each followed by 7x600ms checks for Bv.IsInPartyViewUi. If neither attempt detects the party-view UI, it throws PartySetupFailedException because it cannot proceed to party selection.","triggerScenarios":"After confirming main UI, the loop sends SimulateAction(GIActions.OpenPartySetupScreen) twice; all 7 detection checks per attempt return Bv.IsInPartyViewUi==false, so isOpened stays false.","commonSituations":"The OpenPartySetupScreen hotkey binding changed or is not registered in the current game version; the game ignored input (focus lost, input blocked); Bv.IsInPartyViewUi detector markers changed; a slow load exceeded the ~4.2s per-attempt budget; the party screen was disabled in the current game state (e.g. in combat/domain).","solutions":["Ensure the game is on the main UI and out of combat/domains where party setup is blocked.","Verify GIActions.OpenPartySetupScreen maps to the correct current hotkey and that input focus is on the game window.","Update the Bv.IsInPartyViewUi detector for the current game version.","Increase maxAttempts or the 7x600ms check budget if the screen loads slowly."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await partyTask.Start(partyName, ct); }\ncatch (PartySetupFailedException ex) when (ex.Message == \"未能打开队伍配置界面\")\n{ _logger.LogError(ex, \"打开队伍配置界面失败：检查快捷键绑定与游戏焦点\"); }","preventionTips":["Ensure the game window has input focus and the OpenPartySetupScreen hotkey is valid.","Do not call from combat/domain states where party setup is blocked.","Keep Bv.IsInPartyViewUi detectors current; raise the attempt/budget if loading is slow."],"tags":["party-setup","ui-automation","input-simulation","timeout","switch-party"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}