babalae/better-genshin-impact · error · PartySetupFailedException
未能打开队伍选择页面
Error message
未能打开队伍选择页面
What it means
Once on the party-view UI, SwitchPartyTask.Start clicks the party-choose button (partyViewBtn) and waits via NewRetry.WaitForElementAppear for the 'PartyBtnDelete' element to appear (4 retries x 500ms). If the party-selection menu does not open, it throws PartySetupFailedException.
Source
Thrown at BetterGenshinImpact/GameTask/Common/Job/SwitchPartyTask.cs:134
{
Simulation.SendInput.Keyboard.KeyPress(User32.VK.VK_ESCAPE);
await Delay(500, ct);
await _returnMainUiTask.Start(ct);
}
return true;
}
var menu = await NewRetry.WaitForElementAppear(
ElementRecognition.Get("PartyBtnDelete"),
() => partyViewBtn.Click(),// 点击队伍选择按钮
ct,
4,
500
);
if (!menu)
{
throw new PartySetupFailedException("未能打开队伍选择页面");
}
ImageRegion? switchRa = null;
Region? partyDeleteBtn = null;
using (var ocrRa = CaptureToRectArea())
{
var openPartyChooseSuccess = await NewRetry.WaitForAction(() =>
{
switchRa = ocrRa;
partyDeleteBtn = switchRa.Find(ElementRecognition.Get("PartyBtnDelete", switchRa));
return partyDeleteBtn.IsExist();
}, ct, 5);
if (!openPartyChooseSuccess || switchRa == null || partyDeleteBtn == null)
{
throw new PartySetupFailedException("未能打开队伍配置界面");
}
}View on GitHub (pinned to a7cb36712d)
Solutions
- Confirm ElementRecognition.Get('PartyBtnDelete') template matches the current party-selection menu and capture scale.
- Verify partyViewBtn was found at the correct location and the click coordinates are valid.
- Increase the 4x500ms retry budget if the menu opens slowly.
- Ensure the game window has input focus and no overlay intercepts the click.
Defensive patterns
Strategy: try-catch
Try / catch
try { await partyTask.Start(partyName, ct); }
catch (PartySetupFailedException ex) when (ex.Message == "未能打开队伍选择页面")
{ _logger.LogError(ex, "队伍选择页面未打开:检查 PartyBtnChooseView 点击坐标与 PartyBtnDelete 模板"); } Prevention
- Keep the PartyBtnChooseView / PartyBtnDelete templates current.
- Verify partyViewBtn click coordinates against the current layout/scale.
- Ensure input focus and no overlay intercepts the click.
When it happens
Trigger: The current team is not already the target, so it calls NewRetry.WaitForElementAppear(ElementRecognition.Get('PartyBtnDelete'), () => partyViewBtn.Click(), ct, 4, 500); the element never appears so WaitForElementAppear returns false.
Common situations: partyViewBtn.Click() missed (element moved/scale drift); the party-selection menu failed to open due to game state; ElementRecognition template 'PartyBtnDelete' no longer matches the current UI; the click was swallowed (input focus); a slow menu exceeded the 4x500ms budget.
Related errors
- 未能打开队伍配置界面
- 切换角色:等待单机图标、联机状态及 top_left 玩家标记超时({timeoutMilliseconds / 100
- 切换角色:点击逻辑槽位 {logicalSlot} 的换下按钮后,未在 {RemoveConfirmationTimeo
- 切换角色:点击队伍槽位后未打开角色列表
- 切换角色:角色列表关闭后未返回队伍配置页
AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13).
Data as JSON: /api/errors/da88ddb5ec5fea3e.
Report an issue: GitHub.