mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-25 10:05:49 +08:00
SysParams
This commit is contained in:
@@ -66,7 +66,8 @@ public class KeyMouseRecorderJsonLine
|
||||
Height = rect.Height,
|
||||
RecordDpi = TaskContext.Instance().DpiScale,
|
||||
StartTime = $"{startTime:yyyy-MM-dd HH:mm:ss:ffff}",
|
||||
StartTimeUnixTimestamp = (startTime - new DateTime(1970, 1, 1)).TotalNanoseconds.ToString("F0")
|
||||
StartTimeUnixTimestamp = (startTime - new DateTime(1970, 1, 1)).TotalNanoseconds.ToString("F0"),
|
||||
SysParams = RecordContext.Instance.SysParams
|
||||
};
|
||||
var infoJson = JsonSerializer.Serialize(Info, JsonOptions);
|
||||
File.WriteAllText(Path.Combine(path, $"{folderName}.json"), infoJson);
|
||||
|
||||
@@ -28,4 +28,6 @@ public class KeyMouseScriptInfo
|
||||
public string StartTime { get; set; } = string.Empty;
|
||||
|
||||
public string StartTimeUnixTimestamp { get; set; } = string.Empty;
|
||||
|
||||
public SysParams? SysParams { get; set; }
|
||||
}
|
||||
|
||||
10
BetterGenshinImpact/Core/Recorder/Model/RecordContext.cs
Normal file
10
BetterGenshinImpact/Core/Recorder/Model/RecordContext.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using BetterGenshinImpact.Model;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Recorder.Model;
|
||||
|
||||
public class RecordContext : Singleton<RecordContext>
|
||||
{
|
||||
|
||||
public SysParams SysParams { get; set; } = new();
|
||||
|
||||
}
|
||||
24
BetterGenshinImpact/Core/Recorder/Model/SysParams.cs
Normal file
24
BetterGenshinImpact/Core/Recorder/Model/SysParams.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using BetterGenshinImpact.Helpers;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Recorder.Model;
|
||||
|
||||
public class SysParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 提高指针精确度 是否启用
|
||||
/// </summary>
|
||||
public bool EnhancePointerPrecision { get; set; }
|
||||
|
||||
public SysParams()
|
||||
{
|
||||
var (mouseThreshold1, mouseThreshold2, mouseThreshold3) = EnvironmentUtil.GetMouse();
|
||||
if (mouseThreshold3 > 0)
|
||||
{
|
||||
EnhancePointerPrecision = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
EnhancePointerPrecision = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using BetterGenshinImpact.Core.Recorder.Model;
|
||||
using BetterGenshinImpact.Helpers;
|
||||
using Wpf.Ui;
|
||||
using Wpf.Ui.Controls;
|
||||
@@ -90,6 +91,8 @@ public partial class KeyMouseRecordPageViewModel : ObservableObject, INavigation
|
||||
[RelayCommand]
|
||||
public async Task OnStartRecord()
|
||||
{
|
||||
var s = RecordContext.Instance.SysParams; // 提前实例化,避免延迟
|
||||
Debug.WriteLine(s.EnhancePointerPrecision);
|
||||
if (!TaskContext.Instance().IsInitialized)
|
||||
{
|
||||
Toast.Warning("请先在启动页,启动截图器再使用本功能");
|
||||
|
||||
Reference in New Issue
Block a user