mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-20 10:57:45 +08:00
chore: 全用动态资源
This commit is contained in:
@@ -58,36 +58,70 @@ namespace MaaWpfGui.Constants
|
||||
[UsedImplicitly]
|
||||
public const string RobotOperator = "RobotOperatorLogBrush";
|
||||
|
||||
#region 公招
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 1-star operators (also used for robot operators).
|
||||
/// </summary>
|
||||
public const string Star1Operator = "Star1OperatorLogBrush";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 1-star operators when potential is full.
|
||||
/// </summary>
|
||||
public const string Star1OperatorPotentialFull = "Star1OperatorLogBrushPotentialFull";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 2-star operators.
|
||||
/// </summary>
|
||||
public const string Star2Operator = "Star2OperatorLogBrush";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 2-star operators when potential is full.
|
||||
/// </summary>
|
||||
public const string Star2OperatorPotentialFull = "Star2OperatorLogBrushPotentialFull";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 3-star operators.
|
||||
/// </summary>
|
||||
public const string Star3Operator = "Star3OperatorLogBrush";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 3-star operators when potential is full.
|
||||
/// </summary>
|
||||
public const string Star3OperatorPotentialFull = "Star3OperatorLogBrushPotentialFull";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 4-star operators.
|
||||
/// </summary>
|
||||
public const string Star4Operator = "Star4OperatorLogBrush";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 4-star operators when potential is full.
|
||||
/// </summary>
|
||||
public const string Star4OperatorPotentialFull = "Star4OperatorLogBrushPotentialFull";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 5-star operators.
|
||||
/// </summary>
|
||||
public const string Star5Operator = "Star5OperatorLogBrush";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 5-star operators when potential is full.
|
||||
/// </summary>
|
||||
public const string Star5OperatorPotentialFull = "Star5OperatorLogBrushPotentialFull";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 6-star operators.
|
||||
/// </summary>
|
||||
public const string Star6Operator = "Star6OperatorLogBrush";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for 6-star operators when potential is full.
|
||||
/// </summary>
|
||||
public const string Star6OperatorPotentialFull = "Star6OperatorLogBrushPotentialFull";
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for file downloading or downloaded or download failed.
|
||||
/// </summary>
|
||||
|
||||
@@ -85,12 +85,20 @@
|
||||
<SolidColorBrush x:Key="MessageLogBrush" Color="#E6E6E6" />
|
||||
<SolidColorBrush x:Key="RareOperatorLogBrush" Color="Orange" />
|
||||
<SolidColorBrush x:Key="RobotOperatorLogBrush" Color="Gray" />
|
||||
|
||||
<SolidColorBrush x:Key="Star1OperatorLogBrush" Color="#E6E6E6" />
|
||||
<SolidColorBrush x:Key="Star1OperatorLogBrushPotentialFull" Color="#66E6E6E6" />
|
||||
<SolidColorBrush x:Key="Star2OperatorLogBrush" Color="#88BB44" />
|
||||
<SolidColorBrush x:Key="Star2OperatorLogBrushPotentialFull" Color="#6688BB44" />
|
||||
<SolidColorBrush x:Key="Star3OperatorLogBrush" Color="#66CCFF" />
|
||||
<SolidColorBrush x:Key="Star3OperatorLogBrushPotentialFull" Color="#6666CCFF" />
|
||||
<SolidColorBrush x:Key="Star4OperatorLogBrush" Color="#BB88FF" />
|
||||
<SolidColorBrush x:Key="Star4OperatorLogBrushPotentialFull" Color="#66BB88FF" />
|
||||
<SolidColorBrush x:Key="Star5OperatorLogBrush" Color="#FFBB55" />
|
||||
<SolidColorBrush x:Key="Star5OperatorLogBrushPotentialFull" Color="#66FFBB55" />
|
||||
<SolidColorBrush x:Key="Star6OperatorLogBrush" Color="Orange" />
|
||||
<SolidColorBrush x:Key="Star6OperatorLogBrushPotentialFull" Color="#66FFA500" />
|
||||
|
||||
<SolidColorBrush x:Key="DownloadLogBrush" Color="Violet" />
|
||||
|
||||
<SolidColorBrush x:Key="MuMuSpecialScreenshot" Color="#02BFFF" />
|
||||
|
||||
@@ -65,12 +65,20 @@
|
||||
<SolidColorBrush x:Key="MessageLogBrush" Color="Black" />
|
||||
<SolidColorBrush x:Key="RareOperatorLogBrush" Color="DarkOrange" />
|
||||
<SolidColorBrush x:Key="RobotOperatorLogBrush" Color="DarkGray" />
|
||||
|
||||
<SolidColorBrush x:Key="Star1OperatorLogBrush" Color="Black" />
|
||||
<SolidColorBrush x:Key="Star1OperatorLogBrushPotentialFull" Color="#66000000" />
|
||||
<SolidColorBrush x:Key="Star2OperatorLogBrush" Color="#99CC33" />
|
||||
<SolidColorBrush x:Key="Star2OperatorLogBrushPotentialFull" Color="#6699CC33" />
|
||||
<SolidColorBrush x:Key="Star3OperatorLogBrush" Color="#3399FF" />
|
||||
<SolidColorBrush x:Key="Star3OperatorLogBrushPotentialFull" Color="#663399FF" />
|
||||
<SolidColorBrush x:Key="Star4OperatorLogBrush" Color="#9966FF" />
|
||||
<SolidColorBrush x:Key="Star4OperatorLogBrushPotentialFull" Color="#669966FF" />
|
||||
<SolidColorBrush x:Key="Star5OperatorLogBrush" Color="#FFAA33" />
|
||||
<SolidColorBrush x:Key="Star5OperatorLogBrushPotentialFull" Color="#66FFAA33" />
|
||||
<SolidColorBrush x:Key="Star6OperatorLogBrush" Color="DarkOrange" />
|
||||
<SolidColorBrush x:Key="Star6OperatorLogBrushPotentialFull" Color="#66FF8C00" />
|
||||
|
||||
<SolidColorBrush x:Key="DownloadLogBrush" Color="BlueViolet" />
|
||||
|
||||
<SolidColorBrush x:Key="MuMuSpecialScreenshot" Color="#02BFFF" />
|
||||
|
||||
@@ -176,22 +176,9 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
}
|
||||
|
||||
var run = new Run($"{operName}{potentialText} ");
|
||||
var opacity = isMaxPot ? 0.4 : 1.0;
|
||||
|
||||
if (Math.Abs(opacity - 1.0) < 1e-4)
|
||||
{
|
||||
var brushKey = GetBrushKeyByStar(operLevel);
|
||||
run.SetResourceReference(TextElement.ForegroundProperty, brushKey);
|
||||
run.Tag = brushKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
var brush = GetBrushWithOpacityByStar(operLevel, opacity);
|
||||
if (brush != null)
|
||||
{
|
||||
run.Foreground = brush;
|
||||
}
|
||||
}
|
||||
var brushKey = GetBrushKeyByStar(operLevel, isMaxPot);
|
||||
run.SetResourceReference(TextElement.ForegroundProperty, brushKey);
|
||||
run.Tag = brushKey;
|
||||
|
||||
recruitResultInlines.Add(run);
|
||||
}
|
||||
@@ -209,24 +196,25 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
return new(Color.FromArgb(alpha, baseColor.R, baseColor.G, baseColor.B));
|
||||
}
|
||||
|
||||
string GetBrushKeyByStar(int level)
|
||||
string GetBrushKeyByStar(int level, bool isMax)
|
||||
{
|
||||
return level switch
|
||||
return (level, isMax) switch
|
||||
{
|
||||
>= 6 => UiLogColor.Star6Operator,
|
||||
5 => UiLogColor.Star5Operator,
|
||||
4 => UiLogColor.Star4Operator,
|
||||
3 => UiLogColor.Star3Operator,
|
||||
2 => UiLogColor.Star2Operator,
|
||||
_ => UiLogColor.Star1Operator,
|
||||
(6, true) => UiLogColor.Star6OperatorPotentialFull,
|
||||
(6, false) => UiLogColor.Star6Operator,
|
||||
(5, true) => UiLogColor.Star5OperatorPotentialFull,
|
||||
(5, false) => UiLogColor.Star5Operator,
|
||||
(4, true) => UiLogColor.Star4OperatorPotentialFull,
|
||||
(4, false) => UiLogColor.Star4Operator,
|
||||
(3, true) => UiLogColor.Star3OperatorPotentialFull,
|
||||
(3, false) => UiLogColor.Star3Operator,
|
||||
(2, true) => UiLogColor.Star2OperatorPotentialFull,
|
||||
(2, false) => UiLogColor.Star2Operator,
|
||||
(1, true) => UiLogColor.Star1OperatorPotentialFull,
|
||||
(1, false) => UiLogColor.Star1Operator,
|
||||
_ => UiLogColor.Text,
|
||||
};
|
||||
}
|
||||
|
||||
Brush? GetBrushWithOpacityByStar(int level, double opacity)
|
||||
{
|
||||
var brushKey = GetBrushKeyByStar(level);
|
||||
return Application.Current.TryFindResource(brushKey) is not SolidColorBrush brush ? null : GetBrushWithOpacity(brush.Color, opacity);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _chooseLevel3 = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.ChooseLevel3, bool.FalseString));
|
||||
|
||||
Reference in New Issue
Block a user