Remove unnecessary RetryException from CheckAndActivateGameWindow

Co-authored-by: huiyadanli <15783049+huiyadanli@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-21 02:53:45 +00:00
parent d30e05b365
commit c137911234

View File

@@ -156,16 +156,15 @@ public class PausableDelayManager
private void CheckAndActivateGameWindow()
{
// If RestoreFocusOnLostEnabled is disabled, we require the game window to be active
// Keep retrying until it is active
if (!TaskContext.Instance().Config.OtherConfig.RestoreFocusOnLostEnabled)
{
if (!SystemControl.IsGenshinImpactActiveByProcess())
{
Logger.LogInformation("当前获取焦点的窗口不是原神,暂停");
throw new RetryException("当前获取焦点的窗口不是原神");
}
// Just proceed to the retry loop below which will ensure window is active
}
var count = 0;
// Keep retrying until window is active
while (!SystemControl.IsGenshinImpactActiveByProcess())
{
if (count >= 10 && count % 10 == 0)