This commit is contained in:
辉鸭蛋
2024-12-29 18:30:48 +08:00
parent 9c93cb465d
commit 351a3cb270
6 changed files with 12 additions and 12 deletions

View File

@@ -41,9 +41,9 @@ public partial class CommonConfig : ObservableObject
// 关闭时还原分辨率
[ObservableProperty]
private bool _restoreResolutionOnExit;
private bool _restoreResolutionOnExit = false;
// 录制工具 ffmpeg/obs
[ObservableProperty]
private string _recorder = "ffmpeg";
private string _recorder = "obs";
}

View File

@@ -46,7 +46,7 @@ public class KeyMouseRecorderJsonLine
{
var path = Global.Absolute($@"User\KeyMouseScript\{folderName}\");
DateTime startTime = DateTime.UtcNow;
DateTime startTime = DateTime.Now;
// var bootTime = EnvironmentUtil.LastBootUpTime();
// if (bootTime == null)
// {
@@ -66,7 +66,7 @@ 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.ToUniversalTime() - new DateTime(1970, 1, 1)).TotalNanoseconds.ToString("F0"),
SysParams = RecordContext.Instance.SysParams
};
var infoJson = JsonSerializer.Serialize(Info, JsonOptions);

View File

@@ -66,7 +66,7 @@ public class FfmpegRecorder : IVideoRecorder
{
_startTime = match.Groups[1].Value.Replace(".", "");
TaskControl.Logger.LogInformation("ffmpeg录制: 视频起始时间戳 {Text}", _startTime);
File.WriteAllText(Path.Combine(folderPath, $"videoStartTime.txt"), _startTime);
File.WriteAllText(Path.Combine(folderPath, $"videoStartTime.txt"), _startTime + "000");
}
}
}

View File

@@ -95,7 +95,7 @@ public class ObsRecorder : IVideoRecorder
try
{
obs.StartRecord();
_lastRecordTime = DateTime.UtcNow;
_lastRecordTime = DateTime.Now;
TaskControl.Logger.LogInformation("OBS: 开始录制,时间: {Time}", _lastRecordTime.ToString("yyyy-MM-dd HH:mm:ss:ffff"));
return true;
}
@@ -179,7 +179,7 @@ public class ObsRecorder : IVideoRecorder
TaskControl.Logger.LogError("OBS: 未找到录制结果文件");
}
File.WriteAllText(Path.Combine(folderPath, "videoStartTime.txt"), (_lastRecordTime - new DateTime(1970, 1, 1)).TotalNanoseconds.ToString("F0"));
File.WriteAllText(Path.Combine(folderPath, "videoStartTime.txt"), (_lastRecordTime.ToUniversalTime() - new DateTime(1970, 1, 1)).TotalNanoseconds.ToString("F0"));
}
catch (Exception e)
{

View File

@@ -7,6 +7,7 @@ using System.Threading.Tasks;
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.GameTask.Common;
using BetterGenshinImpact.Helpers;
using BetterGenshinImpact.Helpers.Device;
using BetterGenshinImpact.Model;
using BetterGenshinImpact.ViewModel.Pages;
@@ -28,9 +29,8 @@ public class StartEndSingleton: Singleton<StartEndSingleton>
TouchpadSoft.Instance.CheckAndRecordStatus();
TouchpadSoft.Instance.DisableTouchpadWhenEnabledByHotKey();
if (TaskContext.Instance().Config.CommonConfig.ChangeResolutionOnStart)
if (TaskContext.Instance().Config.CommonConfig.ChangeResolutionOnStart && !RuntimeHelper.IsDebug)
{
// 设置DPI
SysDpi.Instance.SetDpi();
@@ -63,7 +63,7 @@ public class StartEndSingleton: Singleton<StartEndSingleton>
{
TouchpadSoft.Instance.RestoreTouchpadByHotKey();
if (TaskContext.Instance().Config.CommonConfig.RestoreResolutionOnExit)
if (TaskContext.Instance().Config.CommonConfig.RestoreResolutionOnExit && !RuntimeHelper.IsDebug)
{
ResetResolution();
Thread.Sleep(2000);

View File

@@ -102,7 +102,7 @@ public partial class KeyMouseRecordPageViewModel : ObservableObject, INavigation
return;
}
if (TaskContext.Instance().Config.CommonConfig.ProcessCheckEnabled)
if (TaskContext.Instance().Config.CommonConfig.ProcessCheckEnabled && !RuntimeHelper.IsDebug)
{
try
{