{"record":{"id":"86e530b73b1ea69b","repo":"babalae/better-genshin-impact","slug":"error-86e530","errorCode":null,"errorMessage":"切换角色：点击队伍槽位后未打开角色列表","messagePattern":"切换角色：点击队伍槽位后未打开角色列表","errorType":"exception","errorClass":"PartySetupFailedException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/Common/Job/SwitchCharacterStateMachineTask.cs","lineNumber":1372,"sourceCode":"\n        throw new PartySetupFailedException(\n            $\"切换角色：点击逻辑槽位 {logicalSlot} 的换下按钮后，未在 {RemoveConfirmationTimeoutMilliseconds / 1000} 秒内确认操作生效\");\n    }\n\n    private async Task<List<TeamSlotSnapshot>> RecognizeTeamSlotsFromCharacterList(\n        AvatarGridIconRecognizer recognizer,\n        int expectedTeamCount,\n        CancellationToken ct)\n    {\n        ClickFixedTeamSlot(1);\n        var listOpened = await NewRetry.WaitForAction(() =>\n        {\n            using var capture = CaptureToRectArea();\n            return IsCharacterList(capture);\n        }, ct, 10, 300);\n        if (!listOpened)\n        {\n            throw new PartySetupFailedException(\"切换角色：点击队伍槽位后未打开角色列表\");\n        }\n\n        List<string?> characterNames = [];\n        var lastDetectedCardCount = 0;\n        try\n        {\n            var gridRoi = Rect1080(\n                CharacterGridRoi1080.X,\n                CharacterGridRoi1080.Y,\n                CharacterGridRoi1080.Width,\n                CharacterGridRoi1080.Height);\n            for (var attempt = 1; attempt <= EmptyCardDetectionRetryCount; attempt++)\n            {\n                using var capture = CaptureToRectArea(true);\n                using var gridRegion = capture.DeriveCrop(gridRoi);\n                var cards = DetectCharacterCards(\n                    gridRegion.SrcMat, out var rejectedCount, out var connectedComponentCount);\n                lastDetectedCardCount = cards.Count;","sourceCodeStart":1354,"sourceCodeEnd":1390,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/Common/Job/SwitchCharacterStateMachineTask.cs#L1354-L1390","documentation":"RecognizeTeamSlotsFromCharacterList clicks slot 1 (ClickFixedTeamSlot(1)) then waits up to 10x300ms for IsCharacterList (OCR of '元素共鸣' at the top-right) to confirm the character list opened. If the list never appears the team-snapshot step cannot run.","triggerScenarios":"NewRetry.WaitForAction(() => IsCharacterList(capture)) returns false after 10 attempts — the '元素共鸣' text was never detected following the slot click.","commonSituations":"The slot-1 click missed its target (coordinate/scale drift) so the list never opened; the list opened but the '元素共鸣' ROI/text changed in a game update; a modal blocked the click; capture was stale; the game was mid-transition.","solutions":["Verify ClickFixedTeamSlot's x-coordinate (xs[0]=470 at y=550) lands on slot 1 at the current resolution/scale.","Update the IsCharacterList detector ROI/text ('元素共鸣' at Rect1080(1655,32,106,30)) for the current game version.","Increase the 10-attempt / 300ms-interval budget if list opening is slow on the target machine.","Ensure no overlay is intercepting the click."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await switchTask.Start(...); }\ncatch (PartySetupFailedException ex) when (ex.Message.Contains(\"未打开角色列表\"))\n{ _logger.LogWarning(ex, \"点击队伍槽位后角色列表未打开，建议重试\"); }","preventionTips":["Verify ClickFixedTeamSlot coordinates match the current layout/scale.","Keep the IsCharacterList ('元素共鸣') detector ROI/text current.","Budget enough attempts for slow-opening lists."],"tags":["party-setup","ui-automation","ocr","timeout","switch-character"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}