Compare commits

..

4 Commits

Author SHA1 Message Date
qhy040404
e48ce1dd3b add delay to fix blink again 2024-03-08 18:41:22 +08:00
DismissedLight
1c847626c7 Merge pull request #1453 from Mikachu2333/develop 2024-03-08 16:12:08 +08:00
LinkChou
062a09c632 correct 2024-03-08 12:16:55 +08:00
LinkChou
7433c1832a add tips about 'test binary package' 2024-03-07 19:41:42 +08:00
7 changed files with 71 additions and 127 deletions

View File

@@ -35,7 +35,8 @@ Install with Snap Hutao MSIX package, can be installed with Windows built-in App
* [向我们提交 PR / Make Pull Requests](https://github.com/DGP-Studio/Snap.Hutao/pulls)
* [在 Crowdin 上进行本地化 / Translate Project on Crowdin](https://translate.hut.ao/)
* [为我们更新文档 / Enhance our Document ](https://github.com/DGP-Studio/Snap.Hutao.Docs)
* [为我们更新文档 / Enhance our Document](https://github.com/DGP-Studio/Snap.Hutao.Docs)
* [帮助我们测试程序 / Test Binary Package](https://hut.ao/development/contribute.html)
## 特别感谢 / Special Thanks

View File

@@ -69,15 +69,6 @@ else if (AppVeyor.IsRunningOnAppVeyor)
})[..^2];
Information($"Version: {version}");
}
else // Local
{
repoDir = System.Environment.CurrentDirectory;
outputPath = System.IO.Path.Combine(repoDir, "src", "output");
version = System.DateTime.Now.ToString("yyyy.M.d.") + ((int)((System.DateTime.Now - System.DateTime.Today).TotalSeconds / 86400 * 65535)).ToString();
Information($"Version: {version}");
}
Task("Build")
.IsDependentOn("Build binary package")
@@ -121,17 +112,6 @@ Task("Generate AppxManifest")
Information("Using Release configuration");
content = System.Text.RegularExpressions.Regex.Replace(content, " Publisher=\"([^\"]*)\"", " Publisher=\"CN=SignPath Foundation, O=SignPath Foundation, L=Lewes, S=Delaware, C=US\"");
}
else
{
Information("Using Local configuration.");
content = content
.Replace("Snap Hutao", "Snap Hutao Local")
.Replace("胡桃", "胡桃 Local")
.Replace("DGP Studio", "DGP Studio CI");
content = System.Text.RegularExpressions.Regex.Replace(content, " Name=\"([^\"]*)\"", " Name=\"E8B6E2B3-D2A0-4435-A81D-2A16AAF405C7\"");
content = System.Text.RegularExpressions.Regex.Replace(content, " Publisher=\"([^\"]*)\"", " Publisher=\"E=admin@dgp-studio.cn, CN=DGP Studio CI, OU=CI, O=DGP-Studio, L=San Jose, S=CA, C=US\"");
content = System.Text.RegularExpressions.Regex.Replace(content, " Version=\"([0-9\\.]+)\"", $" Version=\"{version}\"");
}
System.IO.File.WriteAllText(manifest, content);
@@ -193,10 +173,6 @@ Task("Build MSIX")
{
arguments = "pack /d " + binPath + " /p " + System.IO.Path.Combine(outputPath, $"Snap.Hutao-{version}.msix");
}
else
{
arguments = "pack /d " + binPath + " /p " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Local-{version}.msix");
}
var p = StartProcess(
"makeappx.exe",
new ProcessSettings

View File

@@ -168,6 +168,7 @@ internal abstract partial class CompositionImage : Microsoft.UI.Xaml.Controls.Co
if (surface.DecodedPhysicalSize.Size() <= 0D)
{
await Task.WhenAny(surfaceLoadTaskCompletionSource.Task, Task.Delay(5000, token)).ConfigureAwait(true);
await Task.Delay(50, token).ConfigureAwait(true);
}
LoadImageSurfaceCompleted(surface);

View File

@@ -104,14 +104,10 @@ internal sealed partial class GachaLogViewModel : Abstraction.ViewModel
ArgumentNullException.ThrowIfNull(gachaLogService.ArchiveCollection);
ObservableCollection<GachaArchive> archives = gachaLogService.ArchiveCollection;
using (await EnterCriticalExecutionAsync().ConfigureAwait(false))
{
await taskContext.SwitchToMainThreadAsync();
Archives = archives;
HutaoCloudViewModel.RetrieveCommand = RetrieveFromCloudCommand;
await SetSelectedArchiveAndUpdateStatisticsAsync(Archives.SelectedOrDefault(), true).ConfigureAwait(false);
}
return true;
}
}

