fix 修复关闭自动钓鱼后意外输出的日志

关闭自动钓鱼后停止输出相关日志
This commit is contained in:
秋月
2024-03-04 00:31:13 +08:00
committed by GitHub
parent fd79acaee6
commit 6f8cfbee4f

View File

@@ -757,7 +757,7 @@ namespace BetterGenshinImpact.GameTask.AutoFishing
{
Retry.Do(() =>
{
if (!SystemControl.IsGenshinImpactActiveByProcess())
if (IsEnabled && !SystemControl.IsGenshinImpactActiveByProcess())
{
_logger.LogWarning("当前获取焦点的窗口不是原神,暂停");
throw new RetryException("当前获取焦点的窗口不是原神");
@@ -1069,7 +1069,7 @@ namespace BetterGenshinImpact.GameTask.AutoFishing
{
var prevIsExclusive = IsExclusive;
IsExclusive = FindButtonForExclusive(content);
if (!prevIsExclusive && IsExclusive)
if (IsEnabled && !prevIsExclusive && IsExclusive)
{
_logger.LogInformation("→ {Text}", "自动钓鱼,启动!");
var autoThrowRodEnabled = TaskContext.Instance().Config.AutoFishingConfig.AutoThrowRodEnabled;
@@ -1127,4 +1127,4 @@ namespace BetterGenshinImpact.GameTask.AutoFishing
// ClearDraw();
//}
}
}
}