From 07d42cedd1ce671a668706e0c2cec1fa17e40195 Mon Sep 17 00:00:00 2001 From: Lightczx <1686188646@qq.com> Date: Tue, 31 Oct 2023 15:19:25 +0800 Subject: [PATCH 01/20] page style --- .../Behavior/StartAnimationActionNoThrow.cs | 31 + .../Control/Theme/ItemsPanelTemplate.xaml | 6 + .../Snap.Hutao/View/Page/AchievementPage.xaml | 31 +- .../View/Page/AnnouncementPage.xaml | 234 ++--- .../View/Page/AvatarPropertyPage.xaml | 850 ++++++++---------- .../Snap.Hutao/View/Page/CultivationPage.xaml | 52 +- 6 files changed, 602 insertions(+), 602 deletions(-) create mode 100644 src/Snap.Hutao/Snap.Hutao/Control/Behavior/StartAnimationActionNoThrow.cs diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Behavior/StartAnimationActionNoThrow.cs b/src/Snap.Hutao/Snap.Hutao/Control/Behavior/StartAnimationActionNoThrow.cs new file mode 100644 index 00000000..b28641c0 --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Control/Behavior/StartAnimationActionNoThrow.cs @@ -0,0 +1,31 @@ +// Copyright (c) DGP Studio. All rights reserved. +// Licensed under the MIT license. + +using CommunityToolkit.WinUI.Animations; +using Microsoft.UI.Xaml; +using Microsoft.Xaml.Interactivity; + +namespace Snap.Hutao.Control.Behavior; + +[DependencyProperty("Animation", typeof(AnimationSet))] +[DependencyProperty("TargetObject", typeof(UIElement))] +internal sealed partial class StartAnimationActionNoThrow : DependencyObject, IAction +{ + /// + public object Execute(object sender, object parameter) + { + if (Animation is not null) + { + if (TargetObject is not null) + { + Animation.Start(TargetObject); + } + else + { + Animation.Start(sender as UIElement); + } + } + + return default!; + } +} \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml b/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml index 46d10041..d20b99d6 100644 --- a/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml +++ b/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml @@ -20,4 +20,10 @@ Columns="5" RowSpacing="4"/> + + + diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/AchievementPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/AchievementPage.xaml index 9aa68812..2677c78a 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/AchievementPage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/AchievementPage.xaml @@ -164,6 +164,21 @@ + + + + @@ -282,6 +297,7 @@ PaneBackground="{x:Null}"> - - - @@ -301,16 +312,10 @@ - - - - + SelectionMode="None"/> diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/AnnouncementPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/AnnouncementPage.xaml index b5f3f6f3..cd672dbb 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/AnnouncementPage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/AnnouncementPage.xaml @@ -29,9 +29,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -184,7 +189,6 @@ - @@ -223,11 +227,11 @@ diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml index 8aef9263..f3295f40 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml @@ -58,6 +58,382 @@ GridValue="{x:Bind GridImageExportPanel}" ListValue="{x:Bind ListImageExportPanel}"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -110,12 +486,10 @@ - - - - - - + @@ -123,117 +497,9 @@ Margin="16,16,4,-8" cwa:ItemsReorderAnimation.Duration="0:0:0.1" ItemContainerStyle="{StaticResource LargeGridViewItemStyle}" + ItemTemplate="{StaticResource AvatarGridViewTemplate}" ItemsSource="{Binding Summary.Avatars}" - SelectedItem="{Binding SelectedAvatar, Mode=TwoWay}"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + SelectedItem="{Binding SelectedAvatar, Mode=TwoWay}"/> @@ -245,66 +511,10 @@ OpenPaneLength="{StaticResource CompatSplitViewOpenPaneLength2}" PaneBackground="Transparent"> - - - - - - - - - - - - - - - - - - - - - - - + @@ -449,12 +659,8 @@ Grid.Row="1" Grid.Column="0" Margin="16" + ItemsPanel="{StaticResource HorizontalStackPanelTemplate}" ItemsSource="{Binding SelectedAvatar.Constellations}"> - - - - - - - - + ItemTemplate="{StaticResource AvatarConstellationTemplate}" + ItemsSource="{Binding SelectedAvatar.Skills}"/> @@ -598,221 +742,19 @@ HorizontalContentAlignment="Stretch" Background="{x:Null}" Header="{shcm:ResourceString Name=ViewPageAvatarPropertyHeader}"> - + - - - - - - - - - - - - - - - - - - - - - + ItemTemplate="{StaticResource AvatarPropertyTemplate}" + ItemsSource="{Binding SelectedAvatar.Properties}"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml index ba5c34e4..0dea4549 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml @@ -20,27 +20,39 @@ mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + - - - 0.4 - - - 1 - - + + + 0.4 + + + 1 + + - - - - - - - + + @@ -176,7 +188,7 @@ Margin="6,0,0,0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" - Background="{Binding IsToday, Converter={StaticResource BoolToBrushSelector}}" + Background="{Binding IsToday, Converter={ThemeResource BoolToBrushSelector}}" Command="{Binding Path=DataContext.FinishStateCommand, Source={StaticResource BindingProxy}}" CommandParameter="{Binding}" Style="{StaticResource ButtonRevealStyle}"> From 10ba927136c37383699a0546a2784e94180ddee7 Mon Sep 17 00:00:00 2001 From: Lightczx <1686188646@qq.com> Date: Tue, 31 Oct 2023 16:45:24 +0800 Subject: [PATCH 02/20] fix #1059 --- .../Snap.Hutao/View/Dialog/HutaoPassportRegisterDialog.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Snap.Hutao/Snap.Hutao/View/Dialog/HutaoPassportRegisterDialog.xaml b/src/Snap.Hutao/Snap.Hutao/View/Dialog/HutaoPassportRegisterDialog.xaml index a826c6da..d6bdc3e8 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Dialog/HutaoPassportRegisterDialog.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Dialog/HutaoPassportRegisterDialog.xaml @@ -28,7 +28,7 @@ Date: Wed, 1 Nov 2023 10:45:47 +0800 Subject: [PATCH 03/20] fix dailynote webhook error --- src/Snap.Hutao/Snap.Hutao/App.xaml | 1 + .../Snap.Hutao/Control/Theme/FlyoutStyle.xaml | 9 + .../Model/Entity/SettingEntry.Constant.cs | 5 + .../Service/DailyNote/DailyNoteOptions.cs | 4 +- src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj | 7 + .../Snap.Hutao/View/Page/CultivationPage.xaml | 411 ++++++++---------- .../Snap.Hutao/View/Page/DailyNotePage.xaml | 56 +-- 7 files changed, 236 insertions(+), 257 deletions(-) create mode 100644 src/Snap.Hutao/Snap.Hutao/Control/Theme/FlyoutStyle.xaml diff --git a/src/Snap.Hutao/Snap.Hutao/App.xaml b/src/Snap.Hutao/Snap.Hutao/App.xaml index dd980061..590d52a5 100644 --- a/src/Snap.Hutao/Snap.Hutao/App.xaml +++ b/src/Snap.Hutao/Snap.Hutao/App.xaml @@ -12,6 +12,7 @@ + diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Theme/FlyoutStyle.xaml b/src/Snap.Hutao/Snap.Hutao/Control/Theme/FlyoutStyle.xaml new file mode 100644 index 00000000..801b8137 --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Control/Theme/FlyoutStyle.xaml @@ -0,0 +1,9 @@ + + + + diff --git a/src/Snap.Hutao/Snap.Hutao/Model/Entity/SettingEntry.Constant.cs b/src/Snap.Hutao/Snap.Hutao/Model/Entity/SettingEntry.Constant.cs index e0884f67..964cd127 100644 --- a/src/Snap.Hutao/Snap.Hutao/Model/Entity/SettingEntry.Constant.cs +++ b/src/Snap.Hutao/Snap.Hutao/Model/Entity/SettingEntry.Constant.cs @@ -48,6 +48,11 @@ internal sealed partial class SettingEntry /// public const string DailyNoteSilentWhenPlayingGame = "DailyNote.SilentWhenPlayingGame"; + /// + /// 实时便笺 WebhookUrl + /// + public const string DailyNoteWebhookUrl = "DailyNote.WebhookUrl"; + /// /// 启动游戏 独占全屏 /// diff --git a/src/Snap.Hutao/Snap.Hutao/Service/DailyNote/DailyNoteOptions.cs b/src/Snap.Hutao/Snap.Hutao/Service/DailyNote/DailyNoteOptions.cs index 215137e8..3786ef2e 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/DailyNote/DailyNoteOptions.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/DailyNote/DailyNoteOptions.cs @@ -126,7 +126,7 @@ internal sealed partial class DailyNoteOptions : DbStoreOptions public string? WebhookUrl { - get => GetOption(ref webhookUrl, SettingEntry.DailyNoteSilentWhenPlayingGame); - set => SetOption(ref webhookUrl, SettingEntry.DailyNoteSilentWhenPlayingGame, value); + get => GetOption(ref webhookUrl, SettingEntry.DailyNoteWebhookUrl); + set => SetOption(ref webhookUrl, SettingEntry.DailyNoteWebhookUrl, value); } } \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj b/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj index 7782e62a..3b267b78 100644 --- a/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj +++ b/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj @@ -79,6 +79,7 @@ + @@ -307,6 +308,12 @@ + + + MSBuild:Compile + + + MSBuild:Compile diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml index 0dea4549..538ed33d 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml @@ -52,6 +52,189 @@ x:Key="BoolToStyleSelector" FalseValue="{StaticResource BodyTextBlockStyle}" TrueValue="{StaticResource BaseTextBlockStyle}"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -97,6 +280,7 @@ @@ -107,158 +291,13 @@ MinItemWidth="300" MinRowSpacing="-4"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Visible - - - - - - - - - - Collapsed - - - - - - - - - - - - - - - - - - - @@ -269,42 +308,6 @@ MinItemWidth="300" MinRowSpacing="-4"/> - - - - - - - - - - - - - - - - - - - - - @@ -348,51 +351,15 @@ - + - - - - - - - - - - - - diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/DailyNotePage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/DailyNotePage.xaml index 9ccec67a..97b6eb56 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/DailyNotePage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/DailyNotePage.xaml @@ -27,6 +27,23 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -175,7 +513,10 @@ - + - - - - - - - - - - - - - - - - - - - - - - Visible - - - - - - - - - - Collapsed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/GachaLogPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/GachaLogPage.xaml index 76fe9c82..ec1d56b2 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/GachaLogPage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/GachaLogPage.xaml @@ -7,6 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mxi="using:Microsoft.Xaml.Interactivity" + xmlns:mxic="using:Microsoft.Xaml.Interactions.Core" xmlns:shc="using:Snap.Hutao.Control" xmlns:shcb="using:Snap.Hutao.Control.Behavior" xmlns:shci="using:Snap.Hutao.Control.Image" @@ -21,6 +22,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +