From 65e1f6dca6c900dbd4bb9cec4e5c98573db361ff Mon Sep 17 00:00:00 2001 From: uye <99072975+ABA2396@users.noreply.github.com> Date: Wed, 4 Jun 2025 02:13:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BD=A9=E8=89=B2=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Models/Achievement.cs | 33 +++---------------- src/MaaWpfGui/Res/Themes/Dark.xaml | 9 +++++ src/MaaWpfGui/Res/Themes/Light.xaml | 9 +++++ .../Views/UI/AchievementListWindow.xaml | 10 +----- 4 files changed, 23 insertions(+), 38 deletions(-) diff --git a/src/MaaWpfGui/Models/Achievement.cs b/src/MaaWpfGui/Models/Achievement.cs index e0eb8f7e94..aa63782a4f 100644 --- a/src/MaaWpfGui/Models/Achievement.cs +++ b/src/MaaWpfGui/Models/Achievement.cs @@ -87,7 +87,7 @@ namespace MaaWpfGui.Models { if (IsRare) { - return "AchievementBrush.Rare"; + return "AchievementBrush.Rare.LinearGradientBrush"; } if (!IsUnlocked) @@ -105,41 +105,16 @@ namespace MaaWpfGui.Models } [JsonIgnore] - public SolidColorBrush MedalBrush + public Brush MedalBrush { get { - if (Application.Current.Resources[MedalBrushKey] is SolidColorBrush brush) + if (Application.Current.Resources[MedalBrushKey] is Brush brush) { return brush; } - return new(Colors.Transparent); - } - } - - [JsonIgnore] - public LinearGradientBrush RareBrush - { - get - { - var linearGradientBrush = new LinearGradientBrush { StartPoint = new(0, 0), EndPoint = new(1, 1) }; - var categories = Enum.GetValues().ToArray(); - int count = categories.Length; - - for (int i = 0; i < count; i++) - { - var category = categories[i]; - if (Application.Current.Resources[$"AchievementBrush.{category}"] is not SolidColorBrush brush) - { - continue; - } - - double offset = (double)i / (count - 1); - linearGradientBrush.GradientStops.Add(new(brush.Color, offset)); - } - - return linearGradientBrush; + return new SolidColorBrush(Colors.Transparent); } } } diff --git a/src/MaaWpfGui/Res/Themes/Dark.xaml b/src/MaaWpfGui/Res/Themes/Dark.xaml index f41c2b85f6..e0d584dff6 100644 --- a/src/MaaWpfGui/Res/Themes/Dark.xaml +++ b/src/MaaWpfGui/Res/Themes/Dark.xaml @@ -59,6 +59,15 @@ + + + + + + + + + diff --git a/src/MaaWpfGui/Res/Themes/Light.xaml b/src/MaaWpfGui/Res/Themes/Light.xaml index 0ada2febe5..7938dc20a6 100644 --- a/src/MaaWpfGui/Res/Themes/Light.xaml +++ b/src/MaaWpfGui/Res/Themes/Light.xaml @@ -38,6 +38,15 @@ + + + + + + + + + diff --git a/src/MaaWpfGui/Views/UI/AchievementListWindow.xaml b/src/MaaWpfGui/Views/UI/AchievementListWindow.xaml index 0bc7f2fe21..89f951e35d 100644 --- a/src/MaaWpfGui/Views/UI/AchievementListWindow.xaml +++ b/src/MaaWpfGui/Views/UI/AchievementListWindow.xaml @@ -21,17 +21,9 @@ - + Stretch="Uniform"/>