mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
feat: 彩色!
This commit is contained in:
@@ -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<AchievementCategory>().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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,15 @@
|
||||
<SolidColorBrush x:Key="AchievementBrush.BugRelated" Color="#EF9A9A" />
|
||||
<SolidColorBrush x:Key="AchievementBrush.EasterEgg" Color="#FFF176" />
|
||||
<SolidColorBrush x:Key="AchievementBrush.Rare" Color="#F48FB1" />
|
||||
<LinearGradientBrush x:Key="AchievementBrush.Rare.LinearGradientBrush" StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Offset="0.0" Color="#90CAF9" />
|
||||
<GradientStop Offset="0.17" Color="#A5D6A7" />
|
||||
<GradientStop Offset="0.33" Color="#FFCC80" />
|
||||
<GradientStop Offset="0.5" Color="#CE93D8" />
|
||||
<GradientStop Offset="0.67" Color="#EF9A9A" />
|
||||
<GradientStop Offset="0.83" Color="#FFF176" />
|
||||
<GradientStop Offset="1" Color="#F48FB1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<!-- MdXaml Brush -->
|
||||
<SolidColorBrush x:Key="MdXamlBackground" Color="#2d2d30" />
|
||||
|
||||
@@ -38,6 +38,15 @@
|
||||
<SolidColorBrush x:Key="AchievementBrush.BugRelated" Color="#EF5350" />
|
||||
<SolidColorBrush x:Key="AchievementBrush.EasterEgg" Color="#FFEB3B" />
|
||||
<SolidColorBrush x:Key="AchievementBrush.Rare" Color="#EC407A" />
|
||||
<LinearGradientBrush x:Key="AchievementBrush.Rare.LinearGradientBrush" StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Offset="0.0" Color="#42A5F5" />
|
||||
<GradientStop Offset="0.17" Color="#66BB6A" />
|
||||
<GradientStop Offset="0.33" Color="#FFA726" />
|
||||
<GradientStop Offset="0.5" Color="#AB47BC" />
|
||||
<GradientStop Offset="0.67" Color="#EF5350" />
|
||||
<GradientStop Offset="0.83" Color="#FFEB3B" />
|
||||
<GradientStop Offset="1" Color="#EC407A" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<!-- MdXaml Brush -->
|
||||
<SolidColorBrush x:Key="MdXamlBackground" Color="#ffffff" />
|
||||
|
||||
@@ -21,17 +21,9 @@
|
||||
<Path
|
||||
Width="40"
|
||||
Height="40"
|
||||
Visibility="{c:Binding !IsRare}"
|
||||
Data="{DynamicResource HangoverGeometry}"
|
||||
Fill="{Binding MedalBrush}"
|
||||
Stretch="Uniform" />
|
||||
<Path
|
||||
Width="40"
|
||||
Height="40"
|
||||
Visibility="{c:Binding IsRare}"
|
||||
Data="{DynamicResource HangoverGeometry}"
|
||||
Fill="{Binding RareBrush}"
|
||||
Stretch="Uniform" />
|
||||
Stretch="Uniform"/>
|
||||
<VirtualizingStackPanel Margin="8" HorizontalAlignment="Left">
|
||||
<TextBlock
|
||||
FontWeight="Bold"
|
||||
|
||||
Reference in New Issue
Block a user