mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Compare commits
3 Commits
fix/compos
...
fix/naviga
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9b784818d | ||
|
|
1b8e0e9231 | ||
|
|
c1f2bb132a |
@@ -36,7 +36,6 @@ 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)
|
* [向我们提交 PR / Make Pull Requests](https://github.com/DGP-Studio/Snap.Hutao/pulls)
|
||||||
* [在 Crowdin 上进行本地化 / Translate Project on Crowdin](https://translate.hut.ao/)
|
* [在 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
|
## 特别感谢 / Special Thanks
|
||||||
|
|
||||||
|
|||||||
24
build.cake
24
build.cake
@@ -69,6 +69,15 @@ else if (AppVeyor.IsRunningOnAppVeyor)
|
|||||||
})[..^2];
|
})[..^2];
|
||||||
Information($"Version: {version}");
|
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")
|
Task("Build")
|
||||||
.IsDependentOn("Build binary package")
|
.IsDependentOn("Build binary package")
|
||||||
@@ -112,6 +121,17 @@ Task("Generate AppxManifest")
|
|||||||
Information("Using Release configuration");
|
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\"");
|
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);
|
System.IO.File.WriteAllText(manifest, content);
|
||||||
|
|
||||||
@@ -173,6 +193,10 @@ Task("Build MSIX")
|
|||||||
{
|
{
|
||||||
arguments = "pack /d " + binPath + " /p " + System.IO.Path.Combine(outputPath, $"Snap.Hutao-{version}.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(
|
var p = StartProcess(
|
||||||
"makeappx.exe",
|
"makeappx.exe",
|
||||||
new ProcessSettings
|
new ProcessSettings
|
||||||
|
|||||||
@@ -168,7 +168,6 @@ internal abstract partial class CompositionImage : Microsoft.UI.Xaml.Controls.Co
|
|||||||
if (surface.DecodedPhysicalSize.Size() <= 0D)
|
if (surface.DecodedPhysicalSize.Size() <= 0D)
|
||||||
{
|
{
|
||||||
await Task.WhenAny(surfaceLoadTaskCompletionSource.Task, Task.Delay(5000, token)).ConfigureAwait(true);
|
await Task.WhenAny(surfaceLoadTaskCompletionSource.Task, Task.Delay(5000, token)).ConfigureAwait(true);
|
||||||
await Task.Delay(50, token).ConfigureAwait(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadImageSurfaceCompleted(surface);
|
LoadImageSurfaceCompleted(surface);
|
||||||
|
|||||||
@@ -104,10 +104,14 @@ internal sealed partial class GachaLogViewModel : Abstraction.ViewModel
|
|||||||
ArgumentNullException.ThrowIfNull(gachaLogService.ArchiveCollection);
|
ArgumentNullException.ThrowIfNull(gachaLogService.ArchiveCollection);
|
||||||
ObservableCollection<GachaArchive> archives = gachaLogService.ArchiveCollection;
|
ObservableCollection<GachaArchive> archives = gachaLogService.ArchiveCollection;
|
||||||
|
|
||||||
|
using (await EnterCriticalExecutionAsync().ConfigureAwait(false))
|
||||||
|
{
|
||||||
await taskContext.SwitchToMainThreadAsync();
|
await taskContext.SwitchToMainThreadAsync();
|
||||||
Archives = archives;
|
Archives = archives;
|
||||||
HutaoCloudViewModel.RetrieveCommand = RetrieveFromCloudCommand;
|
HutaoCloudViewModel.RetrieveCommand = RetrieveFromCloudCommand;
|
||||||
await SetSelectedArchiveAndUpdateStatisticsAsync(Archives.SelectedOrDefault(), true).ConfigureAwait(false);
|
await SetSelectedArchiveAndUpdateStatisticsAsync(Archives.SelectedOrDefault(), true).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,11 +92,10 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel
|
|||||||
|
|
||||||
protected override async ValueTask<bool> InitializeUIAsync()
|
protected override async ValueTask<bool> InitializeUIAsync()
|
||||||
{
|
{
|
||||||
if (!await metadataService.InitializeAsync().ConfigureAwait(false))
|
if (await metadataService.InitializeAsync().ConfigureAwait(false))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
levelAvatarCurveMap = await metadataService.GetLevelToAvatarCurveMapAsync().ConfigureAwait(false);
|
levelAvatarCurveMap = await metadataService.GetLevelToAvatarCurveMapAsync().ConfigureAwait(false);
|
||||||
promotes = await metadataService.GetAvatarPromoteListAsync().ConfigureAwait(false);
|
promotes = await metadataService.GetAvatarPromoteListAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
@@ -109,9 +108,13 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel
|
|||||||
|
|
||||||
await CombineComplexDataAsync(list, idMaterialMap).ConfigureAwait(false);
|
await CombineComplexDataAsync(list, idMaterialMap).ConfigureAwait(false);
|
||||||
|
|
||||||
|
using (await EnterCriticalExecutionAsync().ConfigureAwait(false))
|
||||||
|
{
|
||||||
await taskContext.SwitchToMainThreadAsync();
|
await taskContext.SwitchToMainThreadAsync();
|
||||||
Avatars = new(list, true);
|
Avatars = new(list, true);
|
||||||
Selected = Avatars.View.ElementAtOrDefault(0);
|
Selected = Avatars.View.ElementAtOrDefault(0);
|
||||||
|
}
|
||||||
|
|
||||||
FilterTokens = [];
|
FilterTokens = [];
|
||||||
|
|
||||||
availableTokens = FrozenDictionary.ToFrozenDictionary(
|
availableTokens = FrozenDictionary.ToFrozenDictionary(
|
||||||
@@ -126,6 +129,13 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private async ValueTask CombineComplexDataAsync(List<Avatar> avatars, Dictionary<MaterialId, Material> idMaterialMap)
|
private async ValueTask CombineComplexDataAsync(List<Avatar> avatars, Dictionary<MaterialId, Material> idMaterialMap)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ internal sealed partial class WikiMonsterViewModel : Abstraction.ViewModel
|
|||||||
protected override async ValueTask<bool> InitializeUIAsync()
|
protected override async ValueTask<bool> InitializeUIAsync()
|
||||||
{
|
{
|
||||||
if (await metadataService.InitializeAsync().ConfigureAwait(false))
|
if (await metadataService.InitializeAsync().ConfigureAwait(false))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
levelMonsterCurveMap = await metadataService.GetLevelToMonsterCurveMapAsync().ConfigureAwait(false);
|
levelMonsterCurveMap = await metadataService.GetLevelToMonsterCurveMapAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
@@ -63,12 +65,20 @@ internal sealed partial class WikiMonsterViewModel : Abstraction.ViewModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Monster> ordered = monsters.SortBy(m => m.RelationshipId.Value);
|
List<Monster> ordered = monsters.SortBy(m => m.RelationshipId.Value);
|
||||||
await taskContext.SwitchToMainThreadAsync();
|
|
||||||
|
|
||||||
|
using (await EnterCriticalExecutionAsync().ConfigureAwait(false))
|
||||||
|
{
|
||||||
|
await taskContext.SwitchToMainThreadAsync();
|
||||||
Monsters = new(ordered, true);
|
Monsters = new(ordered, true);
|
||||||
Selected = Monsters.View.ElementAtOrDefault(0);
|
Selected = Monsters.View.ElementAtOrDefault(0);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel
|
|||||||
protected override async Task OpenUIAsync()
|
protected override async Task OpenUIAsync()
|
||||||
{
|
{
|
||||||
if (await metadataService.InitializeAsync().ConfigureAwait(false))
|
if (await metadataService.InitializeAsync().ConfigureAwait(false))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
levelWeaponCurveMap = await metadataService.GetLevelToWeaponCurveMapAsync().ConfigureAwait(false);
|
levelWeaponCurveMap = await metadataService.GetLevelToWeaponCurveMapAsync().ConfigureAwait(false);
|
||||||
promotes = await metadataService.GetWeaponPromoteListAsync().ConfigureAwait(false);
|
promotes = await metadataService.GetWeaponPromoteListAsync().ConfigureAwait(false);
|
||||||
@@ -105,10 +107,14 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel
|
|||||||
|
|
||||||
await CombineComplexDataAsync(list, idMaterialMap).ConfigureAwait(false);
|
await CombineComplexDataAsync(list, idMaterialMap).ConfigureAwait(false);
|
||||||
|
|
||||||
|
using (await EnterCriticalExecutionAsync().ConfigureAwait(false))
|
||||||
|
{
|
||||||
await taskContext.SwitchToMainThreadAsync();
|
await taskContext.SwitchToMainThreadAsync();
|
||||||
|
|
||||||
Weapons = new(list, true);
|
Weapons = new(list, true);
|
||||||
Selected = Weapons.View.ElementAtOrDefault(0);
|
Selected = Weapons.View.ElementAtOrDefault(0);
|
||||||
|
}
|
||||||
|
|
||||||
FilterTokens = [];
|
FilterTokens = [];
|
||||||
|
|
||||||
availableTokens = FrozenDictionary.ToFrozenDictionary(
|
availableTokens = FrozenDictionary.ToFrozenDictionary(
|
||||||
@@ -119,6 +125,10 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel
|
|||||||
.. IntrinsicFrozen.WeaponTypes.Select(w => KeyValuePair.Create(w, new SearchToken(SearchTokenKind.WeaponType, w, iconUri: WeaponTypeIconConverter.WeaponTypeNameToIconUri(w)))),
|
.. 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)
|
private async ValueTask CombineComplexDataAsync(List<Weapon> weapons, Dictionary<MaterialId, Material> idMaterialMap)
|
||||||
|
|||||||
Reference in New Issue
Block a user