mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-15 07:43:20 +08:00
一些优化
1. 一条龙未选择要刷的秘境时,直接提示 2. 修复独立任务运行时,实时任务仍在运行的问题
This commit is contained in:
@@ -130,6 +130,10 @@ public class TaskRunner
|
||||
throw new NormalEndException("请先在启动页,启动截图器再使用本功能");
|
||||
}
|
||||
|
||||
// 清空实时任务触发器
|
||||
TaskTriggerDispatcher.Instance().ClearTriggers();
|
||||
|
||||
|
||||
// 激活原神窗口
|
||||
var maskWindow = MaskWindow.Instance();
|
||||
SystemControl.ActivateWindow();
|
||||
@@ -142,6 +146,9 @@ public class TaskRunner
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 还原实时任务触发器
|
||||
TaskTriggerDispatcher.Instance().SetTriggers(GameTaskManager.LoadInitialTriggers());
|
||||
|
||||
VisionContext.Instance().DrawContent.ClearAll();
|
||||
}
|
||||
|
||||
@@ -269,14 +269,14 @@ namespace BetterGenshinImpact.GameTask
|
||||
}
|
||||
}
|
||||
|
||||
// 帧序号自增 1分钟后归零(MaxFrameIndexSecond)
|
||||
_frameIndex = (_frameIndex + 1) % (int)(CaptureContent.MaxFrameIndexSecond * 1000d / _timer.Interval);
|
||||
|
||||
if (_triggers == null || !_triggers.Exists(t => t.IsEnabled))
|
||||
{
|
||||
Debug.WriteLine("没有可用的触发器且不处于仅截屏状态, 不再进行截屏");
|
||||
return;
|
||||
}
|
||||
|
||||
// 帧序号自增 1分钟后归零(MaxFrameIndexSecond)
|
||||
_frameIndex = (_frameIndex + 1) % (int)(CaptureContent.MaxFrameIndexSecond * 1000d / _timer.Interval);
|
||||
|
||||
var speedTimer = new SpeedTimer();
|
||||
// 捕获游戏画面
|
||||
|
||||
@@ -86,12 +86,18 @@ public partial class OneDragonTaskItem : ObservableObject
|
||||
var taskSettingsPageViewModel = App.GetService<TaskSettingsPageViewModel>();
|
||||
if (taskSettingsPageViewModel!.GetFightStrategy(out var path))
|
||||
{
|
||||
TaskControl.Logger.LogInformation("自动秘境战斗策略未配置,跳过");
|
||||
TaskControl.Logger.LogError("自动秘境战斗策略{Msg},跳过", "未配置");
|
||||
return;
|
||||
}
|
||||
|
||||
var (partyName, domainName) = config.GetDomainConfig();
|
||||
|
||||
if (string.IsNullOrEmpty(domainName))
|
||||
{
|
||||
TaskControl.Logger.LogError("一条龙配置内{Msg}需要刷的秘境,跳过","未选择");
|
||||
return;
|
||||
}
|
||||
|
||||
var autoDomainParam = new AutoDomainParam(0, path)
|
||||
{
|
||||
PartyName = partyName,
|
||||
|
||||
@@ -51,7 +51,7 @@ public class NotificationService : IHostedService, IDisposable
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_webSocketCts?.Cancel();
|
||||
// _webSocketCts?.Cancel();
|
||||
_webSocketCts?.Dispose();
|
||||
_notifyHttpClient?.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
@@ -75,11 +75,18 @@ public class BitBltCapture : IGameCapture
|
||||
Gdi32.StretchBlt(hdcDest, 0, 0, width, height, hdcSrc, x, y, width, height, Gdi32.RasterOperationMode.SRCCOPY);
|
||||
|
||||
var mat = new Mat(height, width, MatType.CV_8UC4, bits);
|
||||
Mat bgrMat = new Mat();
|
||||
Cv2.CvtColor(mat, bgrMat, ColorConversionCodes.BGRA2BGR);
|
||||
|
||||
Gdi32.SelectObject(hdcDest, oldBitmap);
|
||||
return bgrMat;
|
||||
|
||||
if (!mat.Empty())
|
||||
{
|
||||
Mat bgrMat = new Mat();
|
||||
Cv2.CvtColor(mat, bgrMat, ColorConversionCodes.BGRA2BGR);
|
||||
return bgrMat;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user