perf: 追加时间间隔

This commit is contained in:
status102
2023-09-22 15:42:45 +08:00
parent 6e7650ea73
commit 89aaf14cd6
6 changed files with 9 additions and 7 deletions

View File

@@ -620,13 +620,15 @@ namespace MaaWpfGui.Main
{
bool isSanityForecastSucc = true;
DateTimeOffset? reportTime = null;
TimeSpan timeDiff = TimeSpan.Zero;
if (isSanityForecastSucc &= sanity_report.Count == 2 && ((string)sanity_report[0]).Contains("/"))
{
int[] sanity = ((string)sanity_report[0]).Split('/').Select(i => Convert.ToInt32(i)).ToArray();
reportTime = DateTimeOffset.Parse((string)sanity_report[1]);
if (isSanityForecastSucc &= sanity.Length == 2 && sanity[1] > 1)
{
reportTime = reportTime?.AddMinutes(sanity[0] < sanity[1] ? (sanity[1] - sanity[0]) * 6 : 0);
timeDiff = new TimeSpan(0, sanity[0] < sanity[1] ? (sanity[1] - sanity[0]) * 6 : 0, 0);
reportTime = reportTime?.AddMinutes(timeDiff.TotalMinutes);
}
}
@@ -641,7 +643,7 @@ namespace MaaWpfGui.Main
.Replace("{Preset}", configurationPreset);
if (isSanityForecastSucc)
{
sanityReport = sanityReport.Replace("{DateTime}", reportTime?.ToString("T"));
sanityReport = sanityReport.Replace("{DateTime}", reportTime?.ToString("T")).Replace("{TimeDiff}", timeDiff.ToString(@"hh\:mm"));
Instances.TaskQueueViewModel.AddLog(LocalizationHelper.GetString("AllTasksComplete") + Environment.NewLine + sanityReport);
ExternalNotificationService.Send(allTaskCompleteTitle, allTaskCompleteMessage + Environment.NewLine + sanityReport);

View File

@@ -541,7 +541,7 @@ The video aspect ratio needs to be 16:9 without interference factors such as bla
<system:String x:Key="StartCombat" xml:space="preserve">Start combat: </system:String>
<system:String x:Key="CompleteCombat">Complete combat</system:String>
<system:String x:Key="AllTasksComplete">All task(s) completed!</system:String>
<system:String x:Key="SanityReport">Sanity will be full on {DateTime}.</system:String>
<system:String x:Key="SanityReport">Sanity will be full on {DateTime} ({TimeDiff} later).</system:String>
<system:String x:Key="AllTaskCompleteContent">MAA has completed all tasks under the {Preset} configuration in {DateTime}.</system:String>
<system:String x:Key="BackgroundLinkStarted">Tasks started</system:String>
<system:String x:Key="BackgroundLinkStopped">Tasks stopped</system:String>

View File

@@ -541,7 +541,7 @@ Bilibili: ログイン インターフェイスに表示されるアカウント
<system:String x:Key="StartCombat" xml:space="preserve">戦闘開始: </system:String>
<system:String x:Key="CompleteCombat">戦闘完了</system:String>
<system:String x:Key="AllTasksComplete">すべてのタスクが完了しました!</system:String>
<system:String x:Key="SanityReport">理性は {DateTime} に満杯になります。</system:String>
<system:String x:Key="SanityReport">理性は {DateTime} に満杯になります ({TimeDiff} 後)。</system:String>
<system:String x:Key="AllTaskCompleteContent">MAA は、{DateTime} の {Preset} 構成の下にあるすべてのプリセット タスクを完了しました。</system:String>
<system:String x:Key="BackgroundLinkStarted">Tasks started</system:String>
<system:String x:Key="BackgroundLinkStopped">Tasks stopped</system:String>

View File

@@ -541,7 +541,7 @@ Bilibili: 로그인 인터페이스에 표시되는 계정 이름(예: Zhang San
<system:String x:Key="StartCombat" xml:space="preserve">작전 시작: </system:String>
<system:String x:Key="CompleteCombat">작전 완료</system:String>
<system:String x:Key="AllTasksComplete">모든 작업이 완료되었습니다!</system:String>
<system:String x:Key="SanityReport">{DateTime}에 정신력이 가득 차게 됩니다.</system:String>
<system:String x:Key="SanityReport">{DateTime}({TimeDiff} 이후)에 정신 상태가 가득 차게 됩니다.</system:String>
<system:String x:Key="AllTaskCompleteContent">MAA는 {DateTime}의 {Preset} 구성에서 모든 사전 설정 작업을 완료했습니다.</system:String>
<system:String x:Key="BackgroundLinkStarted">작업 시작됨</system:String>
<system:String x:Key="BackgroundLinkStopped">작업 중지됨</system:String>

View File

@@ -541,7 +541,7 @@
<system:String x:Key="StartCombat" xml:space="preserve">开始战斗: </system:String>
<system:String x:Key="CompleteCombat">完成战斗</system:String>
<system:String x:Key="AllTasksComplete">任务已全部完成!</system:String>
<system:String x:Key="SanityReport">理智将在 {DateTime} 回满。</system:String>
<system:String x:Key="SanityReport">理智将在 {DateTime} ({TimeDiff} 后) 回满。</system:String>
<system:String x:Key="AllTaskCompleteContent">MAA 已在 {DateTime} 完成了 {Preset} 配置下所有预设的任务。</system:String>
<system:String x:Key="BackgroundLinkStarted">开始执行任务</system:String>
<system:String x:Key="BackgroundLinkStopped">任务终止</system:String>

View File

@@ -541,7 +541,7 @@
<system:String x:Key="StartCombat" xml:space="preserve">開始戰鬥: </system:String>
<system:String x:Key="CompleteCombat">完成戰鬥</system:String>
<system:String x:Key="AllTasksComplete">任務已全部完成!</system:String>
<system:String x:Key="SanityReport">理智在 {DateTime} 回滿。</system:String>
<system:String x:Key="SanityReport">理智在 {DateTime} ({TimeDiff} 後) 回滿。</system:String>
<system:String x:Key="AllTaskCompleteContent">MAA 已在 {DateTime} 完成了 {Preset} 配置下所有預設的任務。</system:String>
<system:String x:Key="BackgroundLinkStarted">開始執行任務</system:String>
<system:String x:Key="BackgroundLinkStopped">任務終止</system:String>