View File

@@ -92,10 +92,11 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel
protected override async ValueTask<bool> InitializeUIAsync()
{
if (await metadataService.InitializeAsync().ConfigureAwait(false))
{
try
if (!await metadataService.InitializeAsync().ConfigureAwait(false))
{
return false;
}
levelAvatarCurveMap = await metadataService.GetLevelToAvatarCurveMapAsync().ConfigureAwait(false);
promotes = await metadataService.GetAvatarPromoteListAsync().ConfigureAwait(false);
@@ -108,13 +109,9 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel
await CombineComplexDataAsync(list, idMaterialMap).ConfigureAwait(false);
using (await EnterCriticalExecutionAsync().ConfigureAwait(false))
{
await taskContext.SwitchToMainThreadAsync();
Avatars = new(list, true);
Selected = Avatars.View.ElementAtOrDefault(0);
}
FilterTokens = [];
availableTokens = FrozenDictionary.ToFrozenDictionary(
@@ -129,13 +126,6 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel
return true;
}
catch (OperationCanceledException)
{
}
}
return false;
}
private async ValueTask CombineComplexDataAsync(List<Avatar> avatars, Dictionary<MaterialId, Material> idMaterialMap)
{

View File

@@ -52,8 +52,6 @@ internal sealed partial class WikiMonsterViewModel : Abstraction.ViewModel
protected override async ValueTask<bool> InitializeUIAsync()
{
if (await metadataService.InitializeAsync().ConfigureAwait(false))
{
try
{
levelMonsterCurveMap = await metadataService.GetLevelToMonsterCurveMapAsync().ConfigureAwait(false);
@@ -65,20 +63,12 @@ internal sealed partial class WikiMonsterViewModel : Abstraction.ViewModel
}
List<Monster> ordered = monsters.SortBy(m => m.RelationshipId.Value);
using (await EnterCriticalExecutionAsync().ConfigureAwait(false))
{
await taskContext.SwitchToMainThreadAsync();
Monsters = new(ordered, true);
Selected = Monsters.View.ElementAtOrDefault(0);
}
return true;
}
catch (OperationCanceledException)
{
}
}
return false;
}

View File

@@ -91,8 +91,6 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel
protected override async Task OpenUIAsync()
{
if (await metadataService.InitializeAsync().ConfigureAwait(false))
{
try
{
levelWeaponCurveMap = await metadataService.GetLevelToWeaponCurveMapAsync().ConfigureAwait(false);
promotes = await metadataService.GetWeaponPromoteListAsync().ConfigureAwait(false);
@@ -107,14 +105,10 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel
await CombineComplexDataAsync(list, idMaterialMap).ConfigureAwait(false);
using (await EnterCriticalExecutionAsync().ConfigureAwait(false))
{
await taskContext.SwitchToMainThreadAsync();
Weapons = new(list, true);
Selected = Weapons.View.ElementAtOrDefault(0);
}
FilterTokens = [];
availableTokens = FrozenDictionary.ToFrozenDictionary(
@@ -125,10 +119,6 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel
.. IntrinsicFrozen.WeaponTypes.Select(w => KeyValuePair.Create(w, new SearchToken(SearchTokenKind.WeaponType, w, iconUri: WeaponTypeIconConverter.WeaponTypeNameToIconUri(w)))),
]);
}
catch (OperationCanceledException)
{
}
}
}
private async ValueTask CombineComplexDataAsync(List<Weapon> weapons, Dictionary<MaterialId, Material> idMaterialMap)