This commit is contained in:
DismissedLight
2023-10-15 16:14:22 +08:00
parent a29b487c26
commit 58643a60b5
4 changed files with 31 additions and 7 deletions

View File

@@ -1,6 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/CsWin32/main/src/Microsoft.Windows.CsWin32/settings.schema.json",
"allowMarshaling": true,
"useSafeHandles": false,
"emitSingleFile": true
"useSafeHandles": false
}

View File

@@ -10,8 +10,8 @@ internal struct ContentDialogHideToken : IDisposable, IAsyncDisposable
private readonly ContentDialog contentDialog;
private readonly ITaskContext taskContext;
private bool disposed = false;
private bool disposing = false;
private bool disposed = false;
public ContentDialogHideToken(ContentDialog contentDialog, ITaskContext taskContext)
{

View File

@@ -105,8 +105,12 @@ internal static class SummaryHelper
/// <returns>分数</returns>
public static float GetPercentSubAffixScore(in ReliquarySubAffixId appendId)
{
// 圣遗物相同类型副词条强化档位一共为 4 档
// 恰好为 70% 80% 90% 100%
// 圣遗物相同类型副词条强化档位一共为 4/3/2
// 五星 为 70% 80% 90% 100%
// 四星 为 70% 80% 90% 100%
// 三星 为 70% 80% 90% 100%
// 二星 为 70% 85% 100%
// 二星 为 80% 100%
// 通过计算与最大属性的 Id 差来决定当前副词条的强化档位
uint maxId = GetAffixMaxId(appendId);
uint delta = maxId - appendId;
@@ -119,7 +123,11 @@ internal static class SummaryHelper
(5 or 4 or 3, 3) => 70F,
(2, 0) => 100F,
(2, 1) => 80F,
(2, 1) => 85F,
(2, 2) => 70F,
(1, 0) => 100F,
(1, 1) => 80F,
_ => throw Must.NeverHappen($"Unexpected AppendId: {appendId.Value} Delta: {delta}"),
};

View File

@@ -14,6 +14,7 @@ using Snap.Hutao.Service.GachaLog.QueryProvider;
using Snap.Hutao.Service.Notification;
using Snap.Hutao.View.Dialog;
using System.Collections.ObjectModel;
using System.Runtime.InteropServices;
using Windows.Storage.Pickers;
namespace Snap.Hutao.ViewModel.GachaLog;
@@ -144,7 +145,23 @@ internal sealed partial class GachaLogViewModel : Abstraction.ViewModel
RefreshStrategy strategy = IsAggressiveRefresh ? RefreshStrategy.AggressiveMerge : RefreshStrategy.LazyMerge;
GachaLogRefreshProgressDialog dialog = await contentDialogFactory.CreateInstanceAsync<GachaLogRefreshProgressDialog>().ConfigureAwait(false);
ContentDialogHideToken hideToken = await dialog.BlockAsync(taskContext).ConfigureAwait(false);
ContentDialogHideToken hideToken;
try
{
hideToken = await dialog.BlockAsync(taskContext).ConfigureAwait(false);
}
catch (COMException ex)
{
if (ex.HResult == unchecked((int)0x80000019))
{
infoBarService.Error(ex);
return;
}
throw;
}
IProgress<GachaLogFetchStatus> progress = taskContext.CreateProgressForMainThread<GachaLogFetchStatus>(dialog.OnReport);
bool authkeyValid